An extensible micro-framework for PHP
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.
 
 
Go to file
n0nag0n 112796ec42
Merge pull request #718 from flightphp/replace-table-with-chart-in-readme
1 day ago
.gemini update code format instructions to PSR12 in documentation 5 days ago
.github update code format instructions to PSR12 in documentation 5 days ago
flight Merge pull request #722 from flightphp/eventdispatcher-rework 1 day ago
tests Fix flight.allow_method_override not disabling method override (GHSA-vr9m-jx6f-hhj6) 1 week ago
.editorconfig Add settings for trimming whitespace and final newline 2 months ago
.gitattributes feat: customize linters per contributor 5 months ago
.gitignore Merge branch 'master' into sort-.gitignore 2 months ago
AGENTS.md update code format instructions to PSR12 in documentation 5 days ago
CONTRIBUTING.md falsey -> falsy 5 days ago
LICENSE Initial commit 16 years ago
README.md Merge branch 'master' into replace-table-with-chart-in-readme 1 day ago
SECURITY.md Revise security policy and supported versions 4 months ago
composer.json Align Runway generators with skeleton App\ layout and fix suite gates 2 weeks ago
index.php use static callables with typehints 1 month ago
phpcs.xml.dist rename beautify -> format 2 months ago
phpstan-baseline.neon Align Runway generators with skeleton App\ layout and fix suite gates 2 weeks ago
phpstan.dist.neon Potential fix for pull request finding 2 months ago
phpunit-watcher.yml sort phpunit-watcher.yml 2 months ago
phpunit.xml.dist remove flight/autoload.php 2 months ago

README.md

Version Monthly Downloads PHPStan: Level 6 License PHP Version Require Matrix

What is Flight?

Flight is a fast, simple, extensible framework for PHP. Flight enables you to quickly and easily build RESTful web applications. Flight also has zero dependencies.

Basic Usage

First install it with Composer

composer require flightphp/core

or you can download a zip of this repo. Then you would have a basic index.php file like the following:

require 'flight/autoload.php';

Flight::route('/', function () {
    echo 'hello world!';
});

Flight::start();

Is it fast?

Yes! Flight is fast. It is one of the fastest PHP frameworks available. You can see all the benchmarks at TechEmpower

See the benchmark below with some other popular PHP frameworks. This is measured in requests processed within the same timeframe.

---
config:
  xyChart:
    showDataLabel: true
---
xychart-beta
  title "PHP Framework Performance (TechEmpower, requests/sec)"
  x-axis "Framework" ["Flight", "Yii", "Fat-Free", "Slim", "Phalcon", "Symfony", "Lumen", "Laravel", "CodeIgniter"]
  y-axis "Requests/sec (x1000)" 0 --> 200
  %% Series 1: Plaintext, Series 2: JSON
  bar [190.4, 145.7, 139.2, 89.6, 95.9, 65.1, 40.6, 26.7, 20.6]
  bar [182.5, 131.4, 134.0, 87.3, 87.7, 63.2, 39.7, 26.9, 19.9]

Skeleton App

You can also install a skeleton app. Go to flightphp/skeleton for instructions on how to get started!

Documentation

We have our own documentation website that is built with Flight (naturally). Learn more about the framework at docs.flightphp.com.

Community

Chat with us on Matrix IRC #flight-php-framework:matrix.org

Upgrading From v2

If you have a current project on v2, you should be able to upgrade to v3 with no issues depending on how your project was built. If there are any issues with upgrade, they are documented in the migrating to v3 documentation page. It is the intention of Flight to maintain longterm stability of the project and to not add rewrites with major version changes.

Requirements

[!IMPORTANT] Flight requires PHP 7.4 or greater.

[!NOTE] PHP 7.4 is supported because at the current time of writing (2024) PHP 7.4 is the default version for some LTS Linux distributions. Forcing a move to PHP 8 would cause a lot of heartburn for those users. The framework also supports PHP 8.

Roadmap

To see the current and future roadmap for the Flight Framework, visit the project roadmap

License

Flight is released under the MIT license.