mini\Dispatcher\HttpDispatcher::dispatch()
Method
public
Signature
public function dispatch(): void
Returns
void
Documentation
Dispatch the current HTTP request
Complete HTTP request lifecycle:
- Register ServerRequest as Transient service
- Create PSR-7 ServerRequest from PHP request globals
- Set as current request
- Replace $_GET, $_POST, $_COOKIE with proxies (fiber-safe)
- Declare Ready phase (locks down service registration)
- Add request replacement callback for Router
- Build middleware chain and get RequestHandlerInterface (Router)
- Process request through middleware chain → router → handlers
- Catch exceptions and convert to responses
- Emit response to browser