com php-src: Add {TMP} placeholder for PHPT INI sections: run-tests.php

From: Date: Wed, 08 May 2019 17:21:38 +0000
Subject: com php-src: Add {TMP} placeholder for PHPT INI sections: run-tests.php
Groups: php.cvs 
Request: Send a blank email to php-cvs+get-106079@lists.php.net to get a copy of this message
Commit: 3d0a0f801b6eb0ec7d4fdee119b339d2dab9771f Author: Christoph M. Becker <cmbecker69@gmx.de> Wed, 8 May 2019 17:54:02 +0200 Parents: d19b6aa5ba6ea7b488cca748934264e11469f3d5 Branches: PHP-7.2 PHP-7.3 PHP-7.4 master Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=3d0a0f801b6eb0ec7d4fdee119b339d2dab9771f Log: 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. Changed paths: M run-tests.php Diff: diff --git a/run-tests.php b/run-tests.php index 2801959..1e07509 100755 --- a/run-tests.php +++ b/run-tests.php @@ -1604,9 +1604,8 @@ TEST $file // 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); }

« previous php.cvs (#106079) next »