]> granicus.if.org Git - php/commitdiff
- Sync with HEAD
authorJani Taskinen <jani@php.net>
Mon, 8 Dec 2008 12:36:10 +0000 (12:36 +0000)
committerJani Taskinen <jani@php.net>
Mon, 8 Dec 2008 12:36:10 +0000 (12:36 +0000)
run-tests.php

index 8bd8926d697351cf9db6ac2575475c9915fb6612..f2ae0da6645db87ffbeaadca78c4b7c8024c5070 100755 (executable)
@@ -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;