X-Git-Url: https://git.m6w6.name/?a=blobdiff_plain;f=php_raphf.c;h=e2ff95c232c39aa239297651546db6e52a772894;hb=8ab1490ec9debc23bf85c8b7fd494d05b1abdeaa;hp=f9f354a2cd8503a49f2feaeec80bbc05922aec97;hpb=f706105e1df56286cfeff86c5264270a758fa8f9;p=m6w6%2Fext-raphf diff --git a/php_raphf.c b/php_raphf.c index f9f354a..e2ff95c 100644 --- a/php_raphf.c +++ b/php_raphf.c @@ -564,7 +564,7 @@ PHP_INI_END() static HashTable *php_persistent_handles_global_hash; -static void php_raphf_globals_init(zend_raphf_globals *raphf_globals) +static PHP_GINIT_FUNCTION(raphf) { raphf_globals->persistent_handle.limit = -1; @@ -577,17 +577,14 @@ static void php_raphf_globals_init(zend_raphf_globals *raphf_globals) } } -static void php_raphf_globals_dtor(zend_raphf_globals *raphf_globals) +static PHP_GSHUTDOWN_FUNCTION(raphf) { zend_hash_destroy(&raphf_globals->persistent_handle.hash); } PHP_MINIT_FUNCTION(raphf) { - ZEND_INIT_MODULE_GLOBALS(raphf, php_raphf_globals_init, - php_raphf_globals_dtor); php_persistent_handles_global_hash = &PHP_RAPHF_G->persistent_handle.hash; - REGISTER_INI_ENTRIES(); return SUCCESS; } @@ -595,6 +592,7 @@ PHP_MINIT_FUNCTION(raphf) PHP_MSHUTDOWN_FUNCTION(raphf) { UNREGISTER_INI_ENTRIES(); + php_persistent_handles_global_hash = NULL; return SUCCESS; } @@ -659,7 +657,11 @@ zend_module_entry raphf_module_entry = { NULL, PHP_MINFO(raphf), PHP_RAPHF_VERSION, - STANDARD_MODULE_PROPERTIES + ZEND_MODULE_GLOBALS(raphf), + PHP_GINIT(raphf), + PHP_GSHUTDOWN(raphf), + NULL, + STANDARD_MODULE_PROPERTIES_EX }; /* }}} */