diff --git a/drush.php b/drush.php index 1650f41..a5e91f8 100755 --- a/drush.php +++ b/drush.php @@ -10,7 +10,9 @@ require(dirname(__FILE__) . '/includes/bootstrap.inc'); -drush_bootstrap_prepare(); +if (drush_bootstrap_prepare() === FALSE) { + exit(1); +} exit(drush_main()); /** diff --git a/includes/bootstrap.inc b/includes/bootstrap.inc index 73bcff2..b10bd73 100644 --- a/includes/bootstrap.inc +++ b/includes/bootstrap.inc @@ -1004,13 +1004,13 @@ function drush_bootstrap_prepare() { // Terminate immediately unless invoked as a command line script if (!drush_verify_cli()) { - die('drush is designed to run via the command line.'); + return drush_set_error('DRUSH_REQUIREMENTS_ERROR', dt('drush is designed to run via the command line.')); } // Check supported version of PHP. define('DRUSH_MINIMUM_PHP', '5.3.5'); if (version_compare(phpversion(), DRUSH_MINIMUM_PHP) < 0) { - die('Your command line PHP installation is too old. Drush requires at least PHP ' . DRUSH_MINIMUM_PHP . "\n"); + return drush_set_error('DRUSH_REQUIREMENTS_ERROR', dt('Your command line PHP installation is too old. Drush requires at least PHP !version.', array('!version' => DRUSH_MINIMUM_PHP))); } $drush_info = drush_read_drush_info();