ctw / ctw-middleware-pagecache
此PSR-15中间件为Mezzio应用程序提供完整的页面缓存。
4.0.0
2024-06-18 06:02 UTC
Requires
- php: ^8.3
- ctw/ctw-middleware: ^4.0
- laminas/laminas-cache: ^3.1
- laminas/laminas-cache-storage-adapter-filesystem: ^2.0
- laminas/laminas-diactoros: ^2.11
- mezzio/mezzio-fastroute: ^3.1
- mezzio/mezzio-session: ^1.4
- psr/container: ^1.0 || ^2.0
Requires (Dev)
- ctw/ctw-qa: ^4.0
- phpstan/extension-installer: ^1.1
- phpstan/phpstan: ^1.7
- phpstan/phpstan-phpunit: ^1.1
- phpstan/phpstan-strict-rules: ^1.3
- phpunit/phpunit: ^10.0
- squizlabs/php_codesniffer: ^3.6
- symfony/var-dumper: ^7.0
This package is auto-updated.
Last update: 2024-09-18 06:43:32 UTC
README
⚠️ 该组件处于高度开发中。请勿(目前)在生产环境中使用。
$ composer require ctw/ctw-middleware-pagecache
简介
middlewares/utils 提供了用于处理PSR-15的实用类。
安装
使用Composer安装中间件
$ composer require ctw/ctw-middleware-pagecache
独立示例
// standalone example
在 Mezzio 中的示例
中间件已在Mezzio中进行了广泛的测试。
使用Composer安装后,只需对应用程序的配置进行以下更改。
在 config/config.php
$providers = [ // [..] \Ctw\Middleware\PageCacheMiddleware\ConfigProvider::class, // [..] ];
在 config/pipeline.php
use Ctw\Middleware\PageCacheMiddleware\PageCacheMiddleware; use Mezzio\Application; use Mezzio\MiddlewareFactory; use Psr\Container\ContainerInterface; return function (Application $app, MiddlewareFactory $factory, ContainerInterface $container): void { // [..] $app->pipe(PageCacheMiddleware::class); // [..] };