Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
Attached is a patch which adds native Drush9 integration. The existing Drush integration is left in place, just renamed so that the file is not loaded by Drush9. This leads to a little but of code deplication but not much . I think its harmless.
The devel_generate drush integration has been refactored and cleaned a lot.
webprofiler should get Drush integration in addition to its current Console integration. Can be a follow-up.
@todo - change from existing services.yml to a drush dedicated services.yml
Comment | File | Size | Author |
---|---|---|---|
#8 | drush9.diff | 54.91 KB | moshe weitzman |
| |||
#6 | drush9.diff | 47.68 KB | moshe weitzman |
| |||
drush9.patch | 20.31 KB | moshe weitzman | |
|
Comments
Comment #2
moshe weitzman CreditAttribution: moshe weitzman commentedComment #3
willzyx CreditAttribution: willzyx commentedNot sure if it is the way to go.. registering drush commands as a services could intoduce an hidden dependency on drush; with this patch on a env where drush is not installed you obtain a fatal error
Comment #4
moshe weitzman CreditAttribution: moshe weitzman commentedThat makes sense. I see that Console uses a separate console.services.yml file. Anyone know how that gets loaded and used?
Comment #5
moshe weitzman CreditAttribution: moshe weitzman commentedComment #6
moshe weitzman CreditAttribution: moshe weitzman commentedUses constructor injection for the Manager. Also uses class prperties instead of drupal_static() to persist the "instance and values". I still need to fix services delaration per #3.
Drush9 has deprecated drush_get_option() (options are passed into command method) and drush_set_error() (just use exceptions). Does anyone object if I change the devel_generate plugins to adapt to this model? I'm also OK with deferring this to Devel 9.
Comment #7
moshe weitzman CreditAttribution: moshe weitzman commentedComment #8
moshe weitzman CreditAttribution: moshe weitzman commentedNow using own drush.services.yml files. If you are using Drush9, update to today's version or later.
Comment #9
moshe weitzman CreditAttribution: moshe weitzman commentedComment #10
moshe weitzman CreditAttribution: moshe weitzman commentedComment #11
willzyx CreditAttribution: willzyx commentedLooks like that with this commit we have lost (at least):
- phpstorm metadata drush integration
- test coverage for devel_generate drush commands
:(
Comment #12
moshe weitzman CreditAttribution: moshe weitzman commented1. I searched and couldn't find anyone talking about this on the internet. We havent received many bug reports AFAIK
2. Drush9 has no suggestion for how contrib commands should get tested. For now, suggest that the plugins get unit tested outside of drush.