Lift v1.3.0

Features

Lift is opinionated about what a micro-framework should ship out of the box: a router, a container, an HTTP layer, and everything you need to build a real production service without pulling in a hundred packages.

HTTP

PSR-7 Request / Response
Immutable HTTP objects with fluent builders and JSON helpers.
Static route fast-path
Static routes resolved by O(1) hash lookup before regex matching.
Named routes
Reverse URL generation: $app->url("users.show", ["id" => 42]).
Route groups
Prefix + shared middleware. Nesting supported.
Attribute routing
#[Get("/users/{id}")] on controller methods — loaded via $app->loadControllers().
Auto-response conversion
array → JSON, string → HTML, null → 204, Response → passthrough.
PSR-15 middleware
Global, per-group, per-route. Composable pipeline.
Built-in middleware
CORS, rate-limit, CSRF, debug toolbar, logging.
SSE responses
Server-Sent Events streaming via SseResponse.
HTTP client
Retry-aware HTTP client wrapping curl.

DI & Container

PSR-11 container
Standard contract; works with any PSR-11 consumer.
Full autowiring
Constructor & method param injection by type hint.
Reflection cache
Reflection lookups cached for hot-path performance.
Singletons / bindings
$app->bind / singleton / instance — all three.
Callable resolution
$container->call($fn) injects dependencies into closures.

Security & Crypto

JWT (HS256/RS256)
Encode, decode, verify, expiry & claim helpers.
AES-256-GCM encryption
Authenticated encryption out of the box.
HMAC-SHA256 signer
Sign + verify with constant-time compare.
Password hashing
Wrapper around password_hash with sane defaults.
CSRF middleware
Double-submit cookie pattern, drop-in.
CORS middleware
Preflight handled even without a matching route.
Rate limiting
Token bucket with Redis or in-memory store.

Data & I/O

Query builder
Fluent SELECT / INSERT / UPDATE / DELETE on top of PDO.
Migrations
Versioned schema migrations via CLI.
Active Record model
Optional model layer for simple persistence.
Redis client
ext-redis wrapper behind RedisClientInterface — swap in Predis or any client. Powers cache & queue drivers.
File-system abstraction
Tiny FS API with local driver.
Validation
Fluent rules with auto-422 on ValidationException.

Runtimes

RoadRunner worker
Persistent PSR-7 worker — PHP stays alive between requests. Auto-detects Nyholm / Guzzle / Laminas PSR-17 factory. Requires spiral/roadrunner-http.
Swoole / OpenSwoole
Native Swoole coroutine HTTP server. Converts Swoole requests → Lift Request/Response. Configurable host, port, worker_num. Zero app-code changes.
FrankenPHP
Worker-mode adapter via frankenphp_handle_request(). A small worker.php wraps your $app; one runtime check lets the same file fall back to php-fpm.
Request::fromPsr7()
Convert any third-party PSR-7 ServerRequestInterface into a Lift Request, including all attributes. Useful for custom runtime bridges.

DX & Tooling

CLI (bin/lift)
Generate, migrate, serve, run queue workers.
Debug toolbar
In-page request/SQL/timing inspector for dev.
PSR-3 logger
Stdout, file, rotating drivers.
Event dispatcher
PSR-14 events for app lifecycle hooks.
Views
Plain PHP templates + layouts + sections — no compile step.
Localization
Translator with pluralization rules.
JSON-RPC 2.0
Server bound to any route — full spec compliance.
Test helpers
Request/Response built without globals; ideal for PHPUnit.