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').

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

jhedstrom’s picture

Status: Active » Reviewed & tested by the community

The 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.

jhedstrom’s picture

Status: Reviewed & tested by the community » Closed (duplicate)

Actually, this is a duplicate of #1316322: Add PSR-0 autoloader to drush.

lotyrin’s picture

Version: » 7.x-5.8
Status: Closed (duplicate) » Needs review

While 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.

patcon’s picture

bump? Agreed, it is distinct from the linked issue.

jhedstrom’s picture

Status: Needs review » Needs work

See 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.

jhedstrom’s picture

Version: 7.x-5.8 » 8.x-6.x-dev
moshe weitzman’s picture

I'm fine with adding a file like this. Lets use the more complete version that jhedstrom linked to.

jhedstrom’s picture

Status: Needs work » Needs review
FileSize
1.61 KB

Attached is a patch with the composer.json file from #1316322: Add PSR-0 autoloader to drush.

RobLoach’s picture

  • youngj/httpserver doesn't need the repositories definition anymore
  • Drush isn't using HTTPServer through Composer yet, so we don't need to require it quite yet
  • Same with the other packages, we should probably add them, along with the autoload key, in the other issues
  • Added Drush's bin files
RobLoach’s picture

FileSize
1.1 KB
RobLoach’s picture

FileSize
1.1 KB

Switched to drush/drush.

greg.1.anderson’s picture

Status: Needs review » Needs work

In includes/bootstrap.inc:

define('DRUSH_MINIMUM_PHP', '5.3.5');

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.

moshe weitzman’s picture

Status: Needs work » Fixed

I 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

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.

Mark Trapp’s picture

Version: 8.x-6.x-dev » 7.x-5.x-dev
Status: Closed (fixed) » Needs review
FileSize
1.15 KB

I'm fine with committing this to 7.x-5.x too if folks want that.

I'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.

greg.1.anderson’s picture

Assigned: Unassigned » jonhattan

Drush 6 will be out soon, but I expect there will be some more 5.x releases for a while.

Mark Trapp’s picture

Oh, 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.

greg.1.anderson’s picture

I 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.

greg.1.anderson’s picture

Version: 7.x-5.x-dev » 8.x-6.x-dev
Status: Needs review » Closed (won't fix)
Issue tags: +Needs migration

This 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.

moshe weitzman’s picture

Further work along these lines is at https://github.com/drush-ops/drush/pull/129.