服务"form.type.users"依赖于不存在的服务"security.context"



我在项目Symfony2.8中使用了。我像这样配置了config.yml

fos_user:

db_driver:orm

firewall_name:main

USER_CLASS:VIDEO INTEKENCENCEBUNDLE ENTITY USER

from_email:

    address: you@example.com
    sender_name: example

parameter.yml这样:

参数:

mongodb_server: "mongodb://xxx.xxx.xxx.xxx:xxxx"
database_host: xxx.xxx.xxx.xxx
database_port: xxxx
database_name: dbtest
mailer_transport: smtp
mailer_host: mail.supremecenter.com
mailer_user: test@example.pro
mailer_password: test
database_user: root
database_password: null

但是,当我运行此命令时:

php app/console doctrine:schema:update --force

我得到此错误:

 The service "form.type.users" has a dependency on a non-existent service "security.context".

服务:

form.type.users:
    class: VideoIntelligenceBundleFormUsersType
    arguments: ["@security.context"]
    tags:
        - { name: form.type, alias: users_type }

在https://symfony.com/blog/new-inew-inew-inew-symfony-2-6-security-component-improvements上查看升级注释,该服务已被弃用 - 由于SYMFONY 2.6,您需要检查哪些零件(令牌存储服务security.token_storage可让您访问当前已登录的用户,或者在表格中实际上需要Service security.authorization_checker来检查权限)。

>

但是,如果您使用的是Symfony 2.8,则不应该是阻止者:您确定自己真的在使用该版本,而不是最近的版本吗?但是,将代码重构为这些新服务

,应该是错误的

最新更新