我想使用 Symfony 的 ACL 系统,但无法初始化数据库。我按照这里的步骤How to Use Access Control List (ACL's) ,但是当我运行控制台命令时,我得到There are no Commands Defined in the "init"namespace.
我在 AppKernel new Symfony\Bundle\SecurityBundle\SecurityBundle()
中定义了 SecurityBundle。这是我的 security.yml
# security.yml
security:
acl:
connection: default
我不太明白我错过了什么。我确实明白这可能是配置问题。查看 symfony 库中的命令我发现
<?php
class InitAclCommand extends ContainerAwareCommand
{
/**
* {@inheritdoc}
*/
public function isEnabled()
{
if (!$this->getContainer()->has('security.acl.dbal.connection')) {
return false;
}
return parent::isEnabled();
}
//...
}
我的猜测是 isEnabled()
返回 false,但我不确定为此设置什么配置或在哪里设置。
我使用的是 Symfony 3.1.9 和 PHP7.0
谢谢
最佳答案
检查您是否安装了以下软件包:
composer require symfony/security-acl
关于php - Symfony 初始化 :acl command missing,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/41856533/