diff --git a/src/Symfony/Bundle/SecurityBundle/Command/InitAclCommand.php b/src/Symfony/Bundle/SecurityBundle/Command/InitAclCommand.php index 1512e910c9744..d81efbe8a7390 100644 --- a/src/Symfony/Bundle/SecurityBundle/Command/InitAclCommand.php +++ b/src/Symfony/Bundle/SecurityBundle/Command/InitAclCommand.php @@ -43,7 +43,8 @@ public function isEnabled() protected function configure() { $this - ->setName('init:acl') + ->setName('acl:init') + ->setAliases(array('init:acl')) ->setDescription('Mounts ACL tables in the database') ->setHelp(<<<'EOF' The %command.name% command mounts ACL tables in the database. @@ -65,6 +66,14 @@ protected function configure() */ protected function execute(InputInterface $input, OutputInterface $output) { + if (false !== strpos($input->getFirstArgument(), ':a')) { + $warning = 'The use of "init:acl" command is deprecated since version 3.4 and will be removed in 4.0. Use the "acl:init" command instead.'; + + @trigger_error($warning, E_USER_DEPRECATED); + + $output->writeln(''.$warning.''); + } + $container = $this->getContainer(); $connection = $container->get('security.acl.dbal.connection'); diff --git a/src/Symfony/Bundle/SecurityBundle/Command/SetAclCommand.php b/src/Symfony/Bundle/SecurityBundle/Command/SetAclCommand.php index 7d0146fdc63de..027df84f016a3 100644 --- a/src/Symfony/Bundle/SecurityBundle/Command/SetAclCommand.php +++ b/src/Symfony/Bundle/SecurityBundle/Command/SetAclCommand.php @@ -59,7 +59,7 @@ protected function configure() ->setDescription('Sets ACL for objects') ->setHelp(<<%command.name% command sets ACL. -The ACL system must have been initialized with the init:acl command. +The ACL system must have been initialized with the acl:init command. To set VIEW and EDIT permissions for the user kevin on the instance of Acme\MyClass having the identifier 42: diff --git a/src/Symfony/Bundle/SecurityBundle/Resources/config/console.xml b/src/Symfony/Bundle/SecurityBundle/Resources/config/console.xml index f14b4a5a350dc..e7a833c0a5888 100644 --- a/src/Symfony/Bundle/SecurityBundle/Resources/config/console.xml +++ b/src/Symfony/Bundle/SecurityBundle/Resources/config/console.xml @@ -8,7 +8,8 @@ - + + diff --git a/src/Symfony/Bundle/SecurityBundle/Tests/Functional/SetAclCommandTest.php b/src/Symfony/Bundle/SecurityBundle/Tests/Functional/SetAclCommandTest.php index 3b060a86fc242..4018f86a9cde9 100644 --- a/src/Symfony/Bundle/SecurityBundle/Tests/Functional/SetAclCommandTest.php +++ b/src/Symfony/Bundle/SecurityBundle/Tests/Functional/SetAclCommandTest.php @@ -172,9 +172,9 @@ private function getApplication() $application = new Application($kernel); $application->add(new InitAclCommand()); - $initAclCommand = $application->find('init:acl'); + $initAclCommand = $application->find('acl:init'); $initAclCommandTester = new CommandTester($initAclCommand); - $initAclCommandTester->execute(array('command' => 'init:acl')); + $initAclCommandTester->execute(array('command' => 'acl:init')); return $application; }