https://github.com/demirkartal/eaglephp
Lightweight Modular PHP Framework
https://github.com/demirkartal/eaglephp
eagle eaglephp framework lightweight modular php
Last synced: 8 months ago
JSON representation
Lightweight Modular PHP Framework
- Host: GitHub
- URL: https://github.com/demirkartal/eaglephp
- Owner: demirkartal
- License: mit
- Created: 2017-02-25T08:34:51.000Z (about 9 years ago)
- Default Branch: master
- Last Pushed: 2019-04-09T13:00:39.000Z (about 7 years ago)
- Last Synced: 2025-05-30T13:47:47.433Z (11 months ago)
- Topics: eagle, eaglephp, framework, lightweight, modular, php
- Language: PHP
- Homepage:
- Size: 65.4 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# EaglePHP Framework
EaglePHP is lightweight modular PHP Framework.
* \Eagle doesn’t require \Application, defining constants to bootstrap and any helper functions.
* Fast routing engine with Request and Response chain.
* Detailed explanations with phpDocumentor 2 standards.
* PSR-4 Autoload.
* Common functions in Object-Oriented;
* **Cookie:** Cookie functions by static methods.
* **ErrorHandler:** Error, Exception and Shutdown Handler.
* **File:** File handling with instance of class. ``` new File("filepath");```
* **Json:** Json functions by static methods.
* **Session:** Session functions by static methods.
* **SessionHandler:** Session handling with instance of class.
## Settings
#### Namespace/Config/config.php
```PHP
return array(
/** General Settings (Optional) */
"base_url" => "http://example.com/", // If null or not defined then auto detect
"display_errors" => true, // Production: false
"error_repoting" => E_ALL, // Production: E_ALL & ~E_DEPRECATED & ~E_STRICT
"locale" => "en-US",
"timezone" => "UTC",
/** Database (Required) */
"Database" => array(
"dns" => "mysql:dbname=databasename;host=127.0.0.1;port=3306;charset=utf8",
"username" => "root",
"password" => "",
"options" => array()
)
);
```
#### Namespace/Config/routes.php
```PHP
return array(
"path" => array( // Path of router can include regex and filters
"target" => array("Controller", "Method"), // Method of Controller
"name" => "Name", // Name for route (optional)
"filters" => array("filter" => "regex"), // User defined filters (optional)
"default" => array("param" => value) // User defined default parameters (optional)
)
);
```
#### Directories
All paths can easily be changed by the user.
```
public/
└── ...
vendor/ (Not static location)
├── Application/
│ ├── Config/ (Path by Config class)
│ ├── Controller/
│ ├── Locale/ (Path by any Controller class)
│ ├── Model/
│ ├── Module/ (Path by Module class)
│ └── View/ (Path by any Controller class)
│
└── Eagle/
└── ... (same as \Application)
```
## Run
#### For index.php file in public folder
```PHP
/** Set namespace to work */
namespace Application;
/** Initialize Eagle */
require __DIR__."/../vendor/Eagle/Eagle.php";
\Eagle\Eagle::init();
/** Load Module and Initialize */
\Eagle\Module::load("Application", __DIR__."/../vendor/Application", true);
Application::init();
/** Force Request and Print */
Request::forge()->execute()->send(true);
```
## Requirements
* PHP 7.1.3 or higher
* Optional Requirements;
* **Gettext** extension for I18n Class.
* **Mbstring** extension for UTF8 Class.
*__Note:__ Be sure about default extensions; Fileinfo, Filter and Json need to be enabled.*