Skip to content

Commit 5c3ecf1

Browse files
authored
Merge pull request #2634 from ossinkine/issue-2634
Commands as services
2 parents 41dd908 + b60b470 commit 5c3ecf1

File tree

2 files changed

+29
-1
lines changed

2 files changed

+29
-1
lines changed

DependencyInjection/FOSUserExtension.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ public function load(array $configs, ContainerBuilder $container)
6767
$definition->setFactory(array(new Reference('fos_user.doctrine_registry'), 'getManager'));
6868
}
6969

70-
foreach (array('validator', 'security', 'util', 'mailer', 'listeners') as $basename) {
70+
foreach (array('validator', 'security', 'util', 'mailer', 'listeners', 'commands') as $basename) {
7171
$loader->load(sprintf('%s.xml', $basename));
7272
}
7373

Resources/config/commands.xml

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
<?xml version="1.0" encoding="UTF-8" ?>
2+
3+
<container xmlns="http://symfony.com/schema/dic/services"
4+
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
5+
xsi:schemaLocation="http://symfony.com/schema/dic/services http://symfony.com/schema/dic/services/services-1.0.xsd">
6+
7+
<services>
8+
<service id="fos_user.command.activate_user" class="FOS\UserBundle\Command\ActivateUserCommand">
9+
<tag name="console.command" command="fos:user:activate" />
10+
</service>
11+
<service id="fos_user.command.change_password" class="FOS\UserBundle\Command\ChangePasswordCommand">
12+
<tag name="console.command" command="fos:user:change-password" />
13+
</service>
14+
<service id="fos_user.command.create_user" class="FOS\UserBundle\Command\CreateUserCommand">
15+
<tag name="console.command" command="fos:user:create" />
16+
</service>
17+
<service id="fos_user.command.deactivate_user" class="FOS\UserBundle\Command\DeactivateUserCommand">
18+
<tag name="console.command" command="fos:user:deactivate" />
19+
</service>
20+
<service id="fos_user.command.demote_user" class="FOS\UserBundle\Command\DemoteUserCommand">
21+
<tag name="console.command" command="fos:user:demote" />
22+
</service>
23+
<service id="fos_user.command.promote_user" class="FOS\UserBundle\Command\PromoteUserCommand">
24+
<tag name="console.command" command="fos:user:promote" />
25+
</service>
26+
</services>
27+
28+
</container>

0 commit comments

Comments
 (0)