Yaf is a PHP MVC framework shipped as a compiled C extension. Router, dispatcher, and core classes run in native code to cut per-request bootstrap overhead.
Overview
Yaf (Yet Another Framework) is a PHP framework for building web applications using classical MVC. Unlike typical PHP frameworks loaded from many source files, Yaf is written in C and installed as a PHP extension so routing and dispatch run in compiled code.
The design targets high-traffic sites where framework bootstrap cost matters, and long-lived PHP runtimes such as Swoole where each request needs a clean dispatch cycle without static state leaking between requests. Instantiating the application avoids loading framework PHP files through Composer.
Applications use a single public entry script, an INI or array-based configuration with environment sections, bootstrap hooks, six built-in route types, a PSR-0 style autoloader, plugins with seven dispatch hooks, and a simple PHP-template view engine. Multi-module layouts are supported.
Installation is documented via PECL, PIE, or compiling from source. PHP manual documentation describes controllers, dispatchers, configuration parsers, sessions, and registry utilities for typical MVC workflows.
Key features
- C extension MVC core
- Six built-in route types
- INI and array configuration
- Bootstrap init hook methods
- Seven-hook plugin system
- YafViewSimple PHP templates
- PSR-0 style YafLoader
- Multi-module application layout
Use cases
- High-traffic PHP web applications
- Framework atop Swoole or RoadRunner
- Low-overhead MVC API backends
- Single entry point PHP sites
- Classical MVC with INI config