PHPackages                             nmure/crawler-detect-bundle - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Utility &amp; Helpers](/categories/utility)
4. /
5. nmure/crawler-detect-bundle

ActiveSymfony-bundle[Utility &amp; Helpers](/categories/utility)

nmure/crawler-detect-bundle
===========================

A Symfony bundle for the Crawler-Detect library (detects bots/crawlers/spiders via the user agent)

v2.0.0(8y ago)27284.2k↓19.4%11[1 issues](https://github.com/nicolasmure/CrawlerDetectBundle/issues)[1 PRs](https://github.com/nicolasmure/CrawlerDetectBundle/pulls)MITPHPPHP &gt;=7.1

Since Nov 24Pushed 5y ago4 watchersCompare

[ Source](https://github.com/nicolasmure/CrawlerDetectBundle)[ Packagist](https://packagist.org/packages/nmure/crawler-detect-bundle)[ RSS](/packages/nmure-crawler-detect-bundle/feed)WikiDiscussions master Synced yesterday

READMEChangelog (2)Dependencies (4)Versions (4)Used By (0)

CrawlerDetectBundle
===================

[](#crawlerdetectbundle)

[![Build Status](https://camo.githubusercontent.com/6e3834667d6ac971089d43cecb267216e0cb8cffc71ac1735eef86980cef54d7/68747470733a2f2f7472617669732d63692e6f72672f6e69636f6c61736d7572652f437261776c657244657465637442756e646c652e7376673f6272616e63683d6d6173746572)](https://travis-ci.org/nicolasmure/CrawlerDetectBundle)[![Coverage Status](https://camo.githubusercontent.com/5cb38b80f16a668b861df2d4271900db7ba3a68d4c9fffe6850aaa99438797bd/68747470733a2f2f636f766572616c6c732e696f2f7265706f732f6769746875622f6e69636f6c61736d7572652f437261776c657244657465637442756e646c652f62616467652e7376673f6272616e63683d6d6173746572)](https://coveralls.io/github/nicolasmure/CrawlerDetectBundle?branch=master)

A Symfony bundle for the [Crawler-Detect](https://github.com/JayBizzle/Crawler-Detect "JayBizzle/Crawler-Detect")library (detects bots/crawlers/spiders via the user agent).

Table of contents
-----------------

[](#table-of-contents)

- [Introduction](#introduction)
- [Installation](#installation)
- [Usage](#usage)
- [Testing](#testing)

Introduction
------------

[](#introduction)

This Bundle integrates the [Crawler-Detect](https://github.com/JayBizzle/Crawler-Detect "JayBizzle/Crawler-Detect")library into Symfony. It is **recommended** to read the lib's documentation before continuing here.

The aim of this bundle is to expose the [`CrawlerDetect`](https://github.com/JayBizzle/Crawler-Detect/blob/master/src/CrawlerDetect.php "Jaybizzle\CrawlerDetect\CrawlerDetect")class as a service (`crawler_detect`) to make it easier to use with Symfony (dependency injection, usable from a controller, etc...).

Installation
------------

[](#installation)

Download the bundle using composer :

```
$ composer require nmure/crawler-detect-bundle "^2.0.0"
```

For Symfony &lt; 4.0, run :

```
$ composer require nmure/crawler-detect-bundle "^1.0.0"
```

then enable the bundle in your AppKernel :

```
// app/AppKernel.php
class AppKernel extends Kernel
{
    public function registerBundles()
    {
        $bundles = array(
            // ...
            new Nmure\CrawlerDetectBundle\CrawlerDetectBundle(),
            // ...
        );
    }
}
```

Usage
-----

[](#usage)

The `crawler_detect` service is initialized with the data from the Symfony's master request.

To use this service from a controller :

```
public function indexAction()
{
    if ($this->get('crawler_detect')->isCrawler()) {
        // this request is from a crawler :)
    }

    // you can also specify an user agent if you don't want
    // to use the one of the master request or if the app
    // is accessed by the CLI :
    $ua = 'Mozilla/5.0 (compatible; Googlebot/2.1; +http://www.google.com/bot.html)';
    if ($this->get('crawler_detect')->isCrawler($ua)) {
        // this user agent belongs to a crawler :)
    }
}
```

You can also inject this service as a dependency using the `crawler_detect` service id.

Testing
-------

[](#testing)

```
$ docker run --rm -v `pwd`:/app phpunit/phpunit -c /app
```

###  Health Score

38

—

LowBetter than 83% of packages

Maintenance19

Infrequent updates — may be unmaintained

Popularity45

Moderate usage in the ecosystem

Community13

Small or concentrated contributor base

Maturity60

Established project with proven stability

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~186 days

Total

3

Last Release

3134d ago

Major Versions

v1.0.1 → v2.0.02017-12-02

PHP version history (2 changes)v1.0.0PHP &gt;=5.3.0

v2.0.0PHP &gt;=7.1

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/4362252?v=4)[Nicolas MURE](/maintainers/nicolasmure)[@nicolasmure](https://github.com/nicolasmure)

---

Top Contributors

[![nicolasmure](https://avatars.githubusercontent.com/u/4362252?v=4)](https://github.com/nicolasmure "nicolasmure (3 commits)")

---

Tags

botbundlecrawlerphpsymfonysymfonybundlecrawleruser agentbotdetect

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/nmure-crawler-detect-bundle/health.svg)

```
[![Health](https://phpackages.com/badges/nmure-crawler-detect-bundle/health.svg)](https://phpackages.com/packages/nmure-crawler-detect-bundle)
```

###  Alternatives

[jaybizzle/laravel-crawler-detect

A Laravel package to detect web crawlers via the user agent

3302.7M18](/packages/jaybizzle-laravel-crawler-detect)[winzou/state-machine-bundle

Bundle for the very lightweight yet powerful PHP state machine

33910.7M19](/packages/winzou-state-machine-bundle)[rcsofttech/audit-trail-bundle

Enterprise-grade, high-performance Symfony audit trail bundle. Automatically track Doctrine entity changes with split-phase architecture, multiple transports (HTTP, Queue, Doctrine), and sensitive data masking.

1189.8k](/packages/rcsofttech-audit-trail-bundle)[web-auth/webauthn-symfony-bundle

FIDO2/Webauthn Security Bundle For Symfony

66529.9k11](/packages/web-auth-webauthn-symfony-bundle)[2lenet/crudit-bundle

The easy like Crud'it Bundle.

1616.4k14](/packages/2lenet-crudit-bundle)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
