helly Fri Jul 29 13:25:41 2005 EDT
Modified files:
/php-src run-tests.php
Log:
- Add ENV support (mike)
http://cvs.php.net/diff.php/php-src/run-tests.php?r1=1.223&r2=1.224&ty=u
Index: php-src/run-tests.php
diff -u php-src/run-tests.php:1.223 php-src/run-tests.php:1.224
--- php-src/run-tests.php:1.223 Sun Jul 17 20:19:28 2005
+++ php-src/run-tests.php Fri Jul 29 13:25:38 2005
@@ -23,7 +23,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: run-tests.php,v 1.223 2005/07/18 00:19:28 helly Exp $ */
+/* $Id: run-tests.php,v 1.224 2005/07/29 17:25:38 helly Exp $ */
/*
* TODO:
@@ -926,6 +926,12 @@
$query_string = '';
}
+ if (!empty($section_text['ENV'])) {
+ foreach (explode("\n", $section_text['ENV']) as $env) {
+ ($env = trim($env)) and putenv($env);
+ }
+ }
+
putenv("REDIRECT_STATUS=1");
putenv("QUERY_STRING=$query_string");
putenv("PATH_TRANSLATED=$tmp_file");
@@ -951,7 +957,11 @@
putenv("CONTENT_TYPE=");
putenv("CONTENT_LENGTH=");
- $cmd = "$php$pass_options$ini_settings -f \"$tmp_file\" $args
2>&1";
+ if (empty($section_text['ENV'])) {
+ $cmd = "$php$pass_options$ini_settings -f \"$tmp_file\"
$args 2>&1";
+ } else {
+ $cmd = "$php$pass_options$ini_settings < \"$tmp_file\"
$args 2>&1";
+ }
}
if ($DETAILED) echo "
@@ -968,6 +978,13 @@
// $out = `$cmd`;
$out = system_with_timeout($cmd);
+ if (!empty($section_text['ENV'])) {
+ foreach (explode("\n", $section_text['ENV']) as $env) {
+ $env = explode('=', $env);
+ putenv($env[0] .'=');
+ }
+ }
+
@unlink($tmp_post);
// Does the output match what is expected?
--
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php