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
Allow external libraries to inject non-installed Drupal commands #3175
Comments
@nvaken We all know naming things is hard. For this task we need to break one file into two files. Actually DrupalConsole discover packages and reads a file named |
After thinking this a little using tagged services could be good alternative as well. a) Adding a new tag:
The tag name suggested is b) Add an attribute on the tag like:
This means we keep using only one file |
Sounds a lot better then two files, thumbs up! |
I've tried this a little while ago, though this did not seem to work. The following is a message I wrote a while back on Gitter, still applies for this issue: Just changed my command tags in both drupal/console/extend.console.services.yml and my/package/console.services.yml from
to
That should suffice, right? Still, when renaming settings.php to make sure DC sees my install as uninstalled, my command does not show up? |
@nvaken can you remind me why adding commands on external libraries did not work for you? |
Hi @jmolivas! I've got a custom written library, containing three different commands. I would like to make these available when Drupal is not installed. So, I undertake the following steps to try out above:
To:
After this, I check the before mentioned file, but this still seems to contain my old tags (also see issue: #3234):
I'm using DC 1.0.0-RC16 |
@nvaken The rebuild and registration code changes are on master and will be on next release. |
Ah, you mentioned in Gitter that it was already released in RC16, hence the confusion. I'll check it out in next release. |
Okay, I just installed the latest HEAD from Edit: FWIW, the commands are not available in uninstalled state AND not available in installed state. Renaming the |
@nvaken I will be testing this with latest dev-master of drupal/console and drupal/console-core and ping you back. |
@jmolivas I just found out I should also update
The Also, I thought the command would stay available for both installed and installed state. But it seems that they are only available in uninstalled state. Would it be possible to adjust the tags so we can define:
We have a command which "rebuilds" the entire project, which should be available in uninstalled state as well as installed. (since it does not matter to us if the project is installed). |
Lets make |
Sounds like a plan! And any idea why the launcher does not pick up the commands? |
Since this seems to have been released (partly?) can you let me know if with |
Okay, I think I've been able to answer that last question, using the latest RC18 releases, I see only a @jmolivas I'd be interested to try and fix this. Do you have any suggestions about how this should work? Do the services have to be listed in both |
Currently packages with commands that will be installed in the
vendor
folder will not be able to inject commands for non-installed Drupal setups. The commands are only injected when Drupal installed.Reproduction
drupal list
drupal list
again and note that now the commands are available.Also note, that there is no solution for adding commands to non-installed Drupal setups.
Possible solution
As discussed with @jmolivas:
The text was updated successfully, but these errors were encountered: