mirror of
https://github.com/php/php-src.git
synced 2025-08-15 21:48:51 +02:00
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.
This commit is contained in:
parent
d19b6aa5ba
commit
3d0a0f801b
1 changed files with 2 additions and 3 deletions
|
@ -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);
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue