PHPackages                             phpexpertsinc/doctrine-detective - 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. [Debugging &amp; Profiling](/categories/debugging)
4. /
5. phpexpertsinc/doctrine-detective

ActiveLibrary[Debugging &amp; Profiling](/categories/debugging)

phpexpertsinc/doctrine-detective
================================

A Symfony2 Bundle that provides a detailed SQL query log for both HTML and JSON responses, including the SQL query, its location, and duration, organized by Controller -&gt; Service -&gt; Repository.

v1.0.0(11y ago)923.4k3MITPHPPHP &gt;=5.4

Since Feb 1Pushed 11y ago3 watchersCompare

[ Source](https://github.com/phpexpertsinc/DoctrineDetective)[ Packagist](https://packagist.org/packages/phpexpertsinc/doctrine-detective)[ RSS](/packages/phpexpertsinc-doctrine-detective/feed)WikiDiscussions master Synced 1mo ago

READMEChangelogDependencies (4)Versions (2)Used By (0)

Doctrine Detective Bundle
=========================

[](#doctrine-detective-bundle)

**Doctrine Detective** is a Symfony2 Bundle that provides a detailed SQL query log for both HTML and JSON responses, including the SQL query, its location, and duration, organized by Controller -&gt; Service -&gt; Repository.

It is mainly useful for debugging, profiling and refactoring your Doctrine ORM queries into far more efficient Doctrine DBAL queries.

Unlike other SQL loggers, *Doctrine Detective* has the following features:

1. Queries are organized hierarchically by class and method.
2. Prepared statements have the parameters interpolated, so you can directly query them against the database.
3. RESTful API support.

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

[](#installation)

1. Add `"phpexpertsinc/doctrine-detective" : "1.*"` to your *composer.json*.
2. Run `$ composer update phpexpertsinc/doctrine-detective`.
3. Edit `app/appKernel.php`.
4. Add `new PHPExperts\DoctrineDetectiveBundle\DoctrineDetectiveBundle(),` to the `AppKernel::registerBundles()` array. -or- (**prefered**), add it to just the `dev` and `test` environments:

```
    if (in_array($this->getEnvironment(), array('dev', 'test'))) {
        $bundles[] = new PHPExperts\DoctrineDetectiveBundle\DoctrineDetectiveBundle();
    }

```

Output
------

[](#output)

### HTML Response

[](#html-response)

At the end of every HTML response, you will find the following:

```

            TestController::getActiveUsersAction
            3.886604999847429 ms
            -

            UserService
            3.37965652160646 ms
            -

            UserService::getUsers(), Line 210
            2.622127532959 ms
            SELECT * FROM users WHERE ids IN (1, 2, 3, 4, 5)

            UserRepository
            0.75697898864746 ms
            -

            UserRepository::isActive(), Line 115
            0.75697898864746
            SELECT last_visit FROM login_log WHERE userId IN (1, 2, 3, 4, 5)

```

### JSON Response

[](#json-response)

At the end of your JSON response, you will find the `sqlLog` array:

```
"sqlLog": {
    "TestController::getActiveUsersAction": {
        "time": 3.886604999847429,
        "UserService": {
            "time": 3.37965652160646,
            "getUsers": {
                "time": 2.622127532959,
                "queries": [
                    {
                        "query": "SELECT * FROM users WHERE ids IN (1, 2, 3, 4, 5)",
                        "line": 210,
                        "time": 2.622127532959
                    }
                ]
            },
        },
        "UserRepository": {
            "isActive": {
                "time": 0.75697898864746,
                "queries": [
                    {
                        "query": "SELECT last_visit FROM login_log WHERE userId IN (1, 2, 3, 4, 5)",
                        "line": 115,
                        "time": 0.75697898864746
                    }
                ]
            },
        }
    }
}

```

###  Health Score

32

—

LowBetter than 72% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity28

Limited adoption so far

Community10

Small or concentrated contributor base

Maturity58

Maturing project, gaining track record

 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

Unknown

Total

1

Last Release

4118d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/3f3a2dd16766f6b03c330e65aaca9dfb97f1bbbb41c5e2af5681f58f670b7917?d=identicon)[hopeseekr](/maintainers/hopeseekr)

---

Top Contributors

[![hopeseekr](https://avatars.githubusercontent.com/u/1125541?v=4)](https://github.com/hopeseekr "hopeseekr (8 commits)")

### Embed Badge

![Health badge](/badges/phpexpertsinc-doctrine-detective/health.svg)

```
[![Health](https://phpackages.com/badges/phpexpertsinc-doctrine-detective/health.svg)](https://phpackages.com/packages/phpexpertsinc-doctrine-detective)
```

###  Alternatives

[sylius/sylius

E-Commerce platform for PHP, based on Symfony framework.

8.4k5.6M651](/packages/sylius-sylius)[easycorp/easyadmin-bundle

Admin generator for Symfony applications

4.3k16.7M310](/packages/easycorp-easyadmin-bundle)[sulu/sulu

Core framework that implements the functionality of the Sulu content management system

1.3k1.3M152](/packages/sulu-sulu)[prestashop/prestashop

PrestaShop is an Open Source e-commerce platform, committed to providing the best shopping cart experience for both merchants and customers.

9.0k15.4k](/packages/prestashop-prestashop)[contao/core-bundle

Contao Open Source CMS

1231.6M2.4k](/packages/contao-core-bundle)[ec-cube/ec-cube

EC-CUBE EC open platform.

78527.0k1](/packages/ec-cube-ec-cube)

PHPackages © 2026

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