[SecurityBundle] make ACL an optional dependency

This commit is contained in:
Tobias Schultze 2015-11-26 19:59:37 +01:00
parent c9fbff03bc
commit fc66283c7b
2 changed files with 8 additions and 1 deletions

View File

@ -116,6 +116,10 @@ class SecurityExtension extends Extension
private function aclLoad($config, ContainerBuilder $container)
{
if (!interface_exists('Symfony\Component\Security\Acl\Model\AclInterface')) {
throw new \LogicException('You must install symfony/security-acl in order to use the ACL functionality.');
}
$loader = new XmlFileLoader($container, new FileLocator(__DIR__.'/../Resources/config'));
$loader->load('security_acl.xml');

View File

@ -18,7 +18,6 @@
"require": {
"php": ">=5.5.9",
"symfony/security": "~2.8|~3.0",
"symfony/security-acl": "~2.8|~3.0",
"symfony/http-kernel": "~2.8|~3.0",
"symfony/polyfill-php70": "~1.0"
},
@ -30,6 +29,7 @@
"symfony/form": "~2.8|~3.0",
"symfony/framework-bundle": "~2.8|~3.0",
"symfony/http-foundation": "~2.8|~3.0",
"symfony/security-acl": "~2.8|~3.0",
"symfony/twig-bundle": "~2.8|~3.0",
"symfony/twig-bridge": "~2.8|~3.0",
"symfony/process": "~2.8|~3.0",
@ -39,6 +39,9 @@
"doctrine/doctrine-bundle": "~1.4",
"twig/twig": "~1.23|~2.0"
},
"suggest": {
"symfony/security-acl": "For using the ACL functionality of this bundle"
},
"autoload": {
"psr-4": { "Symfony\\Bundle\\SecurityBundle\\": "" },
"exclude-from-classmap": [