https://github.com/nabeelalihashmi/fasterphp
A low overhead fast PHP framework primarily for apis
https://github.com/nabeelalihashmi/fasterphp
php php-api php-framework php-router
Last synced: 3 months ago
JSON representation
A low overhead fast PHP framework primarily for apis
- Host: GitHub
- URL: https://github.com/nabeelalihashmi/fasterphp
- Owner: nabeelalihashmi
- Created: 2021-10-17T10:11:23.000Z (over 4 years ago)
- Default Branch: master
- Last Pushed: 2021-10-27T17:21:39.000Z (over 4 years ago)
- Last Synced: 2024-12-29T20:23:16.764Z (about 1 year ago)
- Topics: php, php-api, php-framework, php-router
- Language: PHP
- Homepage: https://github.com/nabeelalihashmi/FasterPhp
- Size: 215 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# FasterPHP
## A low overhead PHP framework for APIs.
```
Turn off the composer autoload and use own libs to increase performance by 3X;
```
FasterPHP is a Route-Oriented Framework for Writing Php apps. Every file in Routes folder is a route and corresponding get, post, put, delete, head functions are handler for request method.
### Installation
Clone the repository.
```
git clone https://github.com/nabeelalihashmi/FasterPhp.git
```
And start writing code.
### Componets
* Custom Router
* RedBeanPHP
* Symfony Components [Cache, HTTP-Foundation]
* RakitValidation
* And Other...
### Folder Structure
* app/Routes
### Middlware
Before Middleware = before_get(). The Middleware function must return true to exectue main function.
parameters are passed to middleware as array;
```
function before_get($params) {
}
function after_get($params) {
}
```
### Points
* Desgin API endpoints from last point first
like
```
/api/add/half/divide/Ten/20
Filename: app/Routes/add/half/divide/Ten.php
[OR] app/Routes/add/half/divide/Ten/index.php
Function: get(number);
/api/add/half/divide/20/20
Filename: app/Routes/add/half/divide.php
[OR] app/Routes/add/half/divide/index.php
Function: get(number1, number2);
/api/add/half/20/20
Filename: app/Routes/add/half.php
[OR] app/Routes/add/half/index.php
Function: get(number1, number2);
/api/add/10/20
Filename: app/Routes/add.php
[OR] app/Routes/add/index.php
Function: get(number1, number2);
```
### How These Will Exectue:
```
/api/add/half/divide/Ten/2
Check if
/api/add/half/divide/Ten/2
IF "2" IS FOLDER
IS NOT FOLDER => Check if it is file -> OK
```