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.
I'd like to be able to add Drush to a composer project but it's not on packagist and doesn't have a composer.json
I've attached a patch for such, but a vendor will need to be picked (file has 'drupal').
Comment | File | Size | Author |
---|---|---|---|
#15 | drush-composer-for-7-5-1792550.patch | 1.15 KB | Mark Trapp |
#11 | 1792550.patch | 1.1 KB | RobLoach |
#10 | 1792550.patch | 1.1 KB | RobLoach |
#8 | drush-composer-json-1792550-08.patch | 1.61 KB | jhedstrom |
drush-composer.patch | 250 bytes | lotyrin |
Comments
Comment #1
jhedstromThe Drupal Extension uses the vendor of 'drupal', so I think that makes sense here too. I think makes sense for a variety of use cases.
Comment #2
jhedstromActually, this is a duplicate of #1316322: Add PSR-0 autoloader to drush.
Comment #3
lotyrin CreditAttribution: lotyrin commentedWhile getting Drush to use composer would be nice, my primary goal here is to be able to add Drush to projects which are already taking advantage of Composer, which is a distinct (and much simpler) change.
Comment #4
patcon CreditAttribution: patcon commentedbump? Agreed, it is distinct from the linked issue.
Comment #5
jhedstromSee Moshe's comments in #1316322: Add PSR-0 autoloader to drush regarding using `drush` as the vendor. Also, the composer file in that issue is more complete, so bringing that over here would make this RTBC in my opinion.
Comment #6
jhedstromComment #7
moshe weitzman CreditAttribution: moshe weitzman commentedI'm fine with adding a file like this. Lets use the more complete version that jhedstrom linked to.
Comment #8
jhedstromAttached is a patch with the
composer.json
file from #1316322: Add PSR-0 autoloader to drush.Comment #9
RobLoachComment #10
RobLoachComment #11
RobLoachSwitched to
drush/drush
.Comment #12
greg.1.anderson CreditAttribution: greg.1.anderson commentedIn includes/bootstrap.inc:
It would be especially nifty if the bootstrap code could check the composer.json file for the required php version, so that we did not need to maintain this in two places. Failing that, though, these constants should both be the same.
Comment #13
moshe weitzman CreditAttribution: moshe weitzman commentedI copied that min PHP version, and changed the homepage to our web site - http://www.drush.org. Committed to 8.x-6.x. I'm fine with committing this to 7.x-5.x too if folks want that.
I went ahead and created a Packagist package - https://packagist.org/packages/drush/drush
Folks who want to do more with composer should look at #1316322: Add PSR-0 autoloader to drush
Comment #15
Mark TrappI'd love to see this added for 7.x-5.x. I took a look at the composer.json that's already there for 8.x-6.x, and it should work without modification. Nevertheless, attached is a patch for the current composer.json.
Comment #16
greg.1.anderson CreditAttribution: greg.1.anderson commentedDrush 6 will be out soon, but I expect there will be some more 5.x releases for a while.
Comment #17
Mark TrappOh, oops: I misread the compatibility note as the 8.x-6.x branch being for Drupal 8 only, but it's not. I don't mind just depending on that, so if I'm the only one looking for this, I guess this could just be closed out again.
Comment #18
greg.1.anderson CreditAttribution: greg.1.anderson commentedI think it's pretty safe to upgrade to 8.x-6.x-rc4 at this point, if there's anything from Drush 6 you need.
Comment #19
greg.1.anderson CreditAttribution: greg.1.anderson commentedThis issue was marked
closed (won't fix)
because Drush has moved to Github.If this feature is still desired, you may copy it to our Github project. For best results, create a Pull Request that has been updated for the master branch. Post a link here to the PR, and please also change the status of this issue to
closed (duplicate)
.Please ask support questions on Drupal Answers.
Comment #20
moshe weitzman CreditAttribution: moshe weitzman commentedFurther work along these lines is at https://github.com/drush-ops/drush/pull/129.