Skip to content
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

find a way to avoid ->add()s every command, rather do something like symfony loads all of them #49

Closed
cordoval opened this issue Mar 5, 2014 · 5 comments

Comments

@cordoval
Copy link
Member

cordoval commented Mar 5, 2014

No description provided.

@cordoval
Copy link
Member Author

cordoval commented Mar 5, 2014

read again @matthiasnoback's http://php-and-symfony.matthiasnoback.nl/2013/10/symfony2-console-commands-as-services-why/ blog post and decided for keeping my clean-code eyes bright for now.

@cordoval cordoval closed this as completed Mar 5, 2014
@matthiasnoback
Copy link

Well, as far as I know there's no way to circumvent loading all commands. It's necessary to find out what their names are at least. If you make the commands themselves services and their constructor arguments lazy, this will not automatically instantiate all the injected services. Of course, making them ContainerAware is also an option, but it's just nicer to use constructor arguments.

@cordoval
Copy link
Member Author

cordoval commented Mar 5, 2014

@matthiasnoback i think is an interesting optimization, i think there is a way, to basically map an array and basically do either reflection or better match the name of the class to whatever needs to be loaded. I would very much like to see Gush going CAS and also abstracting more its base so that soon we can make it fully DDD and leave symfony component if need be.

@matthiasnoback
Copy link

Well, I think that would be great. By the way, did you try Aura.Cli? It has some nice things in it. If your code is decoupled from the framework, you could switch to that easily. See also what Paul Jones wrote about this kind of approach: http://paul-m-jones.com/archives/5921

@cordoval
Copy link
Member Author

cordoval commented Mar 5, 2014

yeah @pmjones and I sat at SunshinePHP to talk about this 👯 but yeah it is a wonderful topic to talk, we should gather somewhere soonish

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants