2017 © Pedro Peláez
 

library http-middleware-psr15-adapter

PSR15 adapter for react/http middleware

image

for/http-middleware-psr15-adapter

PSR15 adapter for react/http middleware

  • Wednesday, January 24, 2018
  • by WyriHaximus
  • Repository
  • 4 Watchers
  • 9 Stars
  • 1,373 Installations
  • PHP
  • 1 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 9 Versions
  • 17 % Grown

The README.md

A PSR-15 middleware adapter for react/http

CI status, (*1)

Wraps PSR-15 middleware using async and await from react/async utilizing fibers making them usable within react/http as middleware., (*2)

Install

To install via Composer, use the command below, it will automatically detect the latest version and bind it with ^., (*3)

composer require for/http-middleware-psr15-adapter

Usage

The following usage example uses middlewares/redirect adding one redirect, and using the callback to call several methods on the redirect middleware to change it's behavior:, (*4)

$server = new Server(
    /** Other middleware */
    new PSR15Middleware(
        (new Redirect(['/old-url' => '/new-url']))->permanent(false)->query(false)->method(['GET', 'POST'])
    ),
    /** Other middleware */
);

Grouped Usage

When using more then one PSR-15 in a row the GroupedPSR15Middleware is more performing than using multiple PSR15Middleware. Consider the following example where we add middlewares/cache for expires headers:, (*5)

$loop = Factory::create(); 
$server = new Server([
    /** Other middleware */
    (new GroupedPSR15Middleware($loop))->withMiddleware( 
        (new Redirect(['/old-url' => '/new-url']))->permanent(false)->query(false)->method(['GET', 'POST'])
    )->withMiddleware(
        new Expires()
    ),
    /** Other middleware */
]);

The Versions

24/01 2018

dev-master

9999999-dev

PSR15 adapter for react/http middleware

  Sources   Download

MIT

The Requires

 

The Development Requires

middleware https http reactphp psr15

24/01 2018

v1.0.0

1.0.0.0

PSR15 adapter for react/http middleware

  Sources   Download

MIT

The Requires

 

The Development Requires

middleware https http reactphp psr15

07/01 2018

v0.3.1

0.3.1.0

PSR15 adapter for react/http middleware

  Sources   Download

MIT

The Requires

 

The Development Requires

middleware https http reactphp psr15

22/12 2017

0.3.x-dev

0.3.9999999.9999999-dev

PSR15 adapter for react/http middleware

  Sources   Download

MIT

The Requires

 

The Development Requires

middleware https http reactphp psr15

22/12 2017

v0.3.0

0.3.0.0

PSR15 adapter for react/http middleware

  Sources   Download

MIT

The Requires

 

The Development Requires

middleware https http reactphp psr15

22/12 2017

0.1.x-dev

0.1.9999999.9999999-dev

PSR15 adapter for react/http middleware

  Sources   Download

MIT

The Requires

 

The Development Requires

middleware https http reactphp psr15

22/12 2017

v0.1.0

0.1.0.0

PSR15 adapter for react/http middleware

  Sources   Download

MIT

The Requires

 

The Development Requires

middleware https http reactphp psr15

22/12 2017

0.2.x-dev

0.2.9999999.9999999-dev

PSR15 adapter for react/http middleware

  Sources   Download

MIT

The Requires

 

The Development Requires

middleware https http reactphp psr15

22/12 2017

v0.2.0

0.2.0.0

PSR15 adapter for react/http middleware

  Sources   Download

MIT

The Requires

 

The Development Requires

middleware https http reactphp psr15