chubbyphp / chubbyphp-lazy-middleware
Chubbyphp Lazy Middleware
Installs: 8 320
Dependents: 1
Suggesters: 0
Security: 0
Stars: 0
Watchers: 1
Forks: 0
Open Issues: 0
Requires
- php: ~7.0
- psr/container: ^1.0
- psr/http-message: ~1.0
Requires (Dev)
- container-interop/container-interop: ~1.2
- phpunit/phpunit: ^6.5.8
README
Description
DEPRECATED: Middlewares in Slim3 are already lazy...
IMPORTANT: If you're interested in a lazy adapter for psr-15 middleware, i suggest to use chubbyphp/chubbyphp-slim-psr15. Same applies if your searching for a psr-15 request handler.
Allow to lazyload middlewares.
Requirements
- php: ~7.0
- psr/container: ~1.0
- psr/http-message: ~1.0
Installation
Through Composer as chubbyphp/chubbyphp-lazy-middleware.
composer require chubbyphp/chubbyphp-lazy-middleware "~1.1"
Usage
<?php use Chubbyphp\Lazy\LazyMiddleware; use Psr\Http\Message\ServerRequestInterface as Request; use Psr\Http\Message\ResponseInterface as Response; $container['service'] = function (Request $request, Response $response) { // run some lazy logic }; $middleware = new LazyMiddleware($container, 'service'); $response = $middleware($request, $response);
Copyright
Dominik Zogg 2016