【发布时间】:2011-07-30 09:11:26
【问题描述】:
当我在 symfony2.0 中运行 init:acl 我遇到了这个错误,任何人都知道如何解决它!
You have requested a non-existent service "security.acl.dbal.connection"
【问题讨论】:
当我在 symfony2.0 中运行 init:acl 我遇到了这个错误,任何人都知道如何解决它!
You have requested a non-existent service "security.acl.dbal.connection"
【问题讨论】:
您需要在您的应用程序中启用 ACL 支持。将此行添加到您的 security.yml 配置文件中:
acl:
connection: default
然后再次运行php app/console init:acl。
【讨论】:
提醒一下,acl 关键字应该放在security 关键字之后的行上。如果你只放
acl:
connection: default
在您的security.yml 文件的顶部,您可能会收到此错误。我引用它,以便人们可以通过谷歌搜索错误来找到这个线程。
[Symfony\Component\Config\Exception\FileLoaderLoadException]
Cannot import resource "/home/jupiter/symfony/cupon/app/config/secu
rity.yml" from "/home/jupiter/symfony/cupon/app/config/config.yml".
(There is no extension able to load the configuration for "acl"
(in /home/jupiter/symfony/cupon/app/config/security.yml). Looked for
namespace "acl", found "framework", "security", "twig", "monolog",
"swiftmailer", "assetic", "doctrine", "sensio_framework_extra", "ci
udad", "usuario", "tienda", "oferta", "backend", "ideup_simple_pagi
nator", "web_profiler", "sensio_distribution")
[Symfony\Component\DependencyInjection\Exception\InvalidArgumentException]
There is no extension able to load the configuration for "acl" (in
/home/jupiter/symfony/cupon/app/config/security.yml). Looked for na
mespace "acl", found "framework", "security", "twig", "monolog", "s
wiftmailer", "assetic", "doctrine", "sensio_framework_extra", "ciud
ad", "usuario", "tienda", "oferta", "backend", "ideup_simple_pagina
tor", "web_profiler", "sensio_distribution"
所以只要确保acl 在security 关键字之后:
security:
acl:
connection: default
【讨论】:
acl 在 Symfony 4 中不再是内置的。Documentation for acl 说:ACL support was removed in Symfony 4.0. Install the Symfony ACL bundle and refer to its documentation if you want to keep using ACL。
都不适合我。这个服务其实是不可用的……
【讨论】: