diff options
Diffstat (limited to 'zend/extensionimpl.cpp')
-rw-r--r-- | zend/extensionimpl.cpp | 22 |
1 files changed, 19 insertions, 3 deletions
diff --git a/zend/extensionimpl.cpp b/zend/extensionimpl.cpp index b1ec6e8..0308c63 100644 --- a/zend/extensionimpl.cpp +++ b/zend/extensionimpl.cpp @@ -110,10 +110,20 @@ int ExtensionImpl::processStartup(int type, int module_number TSRMLS_DC) { // initialize and allocate the "global" variables ZEND_INIT_MODULE_GLOBALS(phpcpp, init_globals, NULL); - + + // get the extension auto *extension = find(module_number TSRMLS_CC); + + // array contains ini settings + static zend_ini_entry *ini_entries = new zend_ini_entry[ extension->_data->ini_size()+1 ]; + + // Filling ini entries + extension->_data->fill_ini(ini_entries, module_number); + // register ini entries in Zend core + REGISTER_INI_ENTRIES(); + // initialize the extension extension->initialize(TSRMLS_C); @@ -135,7 +145,13 @@ int ExtensionImpl::processShutdown(int type, int module_number TSRMLS_DC) { // get the extension auto *extension = find(module_number TSRMLS_CC); - + + + UNREGISTER_INI_ENTRIES(); + // free memory from array ini entries + static zend_ini_entry *ini_entries; + delete [] ini_entries; + // is the callback registered? if (extension->_onShutdown) extension->_onShutdown(); @@ -197,7 +213,7 @@ ExtensionImpl::ExtensionImpl(Extension *data, const char *name, const char *vers _entry.zend_api = ZEND_MODULE_API_NO; // api number _entry.zend_debug = ZEND_DEBUG; // debug mode enabled? _entry.zts = USING_ZTS; // is thread safety enabled? - _entry.ini_entry = NULL; // the php.ini record + _entry.ini_entry = NULL; // the php.ini record, will be filled by Zend engine _entry.deps = NULL; // dependencies on other modules _entry.name = name; // extension name _entry.functions = NULL; // functions supported by this module (none for now) |