summaryrefslogtreecommitdiff
path: root/run-tests.php
diff options
context:
space:
mode:
authorMarcus Boerger <helly@php.net>2002-11-01 13:03:30 +0000
committerMarcus Boerger <helly@php.net>2002-11-01 13:03:30 +0000
commitad414f28a96f6f61dafea5adef800de7d267c87c (patch)
tree721161a9e6752a78158ca53d2a3063f6379620c9 /run-tests.php
parent20d7a682ab4252b3839fdb68d12cd8c7cc28b5fa (diff)
downloadphp-git-ad414f28a96f6f61dafea5adef800de7d267c87c.tar.gz
-move -d stuff into function and update settings for info call
Diffstat (limited to 'run-tests.php')
-rwxr-xr-xrun-tests.php69
1 files changed, 43 insertions, 26 deletions
diff --git a/run-tests.php b/run-tests.php
index efdeb8f54b..c93ba04402 100755
--- a/run-tests.php
+++ b/run-tests.php
@@ -106,7 +106,20 @@ PHP_OS : " . PHP_OS . "
INI actual : " . realpath(get_cfg_var("cfg_file_path")) . "
More .INIs : " . str_replace("\n","", php_ini_scanned_files()); ?>';
save_text($info_file, $php_info);
-$php_info = `$php -d 'output_handler=' -d 'zlib.output_compression=' $info_file`;
+$settings = array(
+ 'open_basedir=',
+ 'safe_mode=0',
+ 'output_buffering=Off',
+ 'output_handler=',
+ 'zlib.output_compression=',
+ 'auto_prepend_file=',
+ 'auto_append_file=',
+ 'disable_functions='
+ );
+$params = array();
+settings2array($settings,$params);
+settings2params($params);
+$php_info = `$php $params $info_file`;
@unlink($info_file);
// Write test context information.
@@ -511,36 +524,14 @@ TEST $file
"auto_prepend_file=",
);
$ini_settings = array();
- foreach($settings as $setting) {
- if (strpos($setting, '=')!==false) {
- $setting = explode("=", $setting);
- $name = trim(strtolower($setting[0]));
- $value = trim($setting[1]);
- $ini_settings[$name] = $value;
- }
- }
+ settings2array($settings, $ini_settings);
// Any special ini settings
// these may overwrite the test defaults...
if (array_key_exists('INI', $section_text)) {
- foreach(preg_split( "/[\n\r]+/", $section_text['INI']) as $setting) {
- if (strpos($setting, '=')!==false) {
- $setting = explode("=", $setting,2);
- $name = trim(strtolower($setting[0]));
- $value = trim($setting[1]);
- $ini_settings[$name] = addslashes($value);
- }
- }
- }
- if (count($ini_settings)) {
- $settings = '';
- foreach($ini_settings as $name => $value) {
- $settings .= " -d \"$name=$value\"";
- }
- $ini_settings = $settings;
- } else {
- $ini_settings = '';
+ settings2array(preg_split( "/[\n\r]+/", $section_text['INI']), $ini_settings);
}
+ settings2params($ini_settings);
// We've satisfied the preconditions - run the test!
save_text($tmp_file,$section_text['FILE']);
@@ -711,6 +702,32 @@ function error($message)
exit(1);
}
+function settings2array($settings, &$ini_settings)
+{
+ foreach($settings as $setting) {
+ if (strpos($setting, '=')!==false) {
+ $setting = explode("=", $setting);
+ $name = trim(strtolower($setting[0]));
+ $value = trim($setting[1]);
+ $ini_settings[$name] = $value;
+ }
+ }
+}
+
+function settings2params(&$ini_settings)
+{
+ if (count($ini_settings)) {
+ $settings = '';
+ foreach($ini_settings as $name => $value) {
+ $value = addslashes($value);
+ $settings .= " -d \"$name=$value\"";
+ }
+ $ini_settings = $settings;
+ } else {
+ $ini_settings = '';
+ }
+}
+
/*
* Local variables:
* tab-width: 4