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

Command groups #19

Open
fprochazka opened this issue May 20, 2014 · 1 comment
Open

Command groups #19

fprochazka opened this issue May 20, 2014 · 1 comment
Labels

Comments

@fprochazka
Copy link
Member

Something like

$ php www/index.php kdyby:command-groups:export

will create runners in temp/ that will be added into projects composer.json into extra: bins and composer will then link them to vendor/bin.

The runners must get the commands by searching of tags on Container, so the command doesn't have to be run every time you add Command.

Every command will be in "default" group by default, that will be available from www/index.php. If you add it to another group, it will no longer be in "default" group, becase the "default" group will be added only when command has no groups. That means you could still add it to "default" group.

Then you could run them from there afterwards.

$ vendor/bin/app-crons emails:send 
$ vendor/bin/doctrine orm:validate-schema
$ vendor/bin/utils user:create
$ vendor/bin/dangerous-commands-that-could-damage-database recalculate:credits

You should also be able to create your own runner and add some custom logic. Therefore there has to be a factory that will create the Console\Application object with commands from given group and you could then wrap it or whatever. This one needs a bit more thinking :)

Inspired by @VasekPurchart


Motivation: on the general runner you don't need to see crons and every single tool, you only need few basic commands like orm:validate etc. When you get over 20+ commands it get's confusing. This separation should make the usage and orientation easier.

@mishak87
Copy link
Contributor

I like the idea of separation of the console commands per group/extension/library.

I'm not sure about custom logic part maybe if you could expand on. So far it looks like bad design or need for separate binary/application that handles different stuff.

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

No branches or pull requests

2 participants