希望我在这里遗漏了一些东西。
以下security.yml
文件在Symfony 2.3中无问题。但是,升级到Symfony 2.8会引发此错误:
Argument 2 passed to Symfony\Component\Security\Core\Authentication\Provider\DaoAuthenticationProvider::__construct() must be an instance of Symfony\Component\Security\Core\User\UserCheckerInterface
我在新安装的Symfony 2.8.2和2.3上测试了这一点,只更改了security.yml
文件。
security.yml
security:
providers:
my_in_memory_provider:
memory:
users:
foo:
password: foo
roles: ROLE_USER
bar:
password: bar
roles: [ROLE_USER, ROLE_ADMIN]
firewalls:
# disables authentication for assets and the profiler, adapt it according to your needs
dev:
pattern: ^/(_(profiler|wdt)|css|images|js)/
security: false
api:
pattern: ^/api
http_digest:
key: %secret%
anonymous: false
我已经检查了从2.3到2.8的升级路径,没有任何东西突然出现在我看来显然是问题所在。然而,在网上搜索这个问题却没有提起太多,所以我猜我错过了什么?