zend handling of legacy .ini files
- Dominant language
- C++
- Stars
- 18.7k
- Forks
- 3.1k
- Avg merge
- 1h 47m
- Merged PRs (30d)
- 2
Description
I'm loading a zend extension as a DSO. I invoke hhvm something like:
hhvm --config devel.ini --config devel.hdf --config legacy.ini
where the devel.hdf file describes the location of the DSOs to load, including the DSO that contains the zend extension I'd expect to handle settings from legacy.ini.
The legacy zend handler for settings bound using PHP_INI_ENTRY_EX gets called 3 times! The first time uses the value read from legacy.ini; the 2nd time uses the default value from PHP_INI_ENTRY_EX binding; the 3rd time from a re-read of the legacy.ini file.
The legacy zend handler for settings bound using STD_PHP_INI_ENTRY_EX gets called only once, but only with the default value bound in STD_PHP_INI_ENTRY_EX, and not with the value from the legacy.ini file.
Needless to say, I expect the setter callback for each to be called exactly, once, and with values from the .ini file.
I have not tried building my zend extension statically into hhvm, eg, to not use a DSO.
Tim Starling writes (16Jun2014; I don't know which version of program-functions is being referenced):
It may be that configuration of DSOs generally is broken. I see that
configuration is loaded around line 1220 of program-functions.cpp, but
threadInit() and moduleInit() hooks are not called until
hphp_process_init(), which is called at around line 1310.
ZendExtension registers ini callbacks in moduleInit(), which is
apparently broken for any settings that use PHP_INI_USER or
PHP_INI_ALL, since IniSetting::Bind() puts PHP_INI_USER registrations
in a thread-local table. Non-EZC extensions register PHP_INI_USER
settings in threadInit() and PHP_INI_SYSTEM settings in moduleInit(),
and ZendExtension should do the same.
So, it looks like there's a fair bit of work to do in this area.
Contributor guide
Assessment
This issue has not been assessed yet.