首先,我已经看到this question .
当我尝试将Symfony 3.3更新为3.4时,我得到了这个弃用:
User Deprecated: The "assetic.filter_manager" service is private, getting it from the container is deprecated since Symfony 3.2 and will fail in 4.0. You should either make the service public, or stop using the container directly and use dependency injection instead.
User Deprecated: The "assetic.filter.cssrewrite" service is private, getting it from the container is deprecated since Symfony 3.2 and will fail in 4.0. You should either make the service public, or stop using the container directly and use dependency injection instead.
The "security.acl" configuration key is deprecated since Symfony 3.4 and will be removed in 4.0. Install symfony/acl-bundle and use the "acl" key instead.
- 我尝试在
src/MyBundle/Resources/services.yml
中添加:
services:
Symfony\Bundle\AsseticBundle\AsseticBundle:
public: true
- 我安装了acl-bundle . 文件
config/security.yml
:
security:
acl:
connection: default
谢谢你的帮助
1 回答
正如您在评论中所知,
assetic-bundle
已弃用,因此您无需更改其服务定义即可在Symfony 4上进行迁移 .但一般来说,如果要覆盖外部服务配置,可以实现自定义CompilerPass
并按照official documentation中的说明将其添加到您的包中 .
请参阅Definition API文档 .