From fc66283c7b446a0ba69ce9a4e2b187f6677efad9 Mon Sep 17 00:00:00 2001 From: Tobias Schultze Date: Thu, 26 Nov 2015 19:59:37 +0100 Subject: [PATCH] [SecurityBundle] make ACL an optional dependency --- .../SecurityBundle/DependencyInjection/SecurityExtension.php | 4 ++++ src/Symfony/Bundle/SecurityBundle/composer.json | 5 ++++- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/src/Symfony/Bundle/SecurityBundle/DependencyInjection/SecurityExtension.php b/src/Symfony/Bundle/SecurityBundle/DependencyInjection/SecurityExtension.php index bd0d2959b2..323fcfe6b3 100644 --- a/src/Symfony/Bundle/SecurityBundle/DependencyInjection/SecurityExtension.php +++ b/src/Symfony/Bundle/SecurityBundle/DependencyInjection/SecurityExtension.php @@ -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'); diff --git a/src/Symfony/Bundle/SecurityBundle/composer.json b/src/Symfony/Bundle/SecurityBundle/composer.json index 7803025b2b..b185aac383 100644 --- a/src/Symfony/Bundle/SecurityBundle/composer.json +++ b/src/Symfony/Bundle/SecurityBundle/composer.json @@ -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": [