setono/bot-detection-bundle 问题修复 & 功能扩展

解决BUG、新增功能、兼容多环境部署,快速响应你的开发需求

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

setono/bot-detection-bundle

最新稳定版本:v1.13.0

Composer 安装命令:

composer require setono/bot-detection-bundle

包简介

A Symfony bundle that allows you to test if a user agent is a bot

README 文档

README

Latest Version Software License Build Status Code Coverage Mutation testing

Detect if the user agent is a bot and act upon it. Under the hood this bundle uses the matomo-org/device-detector, but instead of just using that library this library has a very small subset of user agents that it checks first (i.e. major search engines). This makes it much faster in detecting those very common bots and hence speeds up your request cycle.

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

You can use the bot detector in your services:

<?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! } // ... } }

and you can use it inside your twig templates:

{% if is_bot_request() %} I knew you where a bot! {% endif %}

统计信息

  • 总下载量: 105.78k
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 8
  • 点击次数: 2
  • 依赖项目数: 7
  • 推荐数: 0

GitHub 信息

  • Stars: 8
  • Watchers: 1
  • Forks: 3
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2026-01-04

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固