kispiox/middleware

A middleware component for Kispiox

dev-master 2018-05-22 08:14 UTC

This package is not auto-updated.

Last update: 2024-11-10 05:24:51 UTC


README

use Kispiox\Middleware\MiddlewareDispatcher;
use MattFerris\HttpRouting\Dispatcher;
use Zend\Diactoros\ServerRequest;

$final = new Dispatcher();

$dispatcher = new MiddlewareDispatcher($final, [
    $middlewareA,
    $middlewareB,
    ...
]);

$dispatcher->add($middlewareC);

$response = $dispatcher->dispatch(ServerRequest::fromGlobals());