From bc0ab60bb6e31742af186f40a737d003d14d42c6 Mon Sep 17 00:00:00 2001 From: Greg Anderson Date: Fri, 24 May 2013 15:25:22 -0700 Subject: Greg Anderson: Generated with Drush iq --- README.txt | 8 +++++++- drush | 3 --- drush.php | 5 +++++ includes/environment.inc | 4 ++-- 4 files changed, 14 insertions(+), 6 deletions(-) diff --git a/README.txt b/README.txt index b182b88..8cd9d8a 100644 --- a/README.txt +++ b/README.txt @@ -207,7 +207,13 @@ be passed to php on the command line when Drush is executed. Drush requires a fairly unrestricted php environment to run in. In particular, you should insure that safe_mode, open_basedir, disable_functions and -disable_classes are empty. +disable_classes are empty. If you are using php 5.3.x, you may also need to +add the following definitions to your php.ini file: + +magic_quotes_gpc = Off +magic_quotes_runtime = Off +magic_quotes_sybase = Off + INSTALLING DRUSH ON WINDOWS: ---------------------------- diff --git a/drush b/drush index 1db9236..aa52308 100755 --- a/drush +++ b/drush @@ -120,9 +120,6 @@ if [ -n "$PHP_OPTIONS" ] ; then php_options="$php_options $PHP_OPTIONS" fi -# Always disable magic_quotes_gpc and friends -php_options="$php_options -d magic_quotes_gpc=0 -d magic_quotes_runtime=0 -d magic_quotes_sybase=0" - # Pass in the path to php so that drush knows which one to use if it # re-launches itself to run subcommands. We will also pass in the php options. # Important note: Any options added here must be removed when Drush processes diff --git a/drush.php b/drush.php index 91563bf..fec7eff 100755 --- a/drush.php +++ b/drush.php @@ -8,6 +8,11 @@ * @requires PHP CLI 5.3.5, or newer. */ +// Always disable magic_quotes_gpc and friends +ini_set("magic_quotes_gpc", "Off"); +ini_set("magic_quotes_runtime", "Off"); +ini_set("magic_quotes_sybase", "Off"); + require(dirname(__FILE__) . '/includes/bootstrap.inc'); if (drush_bootstrap_prepare() === FALSE) { diff --git a/includes/environment.inc b/includes/environment.inc index 7c8f9ee..edf1481 100644 --- a/includes/environment.inc +++ b/includes/environment.inc @@ -88,7 +88,7 @@ function _drush_postmortem() { * notify the user that a setting change is needed and abort. */ function _drush_environment_check_php_ini() { - $ini_checks = array('safe_mode' => '', 'open_basedir' => '', 'disable_functions' => array('exec', 'system'), 'disable_classes' => '', 'magic_quotes_gpc' => '', 'magic_quotes_runtime' => ''); + $ini_checks = array('safe_mode' => '', 'open_basedir' => '', 'disable_functions' => array('exec', 'system'), 'disable_classes' => '', 'magic_quotes_gpc' => '', 'magic_quotes_runtime' => '', 'magic_quotes_sybase' => ''); // Test to insure that certain php ini restrictions have not been enabled $prohibited_list = array(); @@ -96,7 +96,7 @@ function _drush_environment_check_php_ini() { $ini_value = ini_get($prohibited_mode); $invalid_value = FALSE; if (empty($disallowed_value)) { - $invalid_value = !empty($ini_value); + $invalid_value = !empty($ini_value) && (strcasecmp($ini_value, 'off') != 0); } else { foreach ($disallowed_value as $test_value) { -- 1.7.9.5