Build high-throughput APIs in minutes using the Quill Binary Core.
| Requirement | Version |
|---|---|
| PHP | 8.3+ (CLI) |
| PHP Extensions | ffi, pcntl, posix, json, mbstring |
| php.ini | ffi.enable=on |
| Quill Binary Core | libquill.so / libquill.dylib (bundled via Composer) |
composer create-project quillphp/quill my-api
cd my-apiThe quillphp/quill-core Composer dependency ships a pre-built binary for Linux and macOS. No manual build step is required.
# Single worker (development)
php bin/quill serve
# Multiple workers (production)
QUILL_WORKERS=4 php bin/quill serve --port=8080Edit routes.php to define a GET endpoint:
use Quill\App;
use Quill\Http\Request;
$app = new App();
$app->get('/hello', function (Request $request): array {
return ['message' => 'Hello from Quill!'];
});
$app->run();Start the server and test it:
curl http://localhost:8080/hello
# {"message":"Hello from Quill!"}my-api/
├── attributes/ # Custom validation attributes
├── bin/
│ └── quill # CLI entry point
├── domain/ # Business / domain logic
├── dtos/ # Data Transfer Objects
├── handlers/ # Action handlers (ADR pattern)
├── public/
│ └── index.php # Application bootstrap
├── routes.php # Route definitions
├── scripts/
│ └── http-bench.sh # Local benchmark runner
└── src/ # Framework source
├── Http/ # Request, Response, Cors
├── Routing/ # Router, RouteMatch
├── Runtime/ # Server, Runtime (FFI), Json
└── Validation/ # Validator, DTO
- Architecture — How the binary core and PHP interact.
- Routing — Groups, parameters, and ADR handlers.
- DTOs & Validation — Type-safe request bodies.
- Middleware — CORS, auth, and custom pipelines.