symfony-cmf/symfony-cmf — Issue #127: app/console router:debug throws exception
Author: dbu
Created: 2011-12-27 21:08:00+00:00
State: open
Labels: BUG

i got lost in this and had to give up:

app/console router:debug
[Symfony\Component\DependencyInjection\Exception\InactiveScopeException]
You cannot create a service ("phpcr.menu.factory") of an inactive scope ("request").

indeed, phpcr.menu.factory is of scope request, and menu provider aquires it from the container instead of constructor injection. but to switch to constructor injection, i have to mark the menu provider as scope request - which explodes with the knp menu bundle. as the exception when trying to constructor inject the factory into the provider tells to get the factory from the request, this seems to be ok.

however i totally do not see why to get the routes symfony wants to instantiate the menu render service.

@uwej711 did you figure out how this should work? is this a bug with the DI for the routing loader?

() at cmf-sandbox/app/cache/dev/appDevDebugProjectContainer.php:1469
appDevDebugProjectContainer->getPhpcr_Menu_FactoryService() at cmf-sandbox/app/bootstrap.php.cache:194
Symfony\Component\DependencyInjection\Container->get() at cmf-sandbox/vendor/symfony-cmf/src/Symfony/Cmf/Bundle/MenuBundle/Provider/PHPCRMenuProvider.php:20
Symfony\Cmf\Bundle\MenuBundle\Provider\PHPCRMenuProvider->__construct() at cmf-sandbox/app/cache/dev/appDevDebugProjectContainer.php:1485
appDevDebugProjectContainer->getPhpcr_Menu_ProviderService() at cmf-sandbox/app/bootstrap.php.cache:194
Symfony\Component\DependencyInjection\Container->get() at cmf-sandbox/app/cache/dev/appDevDebugProjectContainer.php:1179
appDevDebugProjectContainer->getKnpMenu_MenuProviderService() at cmf-sandbox/app/bootstrap.php.cache:194
Symfony\Component\DependencyInjection\Container->get() at cmf-sandbox/app/cache/dev/appDevDebugProjectContainer.php:3541
appDevDebugProjectContainer->getTwigService() at cmf-sandbox/app/bootstrap.php.cache:194
Symfony\Component\DependencyInjection\Container->get() at cmf-sandbox/app/cache/dev/appDevDebugProjectContainer.php:63
appDevDebugProjectContainer->getAssetic_AssetManagerService() at cmf-sandbox/app/bootstrap.php.cache:194
Symfony\Component\DependencyInjection\Container->get() at cmf-sandbox/app/cache/dev/appDevDebugProjectContainer.php:1595
appDevDebugProjectContainer->getRouting_LoaderService() at cmf-sandbox/app/bootstrap.php.cache:194
Symfony\Component\DependencyInjection\Container->get() at cmf-sandbox/vendor/symfony/src/Symfony/Bundle/FrameworkBundle/Routing/Router.php:54
Symfony\Bundle\FrameworkBundle\Routing\Router->getRouteCollection() at cmf-sandbox/vendor/bundles/Symfony/Cmf/Bundle/ChainRoutingBundle/Routing/ChainRouter.php:147
Symfony\Cmf\Bundle\ChainRoutingBundle\Routing\ChainRouter->getRouteCollection() at cmf-sandbox/vendor/symfony/src/Symfony/Bundle/FrameworkBundle/Command/RouterDebugCommand.php:71
Symfony\Bundle\FrameworkBundle\Command\RouterDebugCommand->execute() at cmf-sandbox/vendor/symfony/src/Symfony/Component/Console/Command/Command.php:227
Symfony\Component\Console\Command\Command->run() at cmf-sandbox/vendor/symfony/src/Symfony/Component/Console/Application.php:193
Symfony\Component\Console\Application->doRun() at cmf-sandbox/vendor/symfony/src/Symfony/Bundle/FrameworkBundle/Console/Application.php:75
Symfony\Bundle\FrameworkBundle\Console\Application->doRun() at cmf-sandbox/vendor/symfony/src/Symfony/Component/Console/Application.php:106
Symfony\Component\Console\Application->run() at cmf-sandbox/app/console:16