mirror of
https://github.com/php/php-src.git
synced 2025-08-16 05:58:45 +02:00
More TSRMLS_FETCH work
This commit is contained in:
parent
3baef4690a
commit
e8ac55d03c
4 changed files with 22 additions and 16 deletions
|
@ -1103,14 +1103,14 @@ void module_destructor(zend_module_entry *module)
|
|||
zend_clean_module_rsrc_dtors(module->module_number);
|
||||
clean_module_constants(module->module_number);
|
||||
if (module->request_shutdown_func)
|
||||
module->request_shutdown_func(module->type, module->module_number);
|
||||
module->request_shutdown_func(module->type, module->module_number TSRMLS_CC);
|
||||
}
|
||||
|
||||
if (module->module_started && module->module_shutdown_func) {
|
||||
#if 0
|
||||
zend_printf("%s: Module shutdown\n",module->name);
|
||||
#endif
|
||||
module->module_shutdown_func(module->type, module->module_number);
|
||||
module->module_shutdown_func(module->type, module->module_number TSRMLS_CC);
|
||||
}
|
||||
module->module_started=0;
|
||||
if (module->functions) {
|
||||
|
@ -1148,13 +1148,15 @@ int module_registry_request_startup(zend_module_entry *module)
|
|||
*/
|
||||
int module_registry_cleanup(zend_module_entry *module)
|
||||
{
|
||||
TSRMLS_FETCH();
|
||||
|
||||
switch(module->type) {
|
||||
case MODULE_PERSISTENT:
|
||||
if (module->request_shutdown_func) {
|
||||
#if 0
|
||||
zend_printf("%s: Request shutdown\n",module->name);
|
||||
#endif
|
||||
module->request_shutdown_func(module->type, module->module_number);
|
||||
module->request_shutdown_func(module->type, module->module_number TSRMLS_CC);
|
||||
}
|
||||
return 0;
|
||||
break;
|
||||
|
|
|
@ -43,9 +43,11 @@ static int zend_remove_ini_entries(zend_ini_entry *ini_entry, int *module_number
|
|||
|
||||
static int zend_restore_ini_entry_cb(zend_ini_entry *ini_entry, int stage)
|
||||
{
|
||||
TSRMLS_FETCH();
|
||||
|
||||
if (ini_entry->modified) {
|
||||
if (ini_entry->on_modify) {
|
||||
ini_entry->on_modify(ini_entry, ini_entry->orig_value, ini_entry->orig_value_length, ini_entry->mh_arg1, ini_entry->mh_arg2, ini_entry->mh_arg3, stage);
|
||||
ini_entry->on_modify(ini_entry, ini_entry->orig_value, ini_entry->orig_value_length, ini_entry->mh_arg1, ini_entry->mh_arg2, ini_entry->mh_arg3, stage TSRMLS_CC);
|
||||
}
|
||||
efree(ini_entry->value);
|
||||
ini_entry->value = ini_entry->orig_value;
|
||||
|
@ -126,7 +128,7 @@ ZEND_API void zend_ini_sort_entries(TSRMLS_D)
|
|||
* Registration / unregistration
|
||||
*/
|
||||
|
||||
ZEND_API int zend_register_ini_entries(zend_ini_entry *ini_entry, int module_number)
|
||||
ZEND_API int zend_register_ini_entries(zend_ini_entry *ini_entry, int module_number TSRMLS_DC)
|
||||
{
|
||||
zend_ini_entry *p = ini_entry;
|
||||
zend_ini_entry *hashed_ini_entry;
|
||||
|
@ -140,13 +142,13 @@ ZEND_API int zend_register_ini_entries(zend_ini_entry *ini_entry, int module_num
|
|||
}
|
||||
if ((zend_get_configuration_directive(p->name, p->name_length, &default_value))==SUCCESS) {
|
||||
if (!hashed_ini_entry->on_modify
|
||||
|| hashed_ini_entry->on_modify(hashed_ini_entry, default_value.value.str.val, default_value.value.str.len, hashed_ini_entry->mh_arg1, hashed_ini_entry->mh_arg2, hashed_ini_entry->mh_arg3, ZEND_INI_STAGE_STARTUP)==SUCCESS) {
|
||||
|| hashed_ini_entry->on_modify(hashed_ini_entry, default_value.value.str.val, default_value.value.str.len, hashed_ini_entry->mh_arg1, hashed_ini_entry->mh_arg2, hashed_ini_entry->mh_arg3, ZEND_INI_STAGE_STARTUP TSRMLS_CC)==SUCCESS) {
|
||||
hashed_ini_entry->value = default_value.value.str.val;
|
||||
hashed_ini_entry->value_length = default_value.value.str.len;
|
||||
}
|
||||
} else {
|
||||
if (hashed_ini_entry->on_modify) {
|
||||
hashed_ini_entry->on_modify(hashed_ini_entry, hashed_ini_entry->value, hashed_ini_entry->value_length, hashed_ini_entry->mh_arg1, hashed_ini_entry->mh_arg2, hashed_ini_entry->mh_arg3, ZEND_INI_STAGE_STARTUP);
|
||||
hashed_ini_entry->on_modify(hashed_ini_entry, hashed_ini_entry->value, hashed_ini_entry->value_length, hashed_ini_entry->mh_arg1, hashed_ini_entry->mh_arg2, hashed_ini_entry->mh_arg3, ZEND_INI_STAGE_STARTUP TSRMLS_CC);
|
||||
}
|
||||
}
|
||||
p++;
|
||||
|
@ -163,8 +165,10 @@ ZEND_API void zend_unregister_ini_entries(int module_number)
|
|||
|
||||
static int zend_ini_refresh_cache(zend_ini_entry *p, int stage)
|
||||
{
|
||||
TSRMLS_FETCH();
|
||||
|
||||
if (p->on_modify) {
|
||||
p->on_modify(p, p->value, p->value_length, p->mh_arg1, p->mh_arg2, p->mh_arg3, stage);
|
||||
p->on_modify(p, p->value, p->value_length, p->mh_arg1, p->mh_arg2, p->mh_arg3, stage TSRMLS_CC);
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
@ -193,7 +197,7 @@ ZEND_API int zend_alter_ini_entry(char *name, uint name_length, char *new_value,
|
|||
duplicate = estrndup(new_value, new_value_length);
|
||||
|
||||
if (!ini_entry->on_modify
|
||||
|| ini_entry->on_modify(ini_entry, duplicate, new_value_length, ini_entry->mh_arg1, ini_entry->mh_arg2, ini_entry->mh_arg3, stage)==SUCCESS) {
|
||||
|| ini_entry->on_modify(ini_entry, duplicate, new_value_length, ini_entry->mh_arg1, ini_entry->mh_arg2, ini_entry->mh_arg3, stage TSRMLS_CC)==SUCCESS) {
|
||||
if (!ini_entry->modified) {
|
||||
ini_entry->orig_value = ini_entry->value;
|
||||
ini_entry->orig_value_length = ini_entry->value_length;
|
||||
|
|
|
@ -58,7 +58,7 @@
|
|||
|
||||
typedef struct _zend_ini_entry zend_ini_entry;
|
||||
|
||||
#define ZEND_INI_MH(name) int name(zend_ini_entry *entry, char *new_value, uint new_value_length, void *mh_arg1, void *mh_arg2, void *mh_arg3, int stage)
|
||||
#define ZEND_INI_MH(name) int name(zend_ini_entry *entry, char *new_value, uint new_value_length, void *mh_arg1, void *mh_arg2, void *mh_arg3, int stage TSRMLS_DC)
|
||||
#define ZEND_INI_DISP(name) void name(zend_ini_entry *ini_entry, int type)
|
||||
|
||||
struct _zend_ini_entry {
|
||||
|
@ -90,7 +90,7 @@ ZEND_API int zend_copy_ini_directives(TSRMLS_D);
|
|||
|
||||
ZEND_API void zend_ini_sort_entries(TSRMLS_D);
|
||||
|
||||
ZEND_API int zend_register_ini_entries(zend_ini_entry *ini_entry, int module_number);
|
||||
ZEND_API int zend_register_ini_entries(zend_ini_entry *ini_entry, int module_number TSRMLS_DC);
|
||||
ZEND_API void zend_unregister_ini_entries(int module_number);
|
||||
ZEND_API void zend_ini_refresh_caches(int stage TSRMLS_DC);
|
||||
ZEND_API int zend_alter_ini_entry(char *name, uint name_length, char *new_value, uint new_value_length, int modify_type, int stage);
|
||||
|
@ -162,7 +162,7 @@ ZEND_API ZEND_INI_DISP(display_link_numbers);
|
|||
#define INI_ORIG_BOOL(name) ((zend_bool) INI_ORIG_INT(name))
|
||||
|
||||
|
||||
#define REGISTER_INI_ENTRIES() zend_register_ini_entries(ini_entries, module_number)
|
||||
#define REGISTER_INI_ENTRIES() zend_register_ini_entries(ini_entries, module_number TSRMLS_CC)
|
||||
#define UNREGISTER_INI_ENTRIES() zend_unregister_ini_entries(module_number)
|
||||
#define DISPLAY_INI_ENTRIES() display_ini_entries(zend_module)
|
||||
|
||||
|
|
|
@ -25,10 +25,10 @@
|
|||
|
||||
#define INIT_FUNC_ARGS int type, int module_number TSRMLS_DC
|
||||
#define INIT_FUNC_ARGS_PASSTHRU type, module_number TSRMLS_CC
|
||||
#define SHUTDOWN_FUNC_ARGS int type, int module_number
|
||||
#define SHUTDOWN_FUNC_ARGS_PASSTHRU type, module_number
|
||||
#define ZEND_MODULE_INFO_FUNC_ARGS zend_module_entry *zend_module
|
||||
#define ZEND_MODULE_INFO_FUNC_ARGS_PASSTHRU zend_module
|
||||
#define SHUTDOWN_FUNC_ARGS int type, int module_number TSRMLS_DC
|
||||
#define SHUTDOWN_FUNC_ARGS_PASSTHRU type, module_number TSRMLS_CC
|
||||
#define ZEND_MODULE_INFO_FUNC_ARGS zend_module_entry *zend_module TSRMLS_DC
|
||||
#define ZEND_MODULE_INFO_FUNC_ARGS_PASSTHRU zend_module TSRMLS_CC
|
||||
#define GINIT_FUNC_ARGS void
|
||||
#define GINIT_FUNC_ARGS_PASSTHRU
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue