Issue #1477110 by msonnabaum, tim.plunkett: Fixed php path detection in run-tests.sh.

merge-requests/26/head
webchick 2012-04-30 22:06:51 -07:00
parent 1ef0cd4e9c
commit 45589029ed
1 changed files with 4 additions and 4 deletions

View File

@ -253,14 +253,14 @@ function simpletest_script_init($server_software) {
if (!empty($args['php'])) { if (!empty($args['php'])) {
$php = $args['php']; $php = $args['php'];
} }
elseif (!empty($_ENV['_'])) { elseif ($php_env = getenv('_')) {
// '_' is an environment variable set by the shell. It contains the command that was executed. // '_' is an environment variable set by the shell. It contains the command that was executed.
$php = $_ENV['_']; $php = $php_env;
} }
elseif (!empty($_ENV['SUDO_COMMAND'])) { elseif ($sudo = getenv('SUDO_COMMAND')) {
// 'SUDO_COMMAND' is an environment variable set by the sudo program. // 'SUDO_COMMAND' is an environment variable set by the sudo program.
// Extract only the PHP interpreter, not the rest of the command. // Extract only the PHP interpreter, not the rest of the command.
list($php, ) = explode(' ', $_ENV['SUDO_COMMAND'], 2); list($php, ) = explode(' ', $sudo, 2);
} }
else { else {
simpletest_script_print_error('Unable to automatically determine the path to the PHP interpreter. Supply the --php command line argument.'); simpletest_script_print_error('Unable to automatically determine the path to the PHP interpreter. Supply the --php command line argument.');