2017 © Pedro Peláez
 

library psr7-stack

PSR-7 HTTP Middleware Stack

image

zobzn/psr7-stack

PSR-7 HTTP Middleware Stack

  • Sunday, July 24, 2016
  • by zema
  • Repository
  • 1 Watchers
  • 1 Stars
  • 71 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 3 Versions
  • 4 % Grown

The README.md

zobzn/psr7-stack

Build Status Software License, (*1)

PSR-7 HTTP Middleware Stack, (*2)

Installation

composer require zobzn/psr7-stack

Basic Usage

use Psr\Http\Message\ResponseInterface;
use Psr\Http\Message\ServerRequestInterface;

require_once __DIR__ . '/vendor/autoload.php';

$stack = new \Zobzn\Stack();
$stack->push(function (ServerRequestInterface $request, ResponseInterface $response, callable $next = null) {
    // do something with request and/or response
    return $next ? $next($request, $response) : $response;
});
$stack->push(function (ServerRequestInterface $request, ResponseInterface $response, callable $next = null) {
    // do something else with request and/or response
    return $next ? $next($request, $response) : $response;
});

$request  = new SomeServerRequestImplementation();
$response = new SomeResponseImplementation();

// execute middlewares on given request and response, and get final response
$response = $stack->__invoke($request, $response);

The Versions

24/07 2016

dev-master

9999999-dev https://github.com/zobzn/psr7-stack

PSR-7 HTTP Middleware Stack

  Sources   Download

MIT

The Requires

 

The Development Requires

by Avatar zema

middleware psr psr-7 stack http

24/07 2016

0.1.1

0.1.1.0 https://github.com/zobzn/psr7-stack

PSR-7 HTTP Middleware Stack

  Sources   Download

MIT

The Requires

 

The Development Requires

by Avatar zema

middleware psr psr-7 stack http

20/02 2016

0.1.0

0.1.0.0 https://github.com/zobzn/psr7-stack

PSR-7 HTTP Middleware Stack

  Sources   Download

MIT

The Requires

 

The Development Requires

by Avatar zema

middleware psr psr-7 stack http