Skip to content

Commit

Permalink
first commit
Browse files Browse the repository at this point in the history
  • Loading branch information
TrinsyCa committed Jun 15, 2024
1 parent e8195b4 commit 78d8bf3
Show file tree
Hide file tree
Showing 112 changed files with 12,616 additions and 0 deletions.
7 changes: 7 additions & 0 deletions .env
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# Application Name
APP_NAME=php-router

# Base Directory
# This should be the relative path to your application directory.
# Example: if your application is located in the "projects" folder, set BASE_DIRECTORY to "p".
DIRECTORY=
10 changes: 10 additions & 0 deletions .htaccess
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
RewriteEngine On

# Redirect for the specific URL
RewriteCond %{REQUEST_URI} ^/p/php-router/$
RewriteRule ^$ settings/routes.php [L]

# Redirect all other requests to routes/routes.php if the file or directory does not exist
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ settings/routes.php [L,QSA]
35 changes: 35 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
# PHP Router Project

A simple PHP routing project template for handling URL routing in your PHP applications.

## Installation

To set up the PHP Router project, follow these steps:

1. **Clone the Repository**:

```sh
git clone https://github.com/trinsyca/php-router.git
cd php-router
```

2. **Install Dependencies**:

```sh
composer install
```

## Configuration

Before using the router, configure your environment settings in the `.env` file.

### .env

```php
<?php
// Set the application name (folder name)
define('APP_NAME', 'php-router');
// Set the directory if the project is part of another project (e.g., "localhost/projects/php-router")
define('DIRECTORY', 'projects');
22 changes: 22 additions & 0 deletions composer.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
{
"name": "trinsyca/php-router",
"description": "A simple PHP routing framework.",
"type": "project",
"keywords": ["Php Router"],
"license": "MIT",
"authors": [
{
"name": "Ömer İslamoğlu",
"email": "[email protected]"
}
],
"autoload": {
"psr-4": {
"TrinsyCa\\PhpRouter\\": "src/"
}
},
"require": {
"php": ">=7.4",
"vlucas/phpdotenv": "^5.6"
}
}
Loading

0 comments on commit 78d8bf3

Please sign in to comment.