mirror of https://github.com/flightphp/core
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
Mike Cao
03499954a8
|
14 years ago | |
---|---|---|
flight | 14 years ago | |
LICENSE | 14 years ago | |
README.md | 14 years ago |
README.md
Flight
Flight is an extensible micro-framework for PHP. It allows you to quickly build RESTful web applications with minimal effort:
require 'flight/Flight.php';
Flight::route('/', function(){
echo 'hello world!';
});
Flight::start();
Installation
-
Download and extract the Flight framework files to your web directory.
-
Configure your webserver:
For Apache, edit your .htaccess file with the following:
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php [QSA,L]
For Nginx, add the following to your server declaration:
server {
location / {
try_files $uri $uri/ /index.php;
}
}
- Create your index.php file.
First include the framework.
require 'flight/Flight.php';
Then define a route and assign a function to handle the request.
Flight::route('/', function(){
echo 'hello world!';
});
Finally, start the framework.
Flight::start();
Requirements
Flight requires PHP 5.3 or later.
License
Flight licensed under the MIT license.