Служба templating.helper.router не найдена в symfony 2.7

i обновить мой проект с 2.6 до 2.7, я получаю эту ошибку в конце работы:

[Symfony\Component\DependencyInjection\Exception\ServiceNotFoundException]                                           
The service "knp_paginator.helper.processor" has a dependency on a non-existent service "templating.helper.router". 

i поиск контейнера службы, но я не смог найти службу в списке услуг (container: debug), я нашел определение сервиса для templating.helper.router в этом файле

/vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/Resources/config/templating_php.xml

почему эта служба не создается контейнером службы?


     /usr/bin/php /var/www/ghanbari/anar/app/console debug:container --tag=templating.helper -v

Deprecated: The Symfony\Component\DependencyInjection\Definition::setFactoryMethod method is deprecated since version 2.6 and will be removed in 3.0. Use Definition::setFactory() instead. in /var/www/ghanbari/anar/vendor/symfony/symfony/src/Symfony/Component/DependencyInjection/Definition.php on line 137

Call Stack:
    0.0004     227656   1. {main}() /var/www/ghanbari/anar/app/console:0
    0.0161    2719288   2. Symfony\Component\Console\Application->run() /var/www/ghanbari/anar/app/console:27
    0.0178    2896416   3. Symfony\Bundle\FrameworkBundle\Console\Application->doRun() /var/www/ghanbari/anar/vendor/symfony/symfony/src/Symfony/Component/Console/Application.php:126
    0.0178    2896640   4. Symfony\Component\HttpKernel\Kernel->boot() /var/www/ghanbari/anar/vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/Console/Application.php:70
    0.0210    3132184   5. Symfony\Component\HttpKernel\Kernel->initializeContainer() /var/www/ghanbari/anar/app/bootstrap.php.cache:2387
    0.0801    6683560   6. Symfony\Component\DependencyInjection\ContainerBuilder->compile() /var/www/ghanbari/anar/app/bootstrap.php.cache:2609
    0.0806    6716880   7. Symfony\Component\DependencyInjection\Compiler\Compiler->compile() /var/www/ghanbari/anar/vendor/symfony/symfony/src/Symfony/Component/DependencyInjection/ContainerBuilder.php:614
    0.0806    6725096   8. Symfony\Component\HttpKernel\DependencyInjection\MergeExtensionConfigurationPass->process() /var/www/ghanbari/anar/vendor/symfony/symfony/src/Symfony/Component/DependencyInjection/Compiler/Compiler.php:117
    0.0808    6730560   9. Symfony\Component\DependencyInjection\Compiler\MergeExtensionConfigurationPass->process() /var/www/ghanbari/anar/vendor/symfony/symfony/src/Symfony/Component/HttpKernel/DependencyInjection/MergeExtensionConfigurationPass.php:39
    0.2364   13801624  10. FOS\UserBundle\DependencyInjection\FOSUserExtension->load() /var/www/ghanbari/anar/vendor/symfony/symfony/src/Symfony/Component/DependencyInjection/Compiler/MergeExtensionConfigurationPass.php:55
    0.2388   14110096  11. Symfony\Component\DependencyInjection\Loader\XmlFileLoader->load() /var/www/ghanbari/anar/vendor/friendsofsymfony/user-bundle/DependencyInjection/FOSUserExtension.php:32
    0.2397   14111016  12. Symfony\Component\DependencyInjection\Loader\XmlFileLoader->parseDefinitions() /var/www/ghanbari/anar/vendor/symfony/symfony/src/Symfony/Component/DependencyInjection/Loader/XmlFileLoader.php:58
    0.2399   14115360  13. Symfony\Component\DependencyInjection\Loader\XmlFileLoader->parseDefinition() /var/www/ghanbari/anar/vendor/symfony/symfony/src/Symfony/Component/DependencyInjection/Loader/XmlFileLoader.php:119
    0.2399   14118016  14. Symfony\Component\DependencyInjection\Definition->setFactoryMethod() /var/www/ghanbari/anar/vendor/symfony/symfony/src/Symfony/Component/DependencyInjection/Loader/XmlFileLoader.php:153
    0.2399   14118352  15. trigger_error() /var/www/ghanbari/anar/vendor/symfony/symfony/src/Symfony/Component/DependencyInjection/Definition.php:137


Deprecated: The Symfony\Component\DependencyInjection\Definition::setFactoryService method is deprecated since version 2.6 and will be removed in 3.0. Use Definition::setFactory() instead. in /var/www/ghanbari/anar/vendor/symfony/symfony/src/Symfony/Component/DependencyInjection/Definition.php on line 208

Call Stack:
    0.0004     227656   1. {main}() /var/www/ghanbari/anar/app/console:0
    0.0161    2719288   2. Symfony\Component\Console\Application->run() /var/www/ghanbari/anar/app/console:27
    0.0178    2896416   3. Symfony\Bundle\FrameworkBundle\Console\Application->doRun() /var/www/ghanbari/anar/vendor/symfony/symfony/src/Symfony/Component/Console/Application.php:126
    0.0178    2896640   4. Symfony\Component\HttpKernel\Kernel->boot() /var/www/ghanbari/anar/vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/Console/Application.php:70
    0.0210    3132184   5. Symfony\Component\HttpKernel\Kernel->initializeContainer() /var/www/ghanbari/anar/app/bootstrap.php.cache:2387
    0.0801    6683560   6. Symfony\Component\DependencyInjection\ContainerBuilder->compile() /var/www/ghanbari/anar/app/bootstrap.php.cache:2609
    0.0806    6716880   7. Symfony\Component\DependencyInjection\Compiler\Compiler->compile() /var/www/ghanbari/anar/vendor/symfony/symfony/src/Symfony/Component/DependencyInjection/ContainerBuilder.php:614
    0.0806    6725096   8. Symfony\Component\HttpKernel\DependencyInjection\MergeExtensionConfigurationPass->process() /var/www/ghanbari/anar/vendor/symfony/symfony/src/Symfony/Component/DependencyInjection/Compiler/Compiler.php:117
    0.0808    6730560   9. Symfony\Component\DependencyInjection\Compiler\MergeExtensionConfigurationPass->process() /var/www/ghanbari/anar/vendor/symfony/symfony/src/Symfony/Component/HttpKernel/DependencyInjection/MergeExtensionConfigurationPass.php:39
    0.2364   13801624  10. FOS\UserBundle\DependencyInjection\FOSUserExtension->load() /var/www/ghanbari/anar/vendor/symfony/symfony/src/Symfony/Component/DependencyInjection/Compiler/MergeExtensionConfigurationPass.php:55
    0.2388   14110096  11. Symfony\Component\DependencyInjection\Loader\XmlFileLoader->load() /var/www/ghanbari/anar/vendor/friendsofsymfony/user-bundle/DependencyInjection/FOSUserExtension.php:32
    0.2397   14111016  12. Symfony\Component\DependencyInjection\Loader\XmlFileLoader->parseDefinitions() /var/www/ghanbari/anar/vendor/symfony/symfony/src/Symfony/Component/DependencyInjection/Loader/XmlFileLoader.php:58
    0.2399   14115360  13. Symfony\Component\DependencyInjection\Loader\XmlFileLoader->parseDefinition() /var/www/ghanbari/anar/vendor/symfony/symfony/src/Symfony/Component/DependencyInjection/Loader/XmlFileLoader.php:119
    0.2404   14118448  14. Symfony\Component\DependencyInjection\Definition->setFactoryService() /var/www/ghanbari/anar/vendor/symfony/symfony/src/Symfony/Component/DependencyInjection/Loader/XmlFileLoader.php:153
    0.2404   14118792  15. trigger_error() /var/www/ghanbari/anar/vendor/symfony/symfony/src/Symfony/Component/DependencyInjection/Definition.php:208

[2015-04-13 20:34:41] php.INFO: The Symfony\Component\DependencyInjection\Definition::setFactoryMethod method is deprecated since version 2.6 and will be removed in 3.0. Use Definition::setFactory() instead. {"type":16384,"file":"/var/www/ghanbari/anar/vendor/symfony/symfony/src/Symfony/Component/DependencyInjection/Definition.php","line":137,"level":-1,"stack":[{"function":"handleError","class":"Symfony\\Component\\Debug\\ErrorHandler","type":"->"},{"file":"/var/www/ghanbari/anar/vendor/symfony/symfony/src/Symfony/Component/DependencyInjection/Definition.php","line":137,"function":"trigger_error"},{"file":"/var/www/ghanbari/anar/vendor/symfony/symfony/src/Symfony/Component/DependencyInjection/Loader/XmlFileLoader.php","line":153,"function":"setFactoryMethod","class":"Symfony\\Component\\DependencyInjection\\Definition","type":"->"},{"file":"/var/www/ghanbari/anar/vendor/symfony/symfony/src/Symfony/Component/DependencyInjection/Loader/XmlFileLoader.php","line":119,"function":"parseDefinition","class":"Symfony\\Component\\DependencyInjection\\Loader\\XmlFileLoader","type":"->"},{"file":"/var/www/ghanbari/anar/vendor/symfony/symfony/src/Symfony/Component/DependencyInjection/Loader/XmlFileLoader.php","line":58,"function":"parseDefinitions","class":"Symfony\\Component\\DependencyInjection\\Loader\\XmlFileLoader","type":"->"},{"file":"/var/www/ghanbari/anar/vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/Command/ContainerDebugCommand.php","line":184,"function":"load","class":"Symfony\\Component\\DependencyInjection\\Loader\\XmlFileLoader","type":"->"},{"file":"/var/www/ghanbari/anar/vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/Command/ContainerDebugCommand.php","line":113,"function":"getContainerBuilder","class":"Symfony\\Bundle\\FrameworkBundle\\Command\\ContainerDebugCommand","type":"->"},{"file":"/var/www/ghanbari/anar/vendor/symfony/symfony/src/Symfony/Component/Console/Command/Command.php","line":259,"function":"execute","class":"Symfony\\Bundle\\FrameworkBundle\\Command\\ContainerDebugCommand","type":"->"},{"file":"/var/www/ghanbari/anar/vendor/symfony/symfony/src/Symfony/Component/Console/Application.php","line":886,"function":"run","class":"Symfony\\Component\\Console\\Command\\Command","type":"->"},{"file":"/var/www/ghanbari/anar/vendor/symfony/symfony/src/Symfony/Component/Console/Application.php","line":195,"function":"doRunCommand","class":"Symfony\\Component\\Console\\Application","type":"->"},{"file":"/var/www/ghanbari/anar/vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/Console/Application.php","line":96,"function":"doRun","class":"Symfony\\Component\\Console\\Application","type":"->"},{"file":"/var/www/ghanbari/anar/vendor/symfony/symfony/src/Symfony/Component/Console/Application.php","line":126,"function":"doRun","class":"Symfony\\Bundle\\FrameworkBundle\\Console\\Application","type":"->"},{"file":"/var/www/ghanbari/anar/app/console","line":27,"function":"run","class":"Symfony\\Component\\Console\\Application","type":"->"}]} 
[2015-04-13 20:34:41] php.INFO: The Symfony\Component\DependencyInjection\Definition::setFactoryService method is deprecated since version 2.6 and will be removed in 3.0. Use Definition::setFactory() instead. {"type":16384,"file":"/var/www/ghanbari/anar/vendor/symfony/symfony/src/Symfony/Component/DependencyInjection/Definition.php","line":208,"level":-1,"stack":[{"function":"handleError","class":"Symfony\\Component\\Debug\\ErrorHandler","type":"->"},{"file":"/var/www/ghanbari/anar/vendor/symfony/symfony/src/Symfony/Component/DependencyInjection/Definition.php","line":208,"function":"trigger_error"},{"file":"/var/www/ghanbari/anar/vendor/symfony/symfony/src/Symfony/Component/DependencyInjection/Loader/XmlFileLoader.php","line":153,"function":"setFactoryService","class":"Symfony\\Component\\DependencyInjection\\Definition","type":"->"},{"file":"/var/www/ghanbari/anar/vendor/symfony/symfony/src/Symfony/Component/DependencyInjection/Loader/XmlFileLoader.php","line":119,"function":"parseDefinition","class":"Symfony\\Component\\DependencyInjection\\Loader\\XmlFileLoader","type":"->"},{"file":"/var/www/ghanbari/anar/vendor/symfony/symfony/src/Symfony/Component/DependencyInjection/Loader/XmlFileLoader.php","line":58,"function":"parseDefinitions","class":"Symfony\\Component\\DependencyInjection\\Loader\\XmlFileLoader","type":"->"},{"file":"/var/www/ghanbari/anar/vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/Command/ContainerDebugCommand.php","line":184,"function":"load","class":"Symfony\\Component\\DependencyInjection\\Loader\\XmlFileLoader","type":"->"},{"file":"/var/www/ghanbari/anar/vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/Command/ContainerDebugCommand.php","line":113,"function":"getContainerBuilder","class":"Symfony\\Bundle\\FrameworkBundle\\Command\\ContainerDebugCommand","type":"->"},{"file":"/var/www/ghanbari/anar/vendor/symfony/symfony/src/Symfony/Component/Console/Command/Command.php","line":259,"function":"execute","class":"Symfony\\Bundle\\FrameworkBundle\\Command\\ContainerDebugCommand","type":"->"},{"file":"/var/www/ghanbari/anar/vendor/symfony/symfony/src/Symfony/Component/Console/Application.php","line":886,"function":"run","class":"Symfony\\Component\\Console\\Command\\Command","type":"->"},{"file":"/var/www/ghanbari/anar/vendor/symfony/symfony/src/Symfony/Component/Console/Application.php","line":195,"function":"doRunCommand","class":"Symfony\\Component\\Console\\Application","type":"->"},{"file":"/var/www/ghanbari/anar/vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/Console/Application.php","line":96,"function":"doRun","class":"Symfony\\Component\\Console\\Application","type":"->"},{"file":"/var/www/ghanbari/anar/vendor/symfony/symfony/src/Symfony/Component/Console/Application.php","line":126,"function":"doRun","class":"Symfony\\Bundle\\FrameworkBundle\\Console\\Application","type":"->"},{"file":"/var/www/ghanbari/anar/app/console","line":27,"function":"run","class":"Symfony\\Component\\Console\\Application","type":"->"}]} 
[container] Public services with tag templating.helper
 Service ID                   alias      Class name                                                      
 templating.helper.assets     assets     Symfony\Bundle\FrameworkBundle\Templating\Helper\AssetsHelper   
 templating.helper.logout_url logout_url Symfony\Bundle\SecurityBundle\Templating\Helper\LogoutUrlHelper 
 templating.helper.security   security   Symfony\Bundle\SecurityBundle\Templating\Helper\SecurityHelper  

Ответ 1

Update

Новый выпуск 2.4.2 для KnpPaginator решит эту проблему. Ваш файл composer.json должен выглядеть так:

"knplabs/knp-paginator-bundle": "~2.4"

Предыдущий ответ

Если вы собираетесь использовать выпуклые версии Symfony, убедитесь, что вы используете последние версии необходимых пакетов в своем проекте и запускаете composer update. Возможно, вам даже понадобится использовать версии dev-master.

Эта проблема была исправлена ​​в январе в соответствии с этим коммандом.

Для этой конкретной проблемы обновите файл composer.json, чтобы иметь следующую строку:

"knplabs/knp-paginator-bundle": "2.4.*@dev"

и запустите composer update.

Для будущих читателей вы можете выбрать любую версию позже 2.4.1. В настоящее время Knplabs еще не выпустил версию для отслеживания Symfony 2.7.

Альтернативное решение в качестве изложенное здесь, заключается в добавлении php в конфигурацию ваших шаблонов шаблонов каркаса:

framework:
    templating:
        engines: ['twig', 'php']