2017 © Pedro Peláez
 

library psr7-middlewares-payload-universal-module

This package contains the service provider of the payload middleware of oscarotero/psr7-middlewares

image

phps-cans/psr7-middlewares-payload-universal-module

This package contains the service provider of the payload middleware of oscarotero/psr7-middlewares

  • Tuesday, January 16, 2018
  • by Ngob
  • Repository
  • 1 Watchers
  • 1 Stars
  • 20,110 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 3 Forks
  • 0 Open issues
  • 5 Versions
  • 34 % Grown

The README.md

Payload universal module

This package integrates Payload's middleware in any container-interop compatible framework/container., (*1)

For this, it provides a service provider for the Payload Middleware of oscarotero/psr7-middlewares., (*2)

It create an instance of Psr7Middlewares\Middleware\Payload under the name Psr7Middlewares\Middleware\Payload, (*3)

It also update the queue named TheCodingMachine\MiddlewareListServiceProvider::MIDDLEWARES_QUEUE by inserting the middleware instance with a priortity TheCodingMachine\MiddlewareOrder\MiddlewareOrder::UTILITY_EARLY, (*4)

Installation

composer require phps-cans/psr7-middlewares-payload-universal-module

Usage

To be able to use this package, you must use Stratigility universal module. For this, you must register the service provider provided. If you use simplex:, (*5)

$container->register(new \TheCodingMachine\MiddlewareListServiceProvider());

Once the MiddlewareListServiceProvider registered, you must register the payload's service provider:, (*6)

$container->register(new \Psr7Middlewares\Middleware\PayloadServiceProvider());

Once it is done:, (*7)

  1. If you use stratigility-harmony, there is nothing more to do., (*8)

  2. If not using stratigility-harmony, do not forget to register middlewares inside the pipe. If you use Zend Expressive:, (*9)

    $app = $container->get(\Zend\Expressive\Application::class);
    $middlewaresQueue = $container->get(\TheCodingMachine\MiddlewareListServiceProvider::MIDDLEWARES_QUEUE);
    
    foreach ($middlewaresQueue as $middleware) {
     $app->pipe($middleware);
    }
    

Expected values / services

This service provider expects the following configuration / services to be available:, (*10)

Name Compulsory Description
\TheCodingMachine\MiddlewareListServiceProvider::MIDDLEWARES_QUEUE yes Instance of \ SplPriorityQueue

Provided services

This service provider provides the following services:, (*11)

Service name Description
\Psr7Middlewares\Middleware\Payload::class The middleware instancied

Extended services

This service provider extends those services:, (*12)

Name Compulsory Description
\TheCodingMachine\MiddlewareListServiceProvider::MIDDLEWARES_QUEUE yes Update the queue with the middleware's payload

The Versions

16/01 2018

dev-master

9999999-dev https://github.com/phps-cans/psr7-middlewares-payload-universal-module

This package contains the service provider of the payload middleware of oscarotero/psr7-middlewares

  Sources   Download

MIT

The Requires

 

service psr7 provider service-provider middlewares psr7-middlewares json body

16/01 2018

1.2.0

1.2.0.0 https://github.com/phps-cans/psr7-middlewares-payload-universal-module

This package contains the service provider of the payload middleware of oscarotero/psr7-middlewares

  Sources   Download

MIT

The Requires

 

service psr7 provider service-provider middlewares psr7-middlewares json body

16/01 2017

1.1.1

1.1.1.0 https://github.com/phps-cans/psr7-middlewares-payload-universal-module

This package contains the service provider of the payload middleware of oscarotero/psr7-middlewares

  Sources   Download

MIT

The Requires

 

service psr7 provider service-provider middlewares psr7-middlewares json body

16/01 2017

1.1.0

1.1.0.0 https://github.com/phps-cans/psr7-middlewares-payload-universal-module

This package contains the service provider of the payload middleware of oscarotero/psr7-middlewares

  Sources   Download

MIT

The Requires

 

service psr7 provider service-provider middlewares psr7-middlewares json body

06/01 2017

1.0.0

1.0.0.0 https://github.com/phps-cans/psr7-middlewares-payload-universal-module

This package contains the service provider of the payload middleware of oscarotero/psr7-middlewares

  Sources   Download

MIT

The Requires

 

service psr7 provider service-provider middlewares psr7-middlewares json body