diff options
author | Jani Taskinen <jani@php.net> | 2008-12-08 12:36:10 +0000 |
---|---|---|
committer | Jani Taskinen <jani@php.net> | 2008-12-08 12:36:10 +0000 |
commit | 733abc019a894982369ed3c2d4e9da87b9aa743b (patch) | |
tree | a349edc9d56f1d1f21a283b85860d273cddb7783 /run-tests.php | |
parent | 15a212b259dcc0ffd65bfaa0c394800f3570f9b3 (diff) | |
download | php-git-733abc019a894982369ed3c2d4e9da87b9aa743b.tar.gz |
- Sync with HEAD
Diffstat (limited to 'run-tests.php')
-rwxr-xr-x | run-tests.php | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/run-tests.php b/run-tests.php index 8bd8926d69..f2ae0da664 100755 --- a/run-tests.php +++ b/run-tests.php @@ -59,6 +59,11 @@ NO_PROC_OPEN_ERROR; exit; } +// If __DIR__ is not defined, define it +if (!defined('__DIR__')) { + define('__DIR__', realpath(dirname(__FILE__))); +} + // If timezone is not set, use UTC. if (ini_get('date.timezone') == '') { date_default_timezone_set('UTC'); @@ -1003,11 +1008,16 @@ function system_with_timeout($commandline, $env = null, $stdin = null) $data = ''; + $bin_env = array(); + foreach($env as $key => $value) { + $bin_env[(binary)$key] = (binary)$value; + } + $proc = proc_open($commandline, array( 0 => array('pipe', 'r'), 1 => array('pipe', 'w'), 2 => array('pipe', 'w') - ), $pipes, $cwd, $env, array('suppress_errors' => true, 'binary_pipes' => true)); + ), $pipes, $cwd, $bin_env, array('suppress_errors' => true, 'binary_pipes' => true)); if (!$proc) { return false; |