Skip to content

Middleware PSR-15 compliant which dispatch request to Symfony 4.x

License

Notifications You must be signed in to change notification settings

woody-labs/middleware-symfony

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Middleware Symfony

This middleware load and dispatch request to Symfony Kernel.

Implementation

Kernel is created for each request.

// @todo: generate request

// Initialize logger.
$logHandler = new ErrorLogHandler();
$memoryUsageProcessor = new MemoryUsageProcessor(true, false);
$logger = new Logger('http', [$logHandler], [$memoryUsageProcessor]);

// Dispatch request into middleware stack.
$dispatcher = new Dispatcher();
$dispatcher->pipe(new CorrelationIdMiddleware());
$dispatcher->pipe(new LogsMiddleware($logger));
$dispatcher->pipe(new ExceptionMiddleware());
$dispatcher->pipe(new SymfonyMiddleware());

// @todo: add other middleware

$response = $dispatcher->handle($request);

About

Middleware PSR-15 compliant which dispatch request to Symfony 4.x

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Languages