Lines Matching refs:module
1800 ZEND_API int zend_startup_module_ex(zend_module_entry *module) /* {{{ */ in zend_startup_module_ex() argument
1805 if (module->module_started) { in zend_startup_module_ex()
1808 module->module_started = 1; in zend_startup_module_ex()
1811 if (module->deps) { in zend_startup_module_ex()
1812 const zend_module_dep *dep = module->deps; in zend_startup_module_ex()
1825 …NG, "Cannot load module '%s' because required module '%s' is not loaded", module->name, dep->name); in zend_startup_module_ex()
1826 module->module_started = 0; in zend_startup_module_ex()
1836 if (module->globals_size) { in zend_startup_module_ex()
1838 …ts_allocate_id(module->globals_id_ptr, module->globals_size, (ts_allocate_ctor) module->globals_ct… in zend_startup_module_ex()
1840 if (module->globals_ctor) { in zend_startup_module_ex()
1841 module->globals_ctor(module->globals_ptr); in zend_startup_module_ex()
1845 if (module->module_startup_func) { in zend_startup_module_ex()
1846 EG(current_module) = module; in zend_startup_module_ex()
1847 if (module->module_startup_func(module->type, module->module_number)==FAILURE) { in zend_startup_module_ex()
1848 zend_error_noreturn(E_CORE_ERROR,"Unable to start %s module", module->name); in zend_startup_module_ex()
1860 zend_module_entry *module = Z_PTR_P(zv); in zend_startup_module_zval() local
1862 return (zend_startup_module_ex(module) == SUCCESS) ? ZEND_HASH_APPLY_KEEP : ZEND_HASH_APPLY_REMOVE; in zend_startup_module_zval()
1903 zend_module_entry *module; in zend_collect_module_handlers() local
1911 ZEND_HASH_FOREACH_PTR(&module_registry, module) { in zend_collect_module_handlers()
1912 if (module->request_startup_func) { in zend_collect_module_handlers()
1915 if (module->request_shutdown_func) { in zend_collect_module_handlers()
1918 if (module->post_deactivate_func) { in zend_collect_module_handlers()
1934 ZEND_HASH_FOREACH_PTR(&module_registry, module) { in zend_collect_module_handlers()
1935 if (module->request_startup_func) { in zend_collect_module_handlers()
1936 module_request_startup_handlers[startup_count++] = module; in zend_collect_module_handlers()
1938 if (module->request_shutdown_func) { in zend_collect_module_handlers()
1939 module_request_shutdown_handlers[--shutdown_count] = module; in zend_collect_module_handlers()
1941 if (module->post_deactivate_func) { in zend_collect_module_handlers()
1942 module_post_deactivate_handlers[--post_deactivate_count] = module; in zend_collect_module_handlers()
1986 ZEND_API zend_module_entry* zend_register_module_ex(zend_module_entry *module) /* {{{ */ in zend_register_module_ex() argument
1992 if (!module) { in zend_register_module_ex()
1997 zend_printf("%s: Registering module %d\n", module->name, module->module_number); in zend_register_module_ex()
2001 if (module->deps) { in zend_register_module_ex()
2002 const zend_module_dep *dep = module->deps; in zend_register_module_ex()
2013 …nnot load module '%s' because conflicting module '%s' is already loaded", module->name, dep->name); in zend_register_module_ex()
2022 name_len = strlen(module->name); in zend_register_module_ex()
2024 zend_str_tolower_copy(ZSTR_VAL(lcname), module->name, name_len); in zend_register_module_ex()
2026 …if ((module_ptr = zend_hash_add_mem(&module_registry, lcname, module, sizeof(zend_module_entry))) … in zend_register_module_ex()
2027 zend_error(E_CORE_WARNING, "Module '%s' already loaded", module->name); in zend_register_module_ex()
2031 module = module_ptr; in zend_register_module_ex()
2032 EG(current_module) = module; in zend_register_module_ex()
2034 …if (module->functions && zend_register_functions(NULL, module->functions, NULL, module->type)==FAI… in zend_register_module_ex()
2038 zend_error(E_CORE_WARNING,"%s: Unable to register functions, unable to load", module->name); in zend_register_module_ex()
2044 return module; in zend_register_module_ex()
2048 ZEND_API zend_module_entry* zend_register_internal_module(zend_module_entry *module) /* {{{ */ in zend_register_internal_module() argument
2050 module->module_number = zend_next_free_module(); in zend_register_internal_module()
2051 module->type = MODULE_PERSISTENT; in zend_register_internal_module()
2052 return zend_register_module_ex(module); in zend_register_internal_module()
2145 internal_function->module = EG(current_module); in zend_register_functions()
2456 ZEND_API int zend_startup_module(zend_module_entry *module) /* {{{ */ in zend_startup_module() argument
2458 …if ((module = zend_register_internal_module(module)) != NULL && zend_startup_module_ex(module) == … in zend_startup_module()
2467 zend_module_entry *module; in zend_get_module_started() local
2469 module = zend_hash_str_find_ptr(&module_registry, module_name, strlen(module_name)); in zend_get_module_started()
2470 return (module && module->module_started) ? SUCCESS : FAILURE; in zend_get_module_started()
2478 if (ce->type == ZEND_INTERNAL_CLASS && ce->info.internal.module->module_number == module_number) { in clean_module_class()
2492 void module_destructor(zend_module_entry *module) /* {{{ */ in module_destructor() argument
2495 if (module->type == MODULE_TEMPORARY) { in module_destructor()
2496 zend_clean_module_rsrc_dtors(module->module_number); in module_destructor()
2497 clean_module_constants(module->module_number); in module_destructor()
2498 clean_module_classes(module->module_number); in module_destructor()
2501 if (module->module_started && module->module_shutdown_func) { in module_destructor()
2503 zend_printf("%s: Module shutdown\n", module->name); in module_destructor()
2505 module->module_shutdown_func(module->type, module->module_number); in module_destructor()
2509 if (module->globals_size) { in module_destructor()
2511 if (*module->globals_id_ptr) { in module_destructor()
2512 ts_free_id(*module->globals_id_ptr); in module_destructor()
2515 if (module->globals_dtor) { in module_destructor()
2516 module->globals_dtor(module->globals_ptr); in module_destructor()
2521 module->module_started=0; in module_destructor()
2522 if (module->functions) { in module_destructor()
2523 zend_unregister_functions(module->functions, -1, NULL); in module_destructor()
2528 if (module->handle && !getenv("ZEND_DONT_UNLOAD_MODULES")) { in module_destructor()
2529 DL_UNLOAD(module->handle); in module_destructor()
2541 zend_module_entry *module = *p; in zend_activate_modules() local
2543 if (module->request_startup_func(module->type, module->module_number)==FAILURE) { in zend_activate_modules()
2544 zend_error(E_WARNING, "request_startup() for %s module failed", module->name); in zend_activate_modules()
2555 zend_module_entry *module = Z_PTR_P(zv); in module_registry_cleanup() local
2557 if (module->request_shutdown_func) { in module_registry_cleanup()
2559 zend_printf("%s: Request shutdown\n", module->name); in module_registry_cleanup()
2561 module->request_shutdown_func(module->type, module->module_number); in module_registry_cleanup()
2578 zend_module_entry *module = *p; in zend_deactivate_modules() local
2580 module->request_shutdown_func(module->type, module->module_number); in zend_deactivate_modules()
2599 int module_registry_unload_temp(const zend_module_entry *module) /* {{{ */ in module_registry_unload_temp() argument
2601 return (module->type == MODULE_TEMPORARY) ? ZEND_HASH_APPLY_REMOVE : ZEND_HASH_APPLY_STOP; in module_registry_unload_temp()
2607 zend_module_entry *module = (zend_module_entry *)Z_PTR_P(el); in module_registry_unload_temp_wrapper() local
2608 return module_registry_unload_temp((const zend_module_entry *)module); in module_registry_unload_temp_wrapper()
2614 zend_module_entry *module = (zend_module_entry *)Z_PTR_P(el); in exec_done_cb() local
2615 if (module->post_deactivate_func) { in exec_done_cb()
2616 module->post_deactivate_func(); in exec_done_cb()
2631 zend_module_entry *module = *p; in zend_post_deactivate_modules() local
2633 module->post_deactivate_func(); in zend_post_deactivate_modules()
2656 class_entry->info.internal.module = EG(current_module); in do_register_internal_class()
3601 zend_module_entry *module; in zend_get_module_version() local
3605 module = zend_hash_find_ptr(&module_registry, lname); in zend_get_module_version()
3607 return module ? module->version : NULL; in zend_get_module_version()