Developer documentation for the lightweight, PHP-FPM-oriented Bhitti framework.
Bhitti keeps the hot path direct and avoids starting stateful services before they are needed.
public/index.php loads the application and captures the request:
$app = require dirname(__DIR__) . '/bootstrap/app.php';
$app->run(Request::capture());
The application loads configuration, services, the container, router, middleware kernel, and route dispatcher. In production, cached configuration and cached routes are used when available.
The kernel executes middleware.kernel.web or middleware.kernel.api before route matching.
These middleware must remain stateless because the session is not configured at this stage. Header/CORS-style middleware belongs here.
FastRoute resolves the request.
NOT_FOUND returns 404.METHOD_NOT_ALLOWED returns 405 and an Allow header.FOUND continues to route execution.404/405 requests do not start route middleware or a web session.
For a matched web route, the configured session driver is registered. If sessions are disabled, Bhitti uses the null session driver. API routes do not configure PHP sessions.
Bhitti then executes the matched-route middleware in this order:
config/middleware.php,#[Middleware] attributes,#[Middleware] attributes.Controller attributes are collected during route registration and stored with the prepared route handler, so they are also part of the route cache. Only after middleware succeeds is the controller resolved from the container.
Route scalar parameters are validated against built-in parameter types captured by the router (int, float, bool, and similar built-ins). Invalid typed route input receives a 400 response.
Response object is sent.return "string";