Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/nhymxu/php-floc-disable
PHP middleware to disable Google's Federated Learning of Cohorts (FLoC) tracking
https://github.com/nhymxu/php-floc-disable
floc floc-disable http middleware psr-15
Last synced: about 1 month ago
JSON representation
PHP middleware to disable Google's Federated Learning of Cohorts (FLoC) tracking
- Host: GitHub
- URL: https://github.com/nhymxu/php-floc-disable
- Owner: nhymxu
- Created: 2021-05-11T08:58:30.000Z (over 3 years ago)
- Default Branch: main
- Last Pushed: 2021-05-13T08:14:34.000Z (over 3 years ago)
- Last Synced: 2024-05-01T13:10:03.165Z (8 months ago)
- Topics: floc, floc-disable, http, middleware, psr-15
- Language: PHP
- Homepage:
- Size: 9.77 KB
- Stars: 0
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Funding: .github/FUNDING.yml
Awesome Lists containing this project
README
# nhymxu/php-floc-disable
[![packagist](https://img.shields.io/packagist/v/nhymxu/php-floc-disable.svg?style=flat-square)](https://packagist.org/packages/nhymxu/php-floc-disable)
[![phpunit](https://github.com/nhymxu/php-floc-disable/actions/workflows/phpunit.yml/badge.svg?branch=main)](https://github.com/nhymxu/php-floc-disable/actions/workflows/phpunit.yml)PHP middleware to disable Google's Federated Learning of Cohorts (`FLoC`) tracking
## Usage
This package is installable and auto-loadable via Composer as nhymxu/php-floc-disable.
```shell
composer require nhymxu/php-floc-disable
```### Slim 4 integration
Add the `FlocDisableMiddleware` to set the header
Example: `public/index.php`
```php
addRoutingMiddleware();// Set the header to disable FLoC.
$app->add(new FlocDisableMiddleware());$app->addErrorMiddleware(true, true, true);
// Define app routes
$app->get('/', function (Request $request, Response $response) {
$response->getBody()->write('Hello, World!');
return $response;
})->setName('root');// Run app
$app->run();
```## Support
* Issues:
* Here you can [donate](https://dungnt.net/donate.html) for this project.## License
The MIT License (MIT). Please see [License File](LICENSE) for more information.