Download & Extend

Use proper exit code when failing on insufficient PHP version

Project:Drush
Component:Core Commands
Category:bug report
Priority:normal
Assigned:Unassigned
Status:closed (fixed)

Issue Summary

When the command-line version of PHP isn't sufficient, we get a helpful error message. Unfortunately, it uses the wrong exit code, making it difficult to react to this failure mode:

# drush
Your command line PHP installation is too old. Drush requires at least PHP 5.3.5
# echo $?
0

Comments

#1

Status:active» needs review

Changed die() to drush_log() and exit(1). Perhaps drush_set_error() is preferable for remote calls ?

AttachmentSize
drush-1821888.patch 686 bytes

#2

A better approach.

AttachmentSize
drush-1821888.patch 1.25 KB

#3

Status:needs review» reviewed & tested by the community

Could you change the error message so that Drush is capitalized. It should only be lowercase when referring to the executable shell script and not the Drush project in general.

#4

Status:reviewed & tested by the community» fixed

done

#5

Status:fixed» closed (fixed)

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