forked from TrinsyCa/php-router
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
TrinsyCa
committed
Jun 15, 2024
1 parent
e8195b4
commit 78d8bf3
Showing
112 changed files
with
12,616 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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= |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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'); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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" | ||
} | ||
} |
Oops, something went wrong.