Skip to content

[SecurityBundle] make ACL an optional dependency #16694

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Nov 26, 2015
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,10 @@ public function load(array $configs, ContainerBuilder $container)

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.');
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should be \RuntimeException() IMO.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Doesn't really matter and its the same as in doctrine/DoctrineCacheBundle#77

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I prefer logic :-)

}

$loader = new XmlFileLoader($container, new FileLocator(__DIR__.'/../Resources/config'));
$loader->load('security_acl.xml');

Expand Down
5 changes: 4 additions & 1 deletion src/Symfony/Bundle/SecurityBundle/composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -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"
},
Expand All @@ -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",
Expand All @@ -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": [
Expand Down