Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit fc66283

Browse files
committed
[SecurityBundle] make ACL an optional dependency
1 parent c9fbff0 commit fc66283

File tree

2 files changed

+8
-1
lines changed

2 files changed

+8
-1
lines changed

src/Symfony/Bundle/SecurityBundle/DependencyInjection/SecurityExtension.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -116,6 +116,10 @@ public function load(array $configs, ContainerBuilder $container)
116116

117117
private function aclLoad($config, ContainerBuilder $container)
118118
{
119+
if (!interface_exists('Symfony\Component\Security\Acl\Model\AclInterface')) {
120+
throw new \LogicException('You must install symfony/security-acl in order to use the ACL functionality.');
121+
}
122+
119123
$loader = new XmlFileLoader($container, new FileLocator(__DIR__.'/../Resources/config'));
120124
$loader->load('security_acl.xml');
121125

src/Symfony/Bundle/SecurityBundle/composer.json

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@
1818
"require": {
1919
"php": ">=5.5.9",
2020
"symfony/security": "~2.8|~3.0",
21-
"symfony/security-acl": "~2.8|~3.0",
2221
"symfony/http-kernel": "~2.8|~3.0",
2322
"symfony/polyfill-php70": "~1.0"
2423
},
@@ -30,6 +29,7 @@
3029
"symfony/form": "~2.8|~3.0",
3130
"symfony/framework-bundle": "~2.8|~3.0",
3231
"symfony/http-foundation": "~2.8|~3.0",
32+
"symfony/security-acl": "~2.8|~3.0",
3333
"symfony/twig-bundle": "~2.8|~3.0",
3434
"symfony/twig-bridge": "~2.8|~3.0",
3535
"symfony/process": "~2.8|~3.0",
@@ -39,6 +39,9 @@
3939
"doctrine/doctrine-bundle": "~1.4",
4040
"twig/twig": "~1.23|~2.0"
4141
},
42+
"suggest": {
43+
"symfony/security-acl": "For using the ACL functionality of this bundle"
44+
},
4245
"autoload": {
4346
"psr-4": { "Symfony\\Bundle\\SecurityBundle\\": "" },
4447
"exclude-from-classmap": [

0 commit comments

Comments
 (0)