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.
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
Comment | File | Size | Author |
---|---|---|---|
#2 | drush-1821888.patch | 1.25 KB | jonhattan |
#1 | drush-1821888.patch | 686 bytes | jonhattan |
Comments
Comment #1
jonhattanChanged die() to drush_log() and exit(1). Perhaps drush_set_error() is preferable for remote calls ?
Comment #2
jonhattanA better approach.
Comment #3
moshe weitzman CreditAttribution: moshe weitzman commentedCould 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.
Comment #4
jonhattandone