Just a heads up: Some people use tools like phpbrew to manage multiple versions of php on their systems. The rest of drush attempts to work on php 5.2, so might be nice to have some logic to skip loading the composer extension based on the php version :)

Not urgent, but guy who I work with ran into an issue when he was intentionally running php 5.2 to simulate devcloud

CommentFileSizeAuthor
#8 php.patch5.71 KBrobloach

Comments

robloach’s picture

Maybe something like this?

// ...
if (version_compare(phpversion(), '5.3', '>=')) {
  // Do Composer stuffs.
}

Probably should output a notice too.

robloach’s picture

Version: 8.x-1.0-alpha3 » 8.x-1.x-dev
Priority: Normal » Critical
Status: Active » Needs work

Just ran into this on an old environment :-) .

robloach’s picture

Status: Needs work » Fixed

Status: Fixed » Closed (fixed)

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

kostajh’s picture

Priority: Critical » Major
Status: Closed (fixed) » Active

I'm not sure this is fixed. Drush Composer crashes Drush when running PHP 5.2.9.

robloach’s picture

What error are you running into? Have you updated Drush Composer lately?

kostajh’s picture

Here are the steps to reproduce (on a system running PHP 5.2.9):

drush dl composer-8.x-1.x-dev
drush status

Drush command terminated abnormally due to an unrecoverable error.                                           [error]
Error: syntax error, unexpected T_STRING in /.drush/composer/composer.drush.inc, line 89

Line 89 is $application = new Composer\Console\Application();

robloach’s picture

Status: Active » Needs review
StatusFileSize
new5.71 KB

Something like this?

kostajh’s picture

Status: Needs review » Reviewed & tested by the community

That works for me, I now see Composer requires at least PHP 5.3.2 in order to run properly. You are currently on PHP 5.2.9.. Thanks!

robloach’s picture

Status: Reviewed & tested by the community » Fixed

Thanks!

Status: Fixed » Closed (fixed)

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