By default the console command folder is in: MyProject\MyBundle\Command
and all works as expected, but if I move the folder in another directory like :MyProject\MyBundle\MyFolder\Command
on command execution it thrown an: [InvalidArgumentException] Command "command_name" is not defined.
I haven't been able to find anything useful after searching over the internet and reading all the documentation possibly related to this problem...
The question is: Exist a mode to move that folder or I'll be forced to use the default folder?
Thanks!
You can define it as a service:
my_command:
class: MyProject\MyBundle\MyFolder\Command\MyCommand
tags:
- { name: console.command }
You can read more about this method in Symfony
documentation.