From 7e7fadfb158192f1c0d95d1b17dac0b051cf22b3 Mon Sep 17 00:00:00 2001
From: Christopher Gervais <chris@ergonlogic.com>
Date: Tue, 25 Jun 2013 16:31:42 +0000
Subject: [PATCH] Issue #1841324 by ergonlogic, greg.1.anderson, anarcat: Reduce minimum PHP version to 5.3.3, and add option to ignore the error.

---
 includes/bootstrap.inc |    4 ++--
 includes/drush.inc     |    1 +
 2 files changed, 3 insertions(+), 2 deletions(-)

diff --git a/includes/bootstrap.inc b/includes/bootstrap.inc
index 2250fd2..7242d35 100644
--- a/includes/bootstrap.inc
+++ b/includes/bootstrap.inc
@@ -1034,8 +1034,8 @@ function drush_bootstrap_prepare() {
   // PHP_VERSION, such as runserver/runserver.drush.inc, and also
   // adjust _drush_environment_check_php_ini() and the php_prohibited_options
   // list in the drush script.  See http://drupal.org/node/1748228
-  define('DRUSH_MINIMUM_PHP', '5.3.5');
-  if (version_compare(phpversion(), DRUSH_MINIMUM_PHP) < 0) {
+  define('DRUSH_MINIMUM_PHP', '5.3.3');
+  if (version_compare(phpversion(), DRUSH_MINIMUM_PHP) < 0 && !in_array('--no-min-php-error', $GLOBALS['argv'])) {
     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)));
   }
 
diff --git a/includes/drush.inc b/includes/drush.inc
index 0ed75fd..d2e8013 100644
--- a/includes/drush.inc
+++ b/includes/drush.inc
@@ -351,6 +351,7 @@ function drush_get_global_options($brief = FALSE) {
     $options['confirm-rollback']    = array('description' => 'Wait for confirmation before doing a rollback when something goes wrong.');
     $options['complete-debug']      = array('hidden' => TRUE, 'description' => "Turn on debug mode forf completion code");
     $options['php-options']         = array('description' => "Options to pass to php when running drush.  Only effective when using the `drush` script.");
+    $options['no-min-php-error']    = array('description' => 'Do not throw an error if PHP version is lower than the supported version.');
     $options['deferred-sanitization'] = array('hidden' => TRUE, 'description' => "Defer calculating the sanitization operations until after the database has been copied. This is done automatically if the source database is remote.");
     $options['remote-host']         = array('hidden' => TRUE, 'description' => 'Remote site to execute drush command on. Managed by site alias.');
     $options['remote-user']         = array('hidden' => TRUE, 'description' => 'User account to use with a remote drush command. Managed by site alias.');
-- 
1.7.2.5

