将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)"} []
Run Code Online (Sandbox Code Playgroud)
我发现这个问题也很难解决。它不会由 Composer 更新自动解决,因为它是配置的一部分,仅在您第一次需要包时才从它的配方中应用。
您必须更改 4.4 的默认配置中也更改的三项内容(我使用下面的点表示嵌套键):
config/packages/twig.yaml加twig.exception_controller: nullconfig/routes/dev/twig.yaml改变_errors.resource到@FrameworkBundle/Resources/config/routing/errors.xmlconfig/routes/dev/twig.yaml为config/routes/dev/framework.yaml| 归档时间: |
|
| 查看次数: |
1962 次 |
| 最近记录: |