我已经下载并安装了 Symfony2 标准版。我已经完成了github 自述文件中详述的所有步骤,以删除用作框架演示的 AcmeBundle。尝试访问控制台以仔细检查我的路线时:
$ php app/console router:debug
我收到以下错误:
[Symfony\Component\Config\Definition\Exception\InvalidConfigurationException]
The child node "providers" at path "security" must be configured.
当我在我的security.yml
文件中取消删除 security.providers 时,我只剩下:
jms_security_extra:
secure_all_services: false
expressions: true
security:
encoders:
Symfony\Component\Security\Core\User\User: plaintext
role_hierarchy:
ROLE_ADMIN: ROLE_USER
ROLE_SUPER_ADMIN: [ROLE_USER, ROLE_ADMIN, ROLE_ALLOWED_TO_SWITCH]
providers:
in_memory:
memory:
users:
user: { password: userpass, roles: [ 'ROLE_USER' ] }
admin: { password: adminpass, roles: [ 'ROLE_ADMIN' ] }
firewalls:
dev:
pattern: ^/(_(profiler|wdt)|css|images|js)/
security: false
access_control:
#- { path: ^/login, roles: IS_AUTHENTICATED_ANONYMOUSLY, requires_channel: https }
#- { path: ^/_internal/secure, roles: IS_AUTHENTICATED_ANONYMOUSLY, ip: 127.0.0.1 }
我得到一个不同但类似的错误:
[InvalidArgumentException]
You must at least add one authentication provider.
我不知道该怎么做才能修复它。有什么解决办法吗?