Lines Matching refs:module
1796 ZEND_API int zend_startup_module_ex(zend_module_entry *module) /* {{{ */ in zend_startup_module_ex() argument
1801 if (module->module_started) { in zend_startup_module_ex()
1804 module->module_started = 1; in zend_startup_module_ex()
1807 if (module->deps) { in zend_startup_module_ex()
1808 const zend_module_dep *dep = module->deps; in zend_startup_module_ex()
1821 …NG, "Cannot load module '%s' because required module '%s' is not loaded", module->name, dep->name); in zend_startup_module_ex()
1822 module->module_started = 0; in zend_startup_module_ex()
1832 if (module->globals_size) { in zend_startup_module_ex()
1834 …ts_allocate_id(module->globals_id_ptr, module->globals_size, (ts_allocate_ctor) module->globals_ct… in zend_startup_module_ex()
1836 if (module->globals_ctor) { in zend_startup_module_ex()
1837 module->globals_ctor(module->globals_ptr); in zend_startup_module_ex()
1841 if (module->module_startup_func) { in zend_startup_module_ex()
1842 EG(current_module) = module; in zend_startup_module_ex()
1843 if (module->module_startup_func(module->type, module->module_number)==FAILURE) { in zend_startup_module_ex()
1844 zend_error_noreturn(E_CORE_ERROR,"Unable to start %s module", module->name); in zend_startup_module_ex()
1856 zend_module_entry *module = Z_PTR_P(zv); in zend_startup_module_zval() local
1858 return (zend_startup_module_ex(module) == SUCCESS) ? ZEND_HASH_APPLY_KEEP : ZEND_HASH_APPLY_REMOVE; in zend_startup_module_zval()
1899 zend_module_entry *module; in zend_collect_module_handlers() local
1907 ZEND_HASH_FOREACH_PTR(&module_registry, module) { in zend_collect_module_handlers()
1908 if (module->request_startup_func) { in zend_collect_module_handlers()
1911 if (module->request_shutdown_func) { in zend_collect_module_handlers()
1914 if (module->post_deactivate_func) { in zend_collect_module_handlers()
1930 ZEND_HASH_FOREACH_PTR(&module_registry, module) { in zend_collect_module_handlers()
1931 if (module->request_startup_func) { in zend_collect_module_handlers()
1932 module_request_startup_handlers[startup_count++] = module; in zend_collect_module_handlers()
1934 if (module->request_shutdown_func) { in zend_collect_module_handlers()
1935 module_request_shutdown_handlers[--shutdown_count] = module; in zend_collect_module_handlers()
1937 if (module->post_deactivate_func) { in zend_collect_module_handlers()
1938 module_post_deactivate_handlers[--post_deactivate_count] = module; in zend_collect_module_handlers()
1982 ZEND_API zend_module_entry* zend_register_module_ex(zend_module_entry *module) /* {{{ */ in zend_register_module_ex() argument
1988 if (!module) { in zend_register_module_ex()
1993 zend_printf("%s: Registering module %d\n", module->name, module->module_number); in zend_register_module_ex()
1997 if (module->deps) { in zend_register_module_ex()
1998 const zend_module_dep *dep = module->deps; in zend_register_module_ex()
2009 …nnot load module '%s' because conflicting module '%s' is already loaded", module->name, dep->name); in zend_register_module_ex()
2018 name_len = strlen(module->name); in zend_register_module_ex()
2020 zend_str_tolower_copy(ZSTR_VAL(lcname), module->name, name_len); in zend_register_module_ex()
2022 …if ((module_ptr = zend_hash_add_mem(&module_registry, lcname, module, sizeof(zend_module_entry))) … in zend_register_module_ex()
2023 zend_error(E_CORE_WARNING, "Module '%s' already loaded", module->name); in zend_register_module_ex()
2027 module = module_ptr; in zend_register_module_ex()
2028 EG(current_module) = module; in zend_register_module_ex()
2030 …if (module->functions && zend_register_functions(NULL, module->functions, NULL, module->type)==FAI… in zend_register_module_ex()
2034 zend_error(E_CORE_WARNING,"%s: Unable to register functions, unable to load", module->name); in zend_register_module_ex()
2040 return module; in zend_register_module_ex()
2044 ZEND_API zend_module_entry* zend_register_internal_module(zend_module_entry *module) /* {{{ */ in zend_register_internal_module() argument
2046 module->module_number = zend_next_free_module(); in zend_register_internal_module()
2047 module->type = MODULE_PERSISTENT; in zend_register_internal_module()
2048 return zend_register_module_ex(module); in zend_register_internal_module()
2141 internal_function->module = EG(current_module); in zend_register_functions()
2452 ZEND_API int zend_startup_module(zend_module_entry *module) /* {{{ */ in zend_startup_module() argument
2454 …if ((module = zend_register_internal_module(module)) != NULL && zend_startup_module_ex(module) == … in zend_startup_module()
2463 zend_module_entry *module; in zend_get_module_started() local
2465 module = zend_hash_str_find_ptr(&module_registry, module_name, strlen(module_name)); in zend_get_module_started()
2466 return (module && module->module_started) ? SUCCESS : FAILURE; in zend_get_module_started()
2474 if (ce->type == ZEND_INTERNAL_CLASS && ce->info.internal.module->module_number == module_number) { in clean_module_class()
2488 void module_destructor(zend_module_entry *module) /* {{{ */ in module_destructor() argument
2491 if (module->type == MODULE_TEMPORARY) { in module_destructor()
2492 zend_clean_module_rsrc_dtors(module->module_number); in module_destructor()
2493 clean_module_constants(module->module_number); in module_destructor()
2494 clean_module_classes(module->module_number); in module_destructor()
2497 if (module->module_started && module->module_shutdown_func) { in module_destructor()
2499 zend_printf("%s: Module shutdown\n", module->name); in module_destructor()
2501 module->module_shutdown_func(module->type, module->module_number); in module_destructor()
2505 if (module->globals_size) { in module_destructor()
2507 if (*module->globals_id_ptr) { in module_destructor()
2508 ts_free_id(*module->globals_id_ptr); in module_destructor()
2511 if (module->globals_dtor) { in module_destructor()
2512 module->globals_dtor(module->globals_ptr); in module_destructor()
2517 module->module_started=0; in module_destructor()
2518 if (module->functions) { in module_destructor()
2519 zend_unregister_functions(module->functions, -1, NULL); in module_destructor()
2524 if (module->handle && !getenv("ZEND_DONT_UNLOAD_MODULES")) { in module_destructor()
2525 DL_UNLOAD(module->handle); in module_destructor()
2537 zend_module_entry *module = *p; in zend_activate_modules() local
2539 if (module->request_startup_func(module->type, module->module_number)==FAILURE) { in zend_activate_modules()
2540 zend_error(E_WARNING, "request_startup() for %s module failed", module->name); in zend_activate_modules()
2551 zend_module_entry *module = Z_PTR_P(zv); in module_registry_cleanup() local
2553 if (module->request_shutdown_func) { in module_registry_cleanup()
2555 zend_printf("%s: Request shutdown\n", module->name); in module_registry_cleanup()
2557 module->request_shutdown_func(module->type, module->module_number); in module_registry_cleanup()
2574 zend_module_entry *module = *p; in zend_deactivate_modules() local
2576 module->request_shutdown_func(module->type, module->module_number); in zend_deactivate_modules()
2595 int module_registry_unload_temp(const zend_module_entry *module) /* {{{ */ in module_registry_unload_temp() argument
2597 return (module->type == MODULE_TEMPORARY) ? ZEND_HASH_APPLY_REMOVE : ZEND_HASH_APPLY_STOP; in module_registry_unload_temp()
2603 zend_module_entry *module = (zend_module_entry *)Z_PTR_P(el); in module_registry_unload_temp_wrapper() local
2604 return module_registry_unload_temp((const zend_module_entry *)module); in module_registry_unload_temp_wrapper()
2610 zend_module_entry *module = (zend_module_entry *)Z_PTR_P(el); in exec_done_cb() local
2611 if (module->post_deactivate_func) { in exec_done_cb()
2612 module->post_deactivate_func(); in exec_done_cb()
2627 zend_module_entry *module = *p; in zend_post_deactivate_modules() local
2629 module->post_deactivate_func(); in zend_post_deactivate_modules()
2652 class_entry->info.internal.module = EG(current_module); in do_register_internal_class()
3603 zend_module_entry *module; in zend_get_module_version() local
3607 module = zend_hash_find_ptr(&module_registry, lname); in zend_get_module_version()
3609 return module ? module->version : NULL; in zend_get_module_version()