2017 © Pedro PelĆ”ez
 

library pipeline

Pipeline simple implementation,Convert Symfony http request to response

image

kittenphp/pipeline

Pipeline simple implementation,Convert Symfony http request to response

  • Thursday, January 18, 2018
  • by kittenphp
  • Repository
  • 0 Watchers
  • 0 Stars
  • 26 Installations
  • PHP
  • 1 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 2 Versions
  • 0 % Grown

The README.md

introduce

The "kittenphp/pipeline" is a Lightweight library,It can convert Symfony's http request to response., (*1)

Usually handle middleware in the MVC framework., (*2)

  • install:
    composer require kittenphp/pipeline, (*3)

  • example:, (*4)

<?php
require __DIR__.'/vendor/autoload.php';

use kitten\Component\pipeline\MiddlewareInterface;
use Symfony\Component\HttpFoundation\Request;
use Symfony\Component\HttpFoundation\Response;
use kitten\Component\pipeline\PipelinePack;

class M1 implements MiddlewareInterface{
    public function handle(Request $request, Closure $next)
    {
        // Some processing work...
        return $next($request);
    }
}
class M2 implements MiddlewareInterface{
    public function handle(Request $request, Closure $next)
    {
        return new Response('hello world! (kitten\Component\pipeline)');
    }
}

$pack=new PipelinePack();
$pack->add(new M1());
$pack->add(new M2());
$response=$pack->handle(Request::createFromGlobals());
$response->send();

The Versions

18/01 2018

dev-master

9999999-dev

Pipeline simple implementation,Convert Symfony http request to response

  Sources   Download

MIT

The Requires

 

by Avatar kittenphp

18/01 2018

1.0.0

1.0.0.0

Pipeline simple implementation,Convert Symfony http request to response

  Sources   Download

MIT

The Requires

 

by Avatar kittenphp