From 3d0a0f801b6eb0ec7d4fdee119b339d2dab9771f Mon Sep 17 00:00:00 2001 From: "Christoph M. Becker" Date: Wed, 8 May 2019 17:54:02 +0200 Subject: [PATCH] Add {TMP} placeholder for PHPT INI sections Several tests use `/tmp` in the `--INI--` section, but this is not portable. We therefore introduce the `{TMP}` placeholder which evaluates to the system's temporary directory using `sys_get_temp_dir()`. We also remove the doubtful `strpos()` optimization. --- run-tests.php | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/run-tests.php b/run-tests.php index 2801959f10f4e..1e07509506084 100755 --- a/run-tests.php +++ b/run-tests.php @@ -1604,9 +1604,8 @@ function run_test($php, $file, $env) // Any special ini settings // these may overwrite the test defaults... if (array_key_exists('INI', $section_text)) { - if (strpos($section_text['INI'], '{PWD}') !== false) { - $section_text['INI'] = str_replace('{PWD}', dirname($file), $section_text['INI']); - } + $section_text['INI'] = str_replace('{PWD}', dirname($file), $section_text['INI']); + $section_text['INI'] = str_replace('{TMP}', sys_get_temp_dir(), $section_text['INI']); settings2array(preg_split( "/[\n\r]+/", $section_text['INI']), $ini_settings); }