setono / bot-detection-bundle
A Symfony bundle that allows you to test if a user agent is a bot
Installs: 5 068
Dependents: 2
Suggesters: 0
Security: 0
Stars: 0
Watchers: 1
Forks: 0
Open Issues: 4
Type:symfony-bundle
Requires
- php: >=7.4
- symfony/config: ^4.4 || ^5.0
- symfony/dependency-injection: ^4.4 || ^5.0
- symfony/http-foundation: ^4.4 || ^5.0.7
- symfony/http-kernel: ^4.4 || ^5.1.5
Requires (Dev)
- infection/infection: ^0.26.1
- matomo/device-detector: ^5.0
- matthiasnoback/symfony-dependency-injection-test: ^4.3
- nette/php-generator: ^3.6
- phpbench/phpbench: ^1.2
- phpunit/phpunit: ^9.5
- psalm/plugin-phpunit: ^0.16.1
- psalm/plugin-symfony: ^3.0
- roave/security-advisories: dev-latest
- setono/code-quality-pack: ^2.1.3
- symfony/console: ^4.4 || ^5.3
- symfony/yaml: ^4.4 || ^5.3
- webmozart/assert: ^1.10
This package is auto-updated.
Last update: 2022-05-09 08:04:23 UTC
README
Installation
composer require setono/bot-detection-bundle
This installs and enables the plugin automatically if you're using Symfony Flex. If not, add the bundle manually
to bundles.php
.
Usage
<?php use Setono\BotDetectionBundle\BotDetector\BotDetectorInterface; final class YourService { private BotDetectorInterface $botDetector; public function __construct(BotDetectorInterface $botDetector) { $this->botDetector = $botDetector; } public function yourAction(): void { if ($this->botDetector->isBotRequest()) { // do something to this bot! } // ... } }