Allow lazy loading of commands (v2) - #63
Conversation
|
Unsure about this as its technically a bc break when we change the constructor. |
|
Nobody should be calling the constructor of these command classes - it's only ever done by the framework. But yes technically it's a BC break. Installing it without this PR throws exceptions on cache:clear etc. How about a new major or minor version bump? |
|
The classes are not final or internal so somebody could What happens if we instead of remove the parameter Would then lazy not work again and there would not be any bc break in the class? Else yes a new major would be required, minors should also not introduce bc breaks here. |
|
I think the critical bit needed to enable lazy loading is to NOT pass the |
ea41abb to
bd51920
Compare
|
@alexander-schranz Your suggestion works fine - thanks. This is ready to merge if you are happy. |
Passing a string means Symfony cannot lazily load the commands.
bd51920 to
9da654e
Compare
|
For reference, |
My first PR to fix this was only half the job. In order to properly enable lazy loading of commands, it is also necessary to NOT pass the command name into the command constructor, as well as the existing fix to specify the "command" attribute on the XML tag element.