chubbyphp / chubbyphp-slim-psr15
A slim psr15 adapter for middleware and request handler.
Installs: 1 226
Dependents: 0
Suggesters: 0
Security: 0
Stars: 0
Watchers: 1
Forks: 0
Open Issues: 0
Requires
- php: ^7.0
- psr/container: ^1.0
- psr/http-message: ^1.0.1
- psr/http-server-middleware: ^1.0.1
Requires (Dev)
- chubbyphp/chubbyphp-mock: ^1.4
- phploc/phploc: ^4.0|^5.0
- phpunit/phpunit: ^6.5|^7.0|^8.0
This package is auto-updated.
Last update: 2020-09-22 18:43:19 UTC
README
Description
DEPRECATED: Use Slim 4 instead, it got PSR15 support out of the box.
A slim psr15 adapter for middleware and request handler.
Requirements
- php: ^7.0
- psr/container: ^1.0
- psr/http-message: ^1.0.1
- psr/http-server-middleware: ^1.0.1
Installation
Through Composer as chubbyphp/chubbyphp-slim-psr15.
composer require chubbyphp/chubbyphp-slim-psr15 "^1.1"
Usage
Middleware adapter
<?php declare(strict_types=1); namespace App; use App\Middleware\Psr15Middleware; use Chubbyphp\SlimPsr15\MiddlewareAdapter; use Slim\App; $app = new App(); $app->add(new MiddlewareAdapter(new Psr15Middleware()));
Lazy Middleware adapter
<?php declare(strict_types=1); namespace App; use App\Middleware\Psr15Middleware; use Chubbyphp\SlimPsr15\LazyMiddlewareAdapter; use Psr\Container\ContainerInterface; use Slim\App; /** @var ContainerInterface $container */ $container = ...; $app = new App(); $app->add(new LazyMiddlewareAdapter($container, Psr15Middleware::class));
RequestHandler adapter
<?php declare(strict_types=1); namespace App; use App\RequestHandler\Psr15RequestHandler; use Chubbyphp\SlimPsr15\RequestHandlerAdapter; use Slim\App; $app = new App(); $app->get('/', new RequestHandlerAdapter(new Psr15RequestHandler()));
Lazy RequestHandler adapter
<?php declare(strict_types=1); namespace App; use App\RequestHandler\Psr15RequestHandler; use Chubbyphp\SlimPsr15\LazyRequestHandlerAdapter; use Psr\Container\ContainerInterface; use Slim\App; /** @var ContainerInterface $container */ $container = ...; $app = new App(); $app->get('/', new LazyRequestHandlerAdapter($container, Psr15RequestHandler::class));
Copyright
Dominik Zogg 2019