antidot-fw / no-floc-middleware
Antidot Framework PSR-15 NO FLoC Middleware
Fund package maintenance!
kpicaza
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 middleware to opting your Website out of Google's FLoC Network
Installation
Using composer
composer require antidot-fw/no-floc-middleware
Using Laminas config Aggregator
it install the library automatically
Usage
In Antidot, Mezzio or any other PSR-15 middleware application, add it to the global pipeline.
<?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); };