chubbyphp/chubbyphp-lazy-middleware

This package is abandoned and no longer maintained. No replacement package was suggested.

Chubbyphp Lazy Middleware

1.1.0 2018-05-18 05:43 UTC

This package is auto-updated.

Last update: 2020-09-22 18:44:18 UTC


README

Build Status Scrutinizer Code Quality Code Coverage Total Downloads Monthly Downloads Latest Stable Version Latest Unstable Version

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