sensiolabs / SensioLabsDoctrineQueryStatisticsBundle

[DEPRECATED] Adds a Profiler tab to gather statistics about Doctrine queries made during a request
MIT License
58 stars 7 forks source link

sensiolabs.doctrinequerystatistics.data_collector problem #4

Open adrav opened 11 years ago

adrav commented 11 years ago

Hi,

when I add this bundle: "sensiolabs/doctrine-query-statistics-bundle": "dev-master",

to my composher.json, everytime when I use: php app\console --no-debug

I get: [Symfony\Component\DependencyInjection\Exception\ServiceNotFoundException] The service "sensiolabs.doctrinequerystatistics.data_collector" has a dependency on a non-existent service "doctrine.dbal.logger.profiling.default".

Please tell me what I am doing wrong.

Rafał

denderello commented 11 years ago

Sounds like something changed inside Doctrine. Which version of Symfony are you using?

adrav commented 11 years ago

Here is my composer.json file:

    "php": ">=5.3.3",
    "symfony/symfony": "2.1.*",
    "doctrine/orm": "2.3.*",
    "doctrine/doctrine-bundle": "1.0.*",
    "jdorn/sql-formatter": "dev-master",
    "twig/extensions": "1.*",
    "twig/twig": "1.*",
    "symfony/assetic-bundle": "2.1.*",
    "symfony/swiftmailer-bundle": "2.1.*",
    "symfony/monolog-bundle": "2.1.*",
    "sensio/distribution-bundle": "2.1.*",
    "sensio/framework-extra-bundle": "2.1.*",
    "sensio/generator-bundle": "2.1.*",
    "doctrine/doctrine-migrations-bundle": "dev-master",
    "stof/doctrine-extensions-bundle": "1.1.*",
    "symfony/console": "2.1.*",
    "friendsofsymfony/user-bundle": "1.3.*",
    "vich/uploader-bundle": "dev-master",
    "knplabs/gaufrette" : "dev-master",
    "knplabs/knp-gaufrette-bundle" : "dev-master",
    "knplabs/knp-paginator-bundle": "dev-master",
    "knplabs/knp-components": "dev-master",
    "pss/doctrine-extensions-bundle": "2.3",
    "liip/functional-test-bundle": "dev-master",
    "doctrine/doctrine-fixtures-bundle": "dev-master",
    "psliwa/pdf-bundle": "dev-master",
    "sensiolabs/doctrine-query-statistics-bundle": "dev-master",
    "knplabs/knp-menu-bundle": "dev-master",
    "knplabs/knp-menu": "dev-master",
    "icode4food/flot-bundle": "dev-master",
    "genemu/form-bundle": "2.1.*@dev"
denderello commented 11 years ago

Hmm... maybe @stof can help with that?

stof commented 11 years ago

Hmm, if running the command as no-debug, the profiling will indeed be disabled by default in the connection, so the service will not be defined. and as you are running it as dev and no-debug, the query statistics bundle is registered. @denderello you should handle the case of connections for which the profiling is disabled (the bundle will probably fail also if the profiling is always disabled for a connection, breaking the dev environment entirely)

denderello commented 11 years ago

I have to look into this again. I try to make some time for this next week

stedekay commented 11 years ago

Just a little ping for this issue :) But we only experience this problem when this bundle is added into the array for all environments in registerBundles(). The error occurs for example when we call php app/console cache:clear --env=prod. But not when we call it for the dev environment.

So if you move the registration into the if-statement at the end of the registerBundles() it should be fine.

jaymecd commented 10 years ago

any update on this issue? I have totally the same behaviour as @adrav has mentioned.