2017 © Pedro Peláez
 

library stratigility-harmony

Cross-framework module for Stratigility

image

thecodingmachine/stratigility-harmony

Cross-framework module for Stratigility

  • Monday, September 25, 2017
  • by mouf
  • Repository
  • 8 Watchers
  • 0 Stars
  • 10,003 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 2 Forks
  • 0 Open issues
  • 5 Versions
  • 35 % Grown

The README.md

Stratigility universal module

This package integrates Stratigility in any container-interop compatible framework/container., (*1)

Installation

composer require thecodingmachine/stratigility-harmony

If your container supports autodiscovery by thecodingmachine/discovery, there is nothing more to do. Otherwise, you need to register the TheCodingMachine\StratigilityServiceProvider and the TheCodingMachine\MiddlewareListServiceProvider into your container., (*2)

Refer to your framework or container's documentation to learn how to register service providers., (*3)

Usage

This module registers 2 services in your container:, (*4)

  • A Zend Diactoros Server under the Zend\Diactoros\Server key. Use the listen method to answer calls:, (*5)

    $server = $container->get(Server::class);
    $server->listen();
    
  • A MiddlewarePipe instance under the Zend\Stratigility\MiddlewarePipe key. Use this middleware pipe to add your own middlewares:, (*6)

    $middlewarePipe = $container->get(MiddlewarePipe::class);
    $middlewarePipe->pipe($myMiddleware);
    

About the middlewares priority queue

Depending on the middleware you are registering, you generally have a fairly good idea of the order your middleware should run compared to other middlewares. The Stratigility service provider will use the middleware list provided by thecodingmachine/middleware-list-universal-module., (*7)

Please have a look at this package to see how to add middlewares automatically., (*8)

The Versions