-
Notifications
You must be signed in to change notification settings - Fork 37
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
Standard naming conventions and search locations for command files #12
Comments
No strong opinion here. I think the |
Symfony Console searches for Other options:
|
Another thing that would be sensible would be to search for |
My two cents.... I personally like the structure that Symfony Console provide Since this mainly for support for annotation commands what about |
Yes, I agree that it should be possible to write either a Symfony Console command or a new annotation command. The proposed PR in DrupalConsole, hechoendrupal/drupal-console#2081, supports this. Annotations can be used for many things other than defining commands, though, so I think that
|
|
I prefer the shorter variation myself, but am not super strongly attached with it, and could go with ^^ if that's what most folks want to see. |
I think the command classes miss a neat name, "command class instance" is a bit long and clumsy. What about just going with CommandHandler? Then we could use a CommandHandler namespace and have a clear differentation to CommandHandlers that provide multiple commands and Command classes ? |
Ended up leaving the defaults as they were. Each individual project may set the search locations they prefer, though. |
Currently, the CommandFileDiscovery class searches for command files named
*Commands.php
in directories namedCliTools
(orsrc/CliTools
).In Drush, I tried an alternative search pattern, and currently look for command files named "*CommandFile.php" in directories named
CommandFiles
(orsrc/CommandFiles
).Ideally, we should decide on a single standard default that both Drush and DrupalConsole can use, so that command files are found consistently. At the moment, I am leaning towards the second option, and calling these literally CommandFiles, as Drush is currently doing. Other conventions are possible, of course; anyone with opinions on the subject should weigh in.
The text was updated successfully, but these errors were encountered: