kittenphp / pipeline
Pipeline simple implementation,Convert Symfony http request to response
Installs: 45
Dependents: 1
Suggesters: 0
Security: 0
Stars: 0
Watchers: 0
Forks: 0
Open Issues: 0
pkg:composer/kittenphp/pipeline
Requires
- php: ^7.0
- symfony/http-foundation: ^3.4
This package is not auto-updated.
Last update: 2025-09-28 11:03:32 UTC
README
introduce
The "kittenphp/pipeline" is a Lightweight library,It can convert Symfony's http request to response.
Usually handle middleware in the MVC framework.
-
install:
composer require kittenphp/pipeline -
example:
<?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();