mezzio / mezzio
PSR-15 Middleware Microframework
Fund package maintenance!
Community Bridge
Installs: 291 193
Dependents: 56
Suggesters: 1
Security: 0
Stars: 199
Watchers: 36
Forks: 37
Open Issues: 29
Requires
- php: ^7.3||~8.0.0
- fig/http-message-util: ^1.1.5
- laminas/laminas-httphandlerrunner: ^1.3.0
- laminas/laminas-stratigility: ^3.3.0
- laminas/laminas-zendframework-bridge: ^1.1.0
- mezzio/mezzio-router: ^3.2.0
- mezzio/mezzio-template: ^2.1.0
- psr/container: ^1.0
- psr/http-message: ^1.0.1
- psr/http-server-middleware: ^1.0
Requires (Dev)
- filp/whoops: ^2.8.0
- laminas/laminas-coding-standard: ~1.0.0
- laminas/laminas-diactoros: ^2.5.0
- laminas/laminas-servicemanager: ^3.6.0
- malukenho/docheader: ^0.1.8
- mezzio/mezzio-aurarouter: ^3.0
- mezzio/mezzio-fastroute: ^3.1.0
- mezzio/mezzio-laminasrouter: ^3.1.0
- mockery/mockery: ^1.0
- phpstan/extension-installer: ^1.1
- phpstan/phpstan: ^0.12.33
- phpstan/phpstan-phpunit: ^0.12.13
- phpstan/phpstan-strict-rules: ^0.12.4
- phpunit/phpunit: ^9.3
Suggests
- filp/whoops: ^2.1 to use the Whoops error handler
- laminas/laminas-auradi-config: ^2.0 to use Aura.Di dependency injection container
- laminas/laminas-pimple-config: ^1.0 to use Pimple for dependency injection container
- laminas/laminas-servicemanager: ^3.3 to use laminas-servicemanager for dependency injection
- mezzio/mezzio-helpers: ^3.0 for its UrlHelper, ServerUrlHelper, and BodyParseMiddleware
- mezzio/mezzio-tooling: ^1.0 for migration and development tools; require it with the --dev flag
- psr/http-message-implementation: Please install a psr/http-message-implementation to consume Mezzio; e.g., laminas/laminas-diactoros
Conflicts
- container-interop/container-interop: <1.2.0
- laminas/laminas-diactoros: <1.7.1
- laminas/laminas-stdlib: <3.2.1
Replaces
- zendframework/zend-expressive: ^3.2.1
- 3.4.x-dev
- 3.3.x-dev
- 3.3.0
- 3.2.x-dev
- 3.2.2
- 3.2.1
- 3.2.0
- 3.1.0
- 3.0.3
- 3.0.2
- 3.0.1
- 3.0.0
- 3.0.0rc5
- 3.0.0rc4
- 3.0.0rc3
- 3.0.0rc2
- 3.0.0rc1
- 3.0.0alpha9
- 3.0.0alpha8
- 3.0.0alpha7
- 3.0.0alpha6
- 3.0.0alpha5
- 3.0.0alpha4
- 3.0.0alpha3
- 3.0.0alpha2
- 3.0.0alpha1
- 2.2.1
- 2.2.0
- 2.1.1
- 2.1.0
- 2.0.6
- 2.0.5
- 2.0.4
- 2.0.3
- 2.0.2
- 2.0.1
- 2.0.0
- 1.1.1
- 1.1.0
- 1.0.6
- 1.0.5
- 1.0.4
- 1.0.3
- 1.0.2
- 1.0.1
- 1.0.0
- 1.0.0rc7
- 1.0.0rc6
- 1.0.0rc5
- 1.0.0rc4
- 1.0.0rc3
- 1.0.0rc2
- 1.0.0rc1
- 0.5.3
- 0.5.2
- 0.5.1
- 0.5.0
- 0.4.0
- 0.3.1
- 0.3.0
- 0.2.1
- 0.2.0
- 0.1.1
- 0.1.0
This package is auto-updated.
Last update: 2021-02-25 21:13:49 UTC
README
Develop PSR-7 middleware applications in minutes!
mezzio builds on laminas-stratigility to provide a minimalist PSR-7 middleware framework for PHP, with the following features:
- Routing. Choose your own router; we support:
- DI Containers, via PSR-11 Container. Middleware matched via routing is retrieved from the composed container.
- Optionally, templating. We support:
Installation
We provide two ways to install Mezzio, both using Composer: via our skeleton project and installer, or manually.
Using the skeleton + installer
The simplest way to install and get started is using the skeleton project, which includes installer scripts for choosing a router, dependency injection container, and optionally a template renderer and/or error handler. The skeleton also provides configuration for officially supported dependencies.
To use the skeleton, use Composer's create-project
command:
$ composer create-project mezzio/mezzio-skeleton <project dir>
This will prompt you through choosing your dependencies, and then create and
install the project in the <project dir>
(omitting the <project dir>
will
create and install in a mezzio-skeleton/
directory).
Manual Composer installation
You can install Mezzio standalone using Composer:
$ composer require mezzio/mezzio
However, at this point, Mezzio is not usable, as you need to supply minimally:
- a router.
- a dependency injection container.
We currently support and provide the following routing integrations:
- Aura.Router:
composer require mezzio/mezzio-aurarouter
- FastRoute:
composer require mezzio/mezzio-fastroute
- laminas-router:
composer require mezzio/mezzio-laminasrouter
We recommend using a dependency injection container, and typehint against PSR-11 Container. We can recommend the following implementations:
- laminas-servicemanager:
composer require laminas/laminas-servicemanager
- Pimple (see docs for more details):
composer require laminas/laminas-pimple-config
- Aura.Di (see docs for more details):
composer require laminas/laminas-auradi-config
Additionally, you may optionally want to install a template renderer implementation, and/or an error handling integration. These are covered in the documentation.
Documentation
Documentation is in the doc tree, and can be compiled using mkdocs:
$ mkdocs build
Additionally, public-facing, browseable documentation is available at https://docs.mezzio.dev/mezzio/