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. nmure/crawler-detect-bundle

ActiveSymfony-bundle

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)26279.6k↓32.5%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 1mo ago

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 85% of packages

Maintenance19

Infrequent updates — may be unmaintained

Popularity44

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

3089d 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

3232.6M17](/packages/jaybizzle-laravel-crawler-detect)[winzou/state-machine-bundle

Bundle for the very lightweight yet powerful PHP state machine

34010.4M15](/packages/winzou-state-machine-bundle)[artgris/filemanager-bundle

FileManager is a simple Multilingual File Manager Bundle for Symfony

182420.8k9](/packages/artgris-filemanager-bundle)[florianv/swap-bundle

Integrates the Swap library with Symfony

62416.1k1](/packages/florianv-swap-bundle)[web-auth/webauthn-symfony-bundle

FIDO2/Webauthn Security Bundle For Symfony

63397.4k6](/packages/web-auth-webauthn-symfony-bundle)[eprofos/user-agent-analyzer

A powerful Symfony bundle for user-agent analysis. It provides accurate detection of operating systems (Windows, MacOS, Linux, iOS, Android...), browsers (Chrome, Firefox, Safari...), and device types (Desktop, Mobile, Tablet, TV...). Supports specific version detection and includes advanced handling of special cases like WebViews and compatibility modes. Features comprehensive logging and detailed analysis results.

182.3k](/packages/eprofos-user-agent-analyzer)

PHPackages © 2026

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