Lines Matching refs:module
1827 ZEND_API zend_result zend_startup_module_ex(zend_module_entry *module) /* {{{ */ in zend_startup_module_ex() argument
1832 if (module->module_started) { in zend_startup_module_ex()
1835 module->module_started = 1; in zend_startup_module_ex()
1838 if (module->deps) { in zend_startup_module_ex()
1839 const zend_module_dep *dep = module->deps; in zend_startup_module_ex()
1852 …"Cannot load module \"%s\" because required module \"%s\" is not loaded", module->name, dep->name); in zend_startup_module_ex()
1853 module->module_started = 0; in zend_startup_module_ex()
1863 if (module->globals_size) { in zend_startup_module_ex()
1865 …ts_allocate_id(module->globals_id_ptr, module->globals_size, (ts_allocate_ctor) module->globals_ct… in zend_startup_module_ex()
1867 if (module->globals_ctor) { in zend_startup_module_ex()
1868 module->globals_ctor(module->globals_ptr); in zend_startup_module_ex()
1872 if (module->module_startup_func) { in zend_startup_module_ex()
1873 EG(current_module) = module; in zend_startup_module_ex()
1874 if (module->module_startup_func(module->type, module->module_number)==FAILURE) { in zend_startup_module_ex()
1875 zend_error_noreturn(E_CORE_ERROR,"Unable to start %s module", module->name); in zend_startup_module_ex()
1887 zend_module_entry *module = Z_PTR_P(zv); in zend_startup_module_zval() local
1889 return (zend_startup_module_ex(module) == SUCCESS) ? ZEND_HASH_APPLY_KEEP : ZEND_HASH_APPLY_REMOVE; in zend_startup_module_zval()
1930 zend_module_entry *module; in zend_collect_module_handlers() local
1938 ZEND_HASH_FOREACH_PTR(&module_registry, module) { in zend_collect_module_handlers()
1939 if (module->request_startup_func) { in zend_collect_module_handlers()
1942 if (module->request_shutdown_func) { in zend_collect_module_handlers()
1945 if (module->post_deactivate_func) { in zend_collect_module_handlers()
1961 ZEND_HASH_FOREACH_PTR(&module_registry, module) { in zend_collect_module_handlers()
1962 if (module->request_startup_func) { in zend_collect_module_handlers()
1963 module_request_startup_handlers[startup_count++] = module; in zend_collect_module_handlers()
1965 if (module->request_shutdown_func) { in zend_collect_module_handlers()
1966 module_request_shutdown_handlers[--shutdown_count] = module; in zend_collect_module_handlers()
1968 if (module->post_deactivate_func) { in zend_collect_module_handlers()
1969 module_post_deactivate_handlers[--post_deactivate_count] = module; in zend_collect_module_handlers()
2012 ZEND_API zend_module_entry* zend_register_module_ex(zend_module_entry *module) /* {{{ */ in zend_register_module_ex() argument
2018 if (!module) { in zend_register_module_ex()
2023 zend_printf("%s: Registering module %d\n", module->name, module->module_number); in zend_register_module_ex()
2027 if (module->deps) { in zend_register_module_ex()
2028 const zend_module_dep *dep = module->deps; in zend_register_module_ex()
2039 … load module \"%s\" because conflicting module \"%s\" is already loaded", module->name, dep->name); in zend_register_module_ex()
2048 name_len = strlen(module->name); in zend_register_module_ex()
2049 lcname = zend_string_alloc(name_len, module->type == MODULE_PERSISTENT); in zend_register_module_ex()
2050 zend_str_tolower_copy(ZSTR_VAL(lcname), module->name, name_len); in zend_register_module_ex()
2053 …if ((module_ptr = zend_hash_add_mem(&module_registry, lcname, module, sizeof(zend_module_entry))) … in zend_register_module_ex()
2054 zend_error(E_CORE_WARNING, "Module \"%s\" is already loaded", module->name); in zend_register_module_ex()
2058 module = module_ptr; in zend_register_module_ex()
2059 EG(current_module) = module; in zend_register_module_ex()
2061 …if (module->functions && zend_register_functions(NULL, module->functions, NULL, module->type)==FAI… in zend_register_module_ex()
2065 zend_error(E_CORE_WARNING,"%s: Unable to register functions, unable to load", module->name); in zend_register_module_ex()
2071 return module; in zend_register_module_ex()
2075 ZEND_API zend_module_entry* zend_register_internal_module(zend_module_entry *module) /* {{{ */ in zend_register_internal_module() argument
2077 module->module_number = zend_next_free_module(); in zend_register_internal_module()
2078 module->type = MODULE_PERSISTENT; in zend_register_internal_module()
2079 return zend_register_module_ex(module); in zend_register_internal_module()
2339 internal_function->module = EG(current_module); in ZEND_END_ARG_INFO()
2582 ZEND_API zend_result zend_startup_module(zend_module_entry *module) /* {{{ */ in zend_startup_module() argument
2584 …if ((module = zend_register_internal_module(module)) != NULL && zend_startup_module_ex(module) == … in zend_startup_module()
2593 zend_module_entry *module; in zend_get_module_started() local
2595 module = zend_hash_str_find_ptr(&module_registry, module_name, strlen(module_name)); in zend_get_module_started()
2596 return (module && module->module_started) ? SUCCESS : FAILURE; in zend_get_module_started()
2604 if (ce->type == ZEND_INTERNAL_CLASS && ce->info.internal.module->module_number == module_number) { in clean_module_class()
2618 void module_destructor(zend_module_entry *module) /* {{{ */ in module_destructor() argument
2621 if (module->type == MODULE_TEMPORARY) { in module_destructor()
2622 zend_clean_module_rsrc_dtors(module->module_number); in module_destructor()
2623 clean_module_constants(module->module_number); in module_destructor()
2624 clean_module_classes(module->module_number); in module_destructor()
2627 if (module->module_started && module->module_shutdown_func) { in module_destructor()
2629 zend_printf("%s: Module shutdown\n", module->name); in module_destructor()
2631 module->module_shutdown_func(module->type, module->module_number); in module_destructor()
2634 if (module->module_started in module_destructor()
2635 && !module->module_shutdown_func in module_destructor()
2636 && module->type == MODULE_TEMPORARY) { in module_destructor()
2637 zend_unregister_ini_entries(module->module_number); in module_destructor()
2641 if (module->globals_size) { in module_destructor()
2643 if (*module->globals_id_ptr) { in module_destructor()
2644 ts_free_id(*module->globals_id_ptr); in module_destructor()
2647 if (module->globals_dtor) { in module_destructor()
2648 module->globals_dtor(module->globals_ptr); in module_destructor()
2653 module->module_started=0; in module_destructor()
2654 if (module->type == MODULE_TEMPORARY && module->functions) { in module_destructor()
2655 zend_unregister_functions(module->functions, -1, NULL); in module_destructor()
2659 if (module->handle && !getenv("ZEND_DONT_UNLOAD_MODULES")) { in module_destructor()
2660 DL_UNLOAD(module->handle); in module_destructor()
2671 zend_module_entry *module = *p; in zend_activate_modules() local
2673 if (module->request_startup_func(module->type, module->module_number)==FAILURE) { in zend_activate_modules()
2674 zend_error(E_WARNING, "request_startup() for %s module failed", module->name); in zend_activate_modules()
2688 zend_module_entry *module; in zend_deactivate_modules() local
2690 ZEND_HASH_REVERSE_FOREACH_PTR(&module_registry, module) { in zend_deactivate_modules()
2691 if (module->request_shutdown_func) { in zend_deactivate_modules()
2693 zend_printf("%s: Request shutdown\n", module->name); in zend_deactivate_modules()
2695 module->request_shutdown_func(module->type, module->module_number); in zend_deactivate_modules()
2702 zend_module_entry *module = *p; in zend_deactivate_modules() local
2704 module->request_shutdown_func(module->type, module->module_number); in zend_deactivate_modules()
2726 zend_module_entry *module; in zend_post_deactivate_modules() local
2730 ZEND_HASH_FOREACH_PTR(&module_registry, module) { in zend_post_deactivate_modules()
2731 if (module->post_deactivate_func) { in zend_post_deactivate_modules()
2732 module->post_deactivate_func(); in zend_post_deactivate_modules()
2736 module = Z_PTR_P(zv); in zend_post_deactivate_modules()
2737 if (module->type != MODULE_TEMPORARY) { in zend_post_deactivate_modules()
2740 module_destructor(module); in zend_post_deactivate_modules()
2741 free(module); in zend_post_deactivate_modules()
2748 zend_module_entry *module = *p; in zend_post_deactivate_modules() local
2750 module->post_deactivate_func(); in zend_post_deactivate_modules()
2773 class_entry->info.internal.module = EG(current_module); in do_register_internal_class()
3713 zend_module_entry *module; in zend_get_module_version() local
3717 module = zend_hash_find_ptr(&module_registry, lname); in zend_get_module_version()
3719 return module ? module->version : NULL; in zend_get_module_version()
3735 && ce->info.internal.module->type == MODULE_PERSISTENT; in is_persistent_class()