Lines Matching refs:module
2189 ZEND_API zend_result zend_startup_module_ex(zend_module_entry *module) /* {{{ */ in zend_startup_module_ex() argument
2194 if (module->module_started) { in zend_startup_module_ex()
2197 module->module_started = 1; in zend_startup_module_ex()
2200 if (module->deps) { in zend_startup_module_ex()
2201 const zend_module_dep *dep = module->deps; in zend_startup_module_ex()
2214 …"Cannot load module \"%s\" because required module \"%s\" is not loaded", module->name, dep->name); in zend_startup_module_ex()
2215 module->module_started = 0; in zend_startup_module_ex()
2225 if (module->globals_size) { in zend_startup_module_ex()
2227 …ts_allocate_id(module->globals_id_ptr, module->globals_size, (ts_allocate_ctor) module->globals_ct… in zend_startup_module_ex()
2229 if (module->globals_ctor) { in zend_startup_module_ex()
2230 module->globals_ctor(module->globals_ptr); in zend_startup_module_ex()
2234 if (module->module_startup_func) { in zend_startup_module_ex()
2235 EG(current_module) = module; in zend_startup_module_ex()
2236 if (module->module_startup_func(module->type, module->module_number)==FAILURE) { in zend_startup_module_ex()
2237 zend_error_noreturn(E_CORE_ERROR,"Unable to start %s module", module->name); in zend_startup_module_ex()
2249 zend_module_entry *module = Z_PTR_P(zv); in zend_startup_module_zval() local
2251 return (zend_startup_module_ex(module) == SUCCESS) ? ZEND_HASH_APPLY_KEEP : ZEND_HASH_APPLY_REMOVE; in zend_startup_module_zval()
2292 zend_module_entry *module; in zend_collect_module_handlers() local
2301 ZEND_HASH_MAP_FOREACH_PTR(&module_registry, module) { in zend_collect_module_handlers()
2302 if (module->request_startup_func) { in zend_collect_module_handlers()
2305 if (module->request_shutdown_func) { in zend_collect_module_handlers()
2308 if (module->post_deactivate_func) { in zend_collect_module_handlers()
2311 if (module->handle) { in zend_collect_module_handlers()
2331 ZEND_HASH_MAP_FOREACH_PTR(&module_registry, module) { in zend_collect_module_handlers()
2332 if (module->request_startup_func) { in zend_collect_module_handlers()
2333 module_request_startup_handlers[startup_count++] = module; in zend_collect_module_handlers()
2335 if (module->request_shutdown_func) { in zend_collect_module_handlers()
2336 module_request_shutdown_handlers[--shutdown_count] = module; in zend_collect_module_handlers()
2338 if (module->post_deactivate_func) { in zend_collect_module_handlers()
2339 module_post_deactivate_handlers[--post_deactivate_count] = module; in zend_collect_module_handlers()
2341 if (module->handle) { in zend_collect_module_handlers()
2342 modules_dl_loaded[--dl_loaded_count] = module; in zend_collect_module_handlers()
2388 ZEND_API zend_module_entry* zend_register_module_ex(zend_module_entry *module) /* {{{ */ in zend_register_module_ex() argument
2394 if (!module) { in zend_register_module_ex()
2399 zend_printf("%s: Registering module %d\n", module->name, module->module_number); in zend_register_module_ex()
2403 if (module->deps) { in zend_register_module_ex()
2404 const zend_module_dep *dep = module->deps; in zend_register_module_ex()
2415 … load module \"%s\" because conflicting module \"%s\" is already loaded", module->name, dep->name); in zend_register_module_ex()
2424 name_len = strlen(module->name); in zend_register_module_ex()
2425 lcname = zend_string_alloc(name_len, module->type == MODULE_PERSISTENT); in zend_register_module_ex()
2426 zend_str_tolower_copy(ZSTR_VAL(lcname), module->name, name_len); in zend_register_module_ex()
2429 if ((module_ptr = zend_hash_add_ptr(&module_registry, lcname, module)) == NULL) { in zend_register_module_ex()
2430 zend_error(E_CORE_WARNING, "Module \"%s\" is already loaded", module->name); in zend_register_module_ex()
2434 module = module_ptr; in zend_register_module_ex()
2435 EG(current_module) = module; in zend_register_module_ex()
2437 …if (module->functions && zend_register_functions(NULL, module->functions, NULL, module->type)==FAI… in zend_register_module_ex()
2441 zend_error(E_CORE_WARNING,"%s: Unable to register functions, unable to load", module->name); in zend_register_module_ex()
2447 return module; in zend_register_module_ex()
2451 ZEND_API zend_module_entry* zend_register_internal_module(zend_module_entry *module) /* {{{ */ in zend_register_internal_module() argument
2453 module->module_number = zend_next_free_module(); in zend_register_internal_module()
2454 module->type = MODULE_PERSISTENT; in zend_register_internal_module()
2455 return zend_register_module_ex(module); in zend_register_internal_module()
2720 internal_function->module = EG(current_module); in ZEND_END_ARG_INFO()
2982 ZEND_API zend_result zend_startup_module(zend_module_entry *module) /* {{{ */ in zend_startup_module() argument
2984 …if ((module = zend_register_internal_module(module)) != NULL && zend_startup_module_ex(module) == … in zend_startup_module()
2993 zend_module_entry *module; in zend_get_module_started() local
2995 module = zend_hash_str_find_ptr(&module_registry, module_name, strlen(module_name)); in zend_get_module_started()
2996 return (module && module->module_started) ? SUCCESS : FAILURE; in zend_get_module_started()
3004 if (ce->type == ZEND_INTERNAL_CLASS && ce->info.internal.module->module_number == module_number) { in clean_module_class()
3021 zend_module_entry *module = (zend_module_entry *) arg; in clean_module_function() local
3022 if (fe->common.type == ZEND_INTERNAL_FUNCTION && fe->internal_function.module == module) { in clean_module_function()
3030 static void clean_module_functions(zend_module_entry *module) /* {{{ */ in clean_module_functions() argument
3032 zend_hash_apply_with_argument(CG(function_table), clean_module_function, module); in clean_module_functions()
3036 void module_destructor(zend_module_entry *module) /* {{{ */ in module_destructor() argument
3042 if (module->type == MODULE_TEMPORARY) { in module_destructor()
3049 zend_clean_module_rsrc_dtors(module->module_number); in module_destructor()
3050 clean_module_constants(module->module_number); in module_destructor()
3051 clean_module_classes(module->module_number); in module_destructor()
3054 if (module->module_started && module->module_shutdown_func) { in module_destructor()
3056 zend_printf("%s: Module shutdown\n", module->name); in module_destructor()
3058 module->module_shutdown_func(module->type, module->module_number); in module_destructor()
3061 if (module->module_started in module_destructor()
3062 && !module->module_shutdown_func in module_destructor()
3063 && module->type == MODULE_TEMPORARY) { in module_destructor()
3064 zend_unregister_ini_entries_ex(module->module_number, module->type); in module_destructor()
3068 if (module->globals_size) { in module_destructor()
3070 if (*module->globals_id_ptr) { in module_destructor()
3071 ts_free_id(*module->globals_id_ptr); in module_destructor()
3074 if (module->globals_dtor) { in module_destructor()
3075 module->globals_dtor(module->globals_ptr); in module_destructor()
3080 module->module_started=0; in module_destructor()
3081 if (module->type == MODULE_TEMPORARY && module->functions) { in module_destructor()
3082 zend_unregister_functions(module->functions, -1, NULL); in module_destructor()
3084 clean_module_functions(module); in module_destructor()
3093 void module_registry_unload(const zend_module_entry *module) in module_registry_unload() argument
3097 DL_UNLOAD(module->handle); in module_registry_unload()
3100 ZEND_IGNORE_VALUE(module); in module_registry_unload()
3109 zend_module_entry *module = *p; in zend_activate_modules() local
3111 if (module->request_startup_func(module->type, module->module_number)==FAILURE) { in zend_activate_modules()
3112 zend_error(E_WARNING, "request_startup() for %s module failed", module->name); in zend_activate_modules()
3125 zend_module_entry *module; in zend_deactivate_modules() local
3127 ZEND_HASH_MAP_REVERSE_FOREACH_PTR(&module_registry, module) { in zend_deactivate_modules()
3128 if (module->request_shutdown_func) { in zend_deactivate_modules()
3130 module->request_shutdown_func(module->type, module->module_number); in zend_deactivate_modules()
3138 zend_module_entry *module = *p; in zend_deactivate_modules() local
3140 module->request_shutdown_func(module->type, module->module_number); in zend_deactivate_modules()
3163 zend_module_entry *module; in zend_post_deactivate_modules() local
3167 ZEND_HASH_MAP_FOREACH_PTR(&module_registry, module) { in zend_post_deactivate_modules()
3168 if (module->post_deactivate_func) { in zend_post_deactivate_modules()
3169 module->post_deactivate_func(); in zend_post_deactivate_modules()
3173 module = Z_PTR_P(zv); in zend_post_deactivate_modules()
3174 if (module->type != MODULE_TEMPORARY) { in zend_post_deactivate_modules()
3177 module_destructor(module); in zend_post_deactivate_modules()
3178 if (module->handle) { in zend_post_deactivate_modules()
3179 module_registry_unload(module); in zend_post_deactivate_modules()
3187 zend_module_entry *module = *p; in zend_post_deactivate_modules() local
3189 module->post_deactivate_func(); in zend_post_deactivate_modules()
3213 class_entry->info.internal.module = EG(current_module); in do_register_internal_class()
4188 zend_module_entry *module; in zend_get_module_version() local
4192 module = zend_hash_find_ptr(&module_registry, lname); in zend_get_module_version()
4194 return module ? module->version : NULL; in zend_get_module_version()
4200 && ce->info.internal.module->type == MODULE_PERSISTENT; in is_persistent_class()
4248 ce->info.internal.module->type == MODULE_PERSISTENT) { in zend_declare_typed_property()