ziraphp / framework
ZiraPHP: a minimal, PSR-first PHP framework core.
v0.1.0
2026-12-03 17:16 UTC
Requires
- php: >=8.2
- nyholm/psr7: ^1.8
- nyholm/psr7-server: ^1.1
- psr/container: ^2.0
- psr/event-dispatcher: ^1.0
- psr/http-factory: ^1.0
- psr/http-message: ^2.0
- psr/http-server-handler: ^1.0
- psr/http-server-middleware: ^1.0
Requires (Dev)
- friendsofphp/php-cs-fixer: ^3.64
- phpstan/phpstan: ^2.0
- phpstan/phpstan-phpunit: ^2.0
- phpunit/phpunit: ^11.5
- squizlabs/php_codesniffer: ^3.10
- vimeo/psalm: ^6.0
Suggests
None
Provides
Conflicts
None
Replaces
None
This package is auto-updated.
Last update: 2026-12-03 17:30:55 UTC
README
A small, PSR-first PHP framework core. ZiraPHP gives you a service container, router, middleware pipeline, event dispatcher and application bootstrap, all built on PHP-FIG standards, so any PSR-compatible library plugs straight in.
Status: 0.x. Anything can change between minor versions until 1.0. See docs/roadmap.md.
Requirements
- PHP 8.2 or newer (8.3+ is the long-term target)
- Composer 2
Install
composer require ziraphp/framework
Hello world
<?php declare(strict_types=1); use ZiraPHP\Core\Application; require __DIR__ . '/../vendor/autoload.php'; $app = new Application(dirname(__DIR__)); $router = $app->getRouter(); $router->get('/', fn (): string => '<h1>Hello from ZiraPHP</h1>'); $router->get('/hello/{name}', fn (string $name): array => ['message' => "Hello, {$name}!"]); $app->run();
Strings become HTML responses, arrays become JSON, and null becomes 204 No Content. Handlers can also return any PSR-7 response.
Try the bundled example:
composer install php -S localhost:8080 -t examples/hello-world/public
What is inside
| Area | Standard | Class |
|---|---|---|
| Service container (autowiring, attributes) | PSR-11 | ZiraPHP\Core\Container\Container |
| HTTP messages | PSR-7 / PSR-17 | nyholm/psr7 |
| Middleware pipeline | PSR-15 | ZiraPHP\Core\Http\MiddlewarePipeline |
| Router | — | ZiraPHP\Core\Routing\Router |
| Events | PSR-14 | ZiraPHP\Core\Events\EventDispatcher |
| Application bootstrap | PSR-15 handler | ZiraPHP\Core\Application |
| Generic data store contract | — | ZiraPHP\Interfaces\Persistence\DataStoreInterface |
Documentation
Quality gates
composer check # code style, PHPStan level 9, Psalm level 1, PHPUnit
License
MIT. See LICENSE.