antidot-fw / no-floc-middleware
Antidot 框架 PSR-15 NO FLoC 中间件
1.0.3
2021-06-05 12:00 UTC
Requires
- php: ^7.4|^8.0
- psr/http-message: ^1.0
- psr/http-server-middleware: ^1.0
Requires (Dev)
- infection/infection: ^0.21.0
- phpro/grumphp: ^1.0
- phpstan/phpstan: ^0.12
- phpunit/phpunit: ^8.0 || ^9.0
- squizlabs/php_codesniffer: ^3.4
- symfony/var-dumper: ^4.2 || ^5.0
- vimeo/psalm: ^4.4
README
PSR-15 中间件,用于将您的网站排除在谷歌的 FLoC 网络之外
安装
使用 composer
composer require antidot-fw/no-floc-middleware
使用 Laminas 配置聚合器
它会自动安装库
用法
在 Antidot、Mezzio 或任何其他 PSR-15 中间件应用程序中,将其添加到全局管道。
<?php declare(strict_types=1); use Antidot\Application\Http\Application; use Antidot\Application\Http\Middleware\ErrorMiddleware; use Antidot\Application\Http\Middleware\RouteDispatcherMiddleware; use Antidot\Application\Http\Middleware\RouteNotFoundMiddleware; use Antidot\Logger\Application\Http\Middleware\ExceptionLoggerMiddleware; use Antidot\Logger\Application\Http\Middleware\RequestLoggerMiddleware; +use Antidot\NoFLoC\NoFLoCMiddleware; return static function (Application $app) : void { + $app->pipe(NoFLoCMiddleware::class) $app->pipe(ErrorMiddleware::class); $app->pipe(ExceptionLoggerMiddleware::class); $app->pipe(RequestLoggerMiddleware::class); $app->pipe(RouteDispatcherMiddleware::class); $app->pipe(RouteNotFoundMiddleware::class); };