弃用symfony解决方案

问题描述 投票:0回答:1

将symfony更新到版本4.4后如何解决此问题

[2020-01-03 08:46:27] php.INFO: User Deprecated: The "twig.exception_listener" service is deprecated since Symfony 4.4. {"exception":"[object] (ErrorException(code: 0): User Deprecated: The \"twig.exception_listener\" service is deprecated since Symfony 4.4. at /var/www/api/var/cache/prod/Container8sfHI7P/getTwig_ExceptionListenerService.php:9)"} []
[2020-01-03 08:46:27] php.INFO: User Deprecated: The "Symfony\Component\HttpKernel\EventListener\ExceptionListener" class is deprecated since Symfony 4.4, use "ErrorListener" instead. {"exception":"[object] (ErrorException(code: 0): User Deprecated: The \"Symfony\\Component\\HttpKernel\\EventListener\\ExceptionListener\" class is deprecated since Symfony 4.4, use \"ErrorListener\" instead. at /var/www/api/vendor/symfony/http-kernel/EventListener/ExceptionListener.php:25)"} []
[2020-01-02 05:28:12] php.INFO: User Deprecated: Auto-injection of the container for "\App\Controller\InstallController" is deprecated since Symfony 4.2. Configure it as a service instead. {"exception":"[object] (ErrorException(code: 0): User Deprecated: Auto-injection of the container for \"\\App\\Controller\\InstallController\" is deprecated since Symfony 4.2. Configure it as a service instead. at /var/www/api/vendor/symfony/framework-bundle/Controller/ControllerResolver.php:64)"} []
php symfony
1个回答
0
投票

我也发现很难解决这一难题。它不会由作曲家更新自动解决,因为它是配置的一部分,仅当您首次需要包装时才从recipe中应用。

您必须更改在4.4的默认配置中也更改的三件事(我在下面使用点表示嵌套键):

  • config/packages/twig.yaml中添加twig.exception_controller: null
  • config/routes/dev/twig.yaml中将_errors.resource更改为@FrameworkBundle/Resources/config/routing/errors.xml
  • config/routes/dev/twig.yaml重命名为config/routes/dev/framework.yaml
© www.soinside.com 2019 - 2024. All rights reserved.