+++ /dev/null
---TEST--
-Bug #73124 (php_ini_scanned_files relied on PHP_CONFIG_FILE_SCAN_DIR)
---SKIPIF--
-<?php
-if (!empty(PHP_CONFIG_FILE_SCAN_DIR)) die("Skip: PHP_CONFIG_FILE_SCAN_DIR must not be available");
-?>
---FILE--
-<?php
- $tempDir = sys_get_temp_dir();
- putenv('PHP_INI_SCAN_DIR='.$tempDir);
-
- $inifile = $tempDir.DIRECTORY_SEPARATOR.'scan-dir.ini';
- @unlink($inifile);
- file_put_contents($inifile, "\n");
-
- $php = getenv('TEST_PHP_EXECUTABLE');
- passthru('"'.$php.'" -r "print_r(php_ini_scanned_files());"');
-
- putenv('PHP_INI_SCAN_DIR=');
- @unlink($inifile);
-?>
---EXPECTREGEX--
-.*[\/\\]scan-dir\.ini.*|.*[\/\\]scan-dir\.ini
-Done
--- /dev/null
+date.timezone = UTC
--- /dev/null
+--TEST--
+php_ini_loaded_file() function
+--FILE--
+<?php
+ $inifile = __DIR__.DIRECTORY_SEPARATOR.'loaded.ini';
+ $php = '"'.getenv('TEST_PHP_EXECUTABLE').'"';
+ $code = '"var_dump(php_ini_loaded_file());"';
+
+ // No ini file
+ passthru($php.' -n -r '.$code);
+
+ // Specified ini file
+ passthru($php.' -c "'.$inifile.'" -r '.$code);
+?>
+--EXPECTREGEX--
+bool\(false\)
+string\(\d+\) ".*[\/\\]loaded\.ini"
--- /dev/null
+--TEST--
+php_ini_scanned_files() function
+--FILE--
+<?php
+ $inifile = __DIR__.DIRECTORY_SEPARATOR.'loaded.ini';
+ $php = sprintf('"%s" -c "%s"', getenv('TEST_PHP_EXECUTABLE'), $inifile);
+ $scandir = __DIR__.DIRECTORY_SEPARATOR.'scandir';
+
+ // Empty env value disables any config option
+ putenv('PHP_INI_SCAN_DIR=');
+ passthru($php.' -r "var_dump(php_ini_scanned_files());"');
+
+ // Env value without path separator overrides any config option
+ putenv('PHP_INI_SCAN_DIR='.$scandir);
+ passthru($php.' -r "var_dump(php_ini_scanned_files());"');
+
+ // Scanned ini values override previously loaded values
+ passthru($php.' -r "var_dump(ini_get(\'date.timezone\'));"');
+?>
+--EXPECTREGEX--
+bool\(false\)
+string\(\d+\) ".*[\/\\]0\.ini
+"
+string\(\d+\) "Antarctica\/McMurdo"
--- /dev/null
+; This file is named 0.ini so it should be the first line of
+; any scanned ini output
+
+date.timezone = Antarctica/McMurdo
\ No newline at end of file
+++ /dev/null
---TEST--
-Check the php_ini_loaded_file() function
---CREDITS--
-Sebastian Schürmann
-sschuermann@chip.de
-Testfest 2009 Munich
---INI--
-precision=12
---FILE--
-<?php
-var_dump(php_ini_loaded_file());
-?>
---EXPECTREGEX--
-string\(\d+\) ".*php\.ini"|bool\(false\)