Bug #73124 [Opn]: php_ini_scanned_files() not reporting correctly
Edit report at https://bugs.php.net/bug.php?id=73124&edit=1
ID: 73124
User updated by: john-stevenson at blueyonder dot co dot uk
Reported by: john-stevenson at blueyonder dot co dot uk
Summary: php_ini_scanned_files() not reporting correctly
Status: Open
Type: Bug
Package: *Configuration Issues
Operating System: Windows 10
PHP Version: 5.6.26
Block user comment: N
Private report: N
New Comment:
Fixed: https://github.com/php/php-src/pull/2921
Previous Comments:
------------------------------------------------------------------------
[2016-09-20 11:01:16] john-stevenson at blueyonder dot co dot uk
Description:
------------
When PHP has not been compiled using the --with-config-file-scan-dir option, php_ini_scanned_files()
does not report additional ini files that have been scanned via the PHP_INI_SCAN_DIR environment
variable .
However the correct information is shown when running php --ini
I realize that this is an edge-case, but PHP_INI_SCAN_DIR is used regardless of the compile option
in php_init_config():
https://github.com/php/php-src/blob/1c295d4a9ac78fcc2f77d6695987598bb7abcb83/main/php_ini.c#L609
Whereas in php_ini_scanned_files() this option is required for the data to reported (even though the
data exists):
https://github.com/php/php-src/blob/fcc6f2df5986bb9615a658cc717b1a92922462d2/ext/standard/info.c#L1388
Test script:
---------------
Using a Windows build (so no --with-config-file-scan-dir) create a file named "date.ini"
somewhere containing the line:
date.timezone = Antarctica/McMurdo
Now run the following:
set PHP_INI_SCAN_DIR=path\to\somewhere
php -r "var_dump(php_ini_scanned_files());var_dump(ini_get('date.timezone'));"
Expected result:
----------------
Command line code:1:
string(???) "path\to\somewhere\date.ini"
Command line code:1:
string(18) "Antarctica/McMurdo"
Actual result:
--------------
Command line code:1:
bool(false)
Command line code:1:
string(18) "Antarctica/McMurdo"
------------------------------------------------------------------------
--
Edit this bug report at https://bugs.php.net/bug.php?id=73124&edit=1
Thread (3 messages)