Introduction

Flexagon is a lightweight, high-performance PHP web framework.

It embraces PHP's inherent simplicity over complex abstractions, keeping conventions to a minimum so you can build applications quickly.

  • Simple, flexible routing --- The file structure maps directly to the URL structure, keeping routing intuitive and straightforward.
  • Independent request execution --- Each request leaves no unnecessary state behind, keeping behavior stable and predictable.
  • Simple, idiomatic PHP development --- Build with PHP in its natural form, without introducing a separate template language.

Why Flexagon?

If you know PHP, you can get started right away.
Pages are .php files, views are written directly in PHP and HTML, and you can use the SQL you already know. There is no routing syntax, service container, or query DSL to learn before you start building.

Zero runtime dependencies.
Flexagon runs with PHP 8.3 and the pdo, openssl, and json extensions. There is no need to install dozens of third-party packages just to use the framework.

Small and fast.
In the same environment, framework bootstrap takes 1.09 ms, 2 MB of memory, and 15 loaded files. The framework itself remains compact at 39 PHP files and 7,148 lines of code.

Flexagon 3.5.0 Laravel 13.26.1
Runtime dependencies 0 77 packages
Installed size 532KB (PHAR 237KB) 42MB
Bootstrap time 1.09ms 12.85ms
Bootstrap memory 2MB 20MB
Files loaded at bootstrap 15 336

Simple deployment.
The entire framework can be deployed as a single 237 KB PHAR file. The target server does not need Composer or a separate cache-warming step.

Design Principles

URLs map directly to file paths

A request to /user/profile maps directly to public/user/profile.php.

There is no routing table to maintain. Create a file and it gets a URL; move the file and the URL moves with it. The URL itself makes it easy to see which file will be executed.

The database is the source of truth for the schema

On the first query, a DAO runs DESCRIBE to read column, primary-key, and auto_increment metadata, then reuses it for the rest of the request.

A schema already defined in the database does not need to be duplicated in PHP. When the schema changes, there is no separate mapping definition to keep in sync.

Global configuration stays explicit

Configuration is collected in the static _Global class.

There is no DI container or service locator between you and the configuration, so it is easy to see where settings live and which values are in use. Type _Global:: in your IDE to discover the available settings through autocompletion.

Minimal overhead per request

Framework bootstrap consists of defining constants, registering the autoloader, and loading configuration files.

Flexagon does not eagerly create unnecessary objects or services, and DataSourceManager reuses database connections within each request.