Lines Matching refs:module
1831 ZEND_API int zend_startup_module_ex(zend_module_entry *module) /* {{{ */ in zend_startup_module_ex() argument
1836 if (module->module_started) { in zend_startup_module_ex()
1839 module->module_started = 1; in zend_startup_module_ex()
1842 if (module->deps) { in zend_startup_module_ex()
1843 const zend_module_dep *dep = module->deps; in zend_startup_module_ex()
1856 …NG, "Cannot load module '%s' because required module '%s' is not loaded", module->name, dep->name); in zend_startup_module_ex()
1857 module->module_started = 0; in zend_startup_module_ex()
1867 if (module->globals_size) { in zend_startup_module_ex()
1869 …ts_allocate_id(module->globals_id_ptr, module->globals_size, (ts_allocate_ctor) module->globals_ct… in zend_startup_module_ex()
1871 if (module->globals_ctor) { in zend_startup_module_ex()
1872 module->globals_ctor(module->globals_ptr); in zend_startup_module_ex()
1876 if (module->module_startup_func) { in zend_startup_module_ex()
1877 EG(current_module) = module; in zend_startup_module_ex()
1878 if (module->module_startup_func(module->type, module->module_number)==FAILURE) { in zend_startup_module_ex()
1879 zend_error_noreturn(E_CORE_ERROR,"Unable to start %s module", module->name); in zend_startup_module_ex()
1891 zend_module_entry *module = Z_PTR_P(zv); in zend_startup_module_zval() local
1893 return (zend_startup_module_ex(module) == SUCCESS) ? ZEND_HASH_APPLY_KEEP : ZEND_HASH_APPLY_REMOVE; in zend_startup_module_zval()
1934 zend_module_entry *module; in zend_collect_module_handlers() local
1942 ZEND_HASH_FOREACH_PTR(&module_registry, module) { in zend_collect_module_handlers()
1943 if (module->request_startup_func) { in zend_collect_module_handlers()
1946 if (module->request_shutdown_func) { in zend_collect_module_handlers()
1949 if (module->post_deactivate_func) { in zend_collect_module_handlers()
1965 ZEND_HASH_FOREACH_PTR(&module_registry, module) { in zend_collect_module_handlers()
1966 if (module->request_startup_func) { in zend_collect_module_handlers()
1967 module_request_startup_handlers[startup_count++] = module; in zend_collect_module_handlers()
1969 if (module->request_shutdown_func) { in zend_collect_module_handlers()
1970 module_request_shutdown_handlers[--shutdown_count] = module; in zend_collect_module_handlers()
1972 if (module->post_deactivate_func) { in zend_collect_module_handlers()
1973 module_post_deactivate_handlers[--post_deactivate_count] = module; in zend_collect_module_handlers()
2017 ZEND_API zend_module_entry* zend_register_module_ex(zend_module_entry *module) /* {{{ */ in zend_register_module_ex() argument
2023 if (!module) { in zend_register_module_ex()
2028 zend_printf("%s: Registering module %d\n", module->name, module->module_number); in zend_register_module_ex()
2032 if (module->deps) { in zend_register_module_ex()
2033 const zend_module_dep *dep = module->deps; in zend_register_module_ex()
2044 …nnot load module '%s' because conflicting module '%s' is already loaded", module->name, dep->name); in zend_register_module_ex()
2053 name_len = strlen(module->name); in zend_register_module_ex()
2054 lcname = zend_string_alloc(name_len, module->type == MODULE_PERSISTENT); in zend_register_module_ex()
2055 zend_str_tolower_copy(ZSTR_VAL(lcname), module->name, name_len); in zend_register_module_ex()
2058 …if ((module_ptr = zend_hash_add_mem(&module_registry, lcname, module, sizeof(zend_module_entry))) … in zend_register_module_ex()
2059 zend_error(E_CORE_WARNING, "Module '%s' already loaded", module->name); in zend_register_module_ex()
2063 module = module_ptr; in zend_register_module_ex()
2064 EG(current_module) = module; in zend_register_module_ex()
2066 …if (module->functions && zend_register_functions(NULL, module->functions, NULL, module->type)==FAI… in zend_register_module_ex()
2070 zend_error(E_CORE_WARNING,"%s: Unable to register functions, unable to load", module->name); in zend_register_module_ex()
2076 return module; in zend_register_module_ex()
2080 ZEND_API zend_module_entry* zend_register_internal_module(zend_module_entry *module) /* {{{ */ in zend_register_internal_module() argument
2082 module->module_number = zend_next_free_module(); in zend_register_internal_module()
2083 module->type = MODULE_PERSISTENT; in zend_register_internal_module()
2084 return zend_register_module_ex(module); in zend_register_internal_module()
2182 internal_function->module = EG(current_module); in zend_register_functions()
2526 ZEND_API int zend_startup_module(zend_module_entry *module) /* {{{ */ in zend_startup_module() argument
2528 …if ((module = zend_register_internal_module(module)) != NULL && zend_startup_module_ex(module) == … in zend_startup_module()
2537 zend_module_entry *module; in zend_get_module_started() local
2539 module = zend_hash_str_find_ptr(&module_registry, module_name, strlen(module_name)); in zend_get_module_started()
2540 return (module && module->module_started) ? SUCCESS : FAILURE; in zend_get_module_started()
2548 if (ce->type == ZEND_INTERNAL_CLASS && ce->info.internal.module->module_number == module_number) { in clean_module_class()
2562 void module_destructor(zend_module_entry *module) /* {{{ */ in module_destructor() argument
2565 if (module->type == MODULE_TEMPORARY) { in module_destructor()
2566 zend_clean_module_rsrc_dtors(module->module_number); in module_destructor()
2567 clean_module_constants(module->module_number); in module_destructor()
2568 clean_module_classes(module->module_number); in module_destructor()
2571 if (module->module_started && module->module_shutdown_func) { in module_destructor()
2573 zend_printf("%s: Module shutdown\n", module->name); in module_destructor()
2575 module->module_shutdown_func(module->type, module->module_number); in module_destructor()
2579 if (module->globals_size) { in module_destructor()
2581 if (*module->globals_id_ptr) { in module_destructor()
2582 ts_free_id(*module->globals_id_ptr); in module_destructor()
2585 if (module->globals_dtor) { in module_destructor()
2586 module->globals_dtor(module->globals_ptr); in module_destructor()
2591 module->module_started=0; in module_destructor()
2592 if (module->type == MODULE_TEMPORARY && module->functions) { in module_destructor()
2593 zend_unregister_functions(module->functions, -1, NULL); in module_destructor()
2597 if (module->handle && !getenv("ZEND_DONT_UNLOAD_MODULES")) { in module_destructor()
2598 DL_UNLOAD(module->handle); in module_destructor()
2609 zend_module_entry *module = *p; in zend_activate_modules() local
2611 if (module->request_startup_func(module->type, module->module_number)==FAILURE) { in zend_activate_modules()
2612 zend_error(E_WARNING, "request_startup() for %s module failed", module->name); in zend_activate_modules()
2623 zend_module_entry *module = Z_PTR_P(zv); in module_registry_cleanup() local
2625 if (module->request_shutdown_func) { in module_registry_cleanup()
2627 zend_printf("%s: Request shutdown\n", module->name); in module_registry_cleanup()
2629 module->request_shutdown_func(module->type, module->module_number); in module_registry_cleanup()
2646 zend_module_entry *module = *p; in zend_deactivate_modules() local
2648 module->request_shutdown_func(module->type, module->module_number); in zend_deactivate_modules()
2667 int module_registry_unload_temp(const zend_module_entry *module) /* {{{ */ in module_registry_unload_temp() argument
2669 return (module->type == MODULE_TEMPORARY) ? ZEND_HASH_APPLY_REMOVE : ZEND_HASH_APPLY_STOP; in module_registry_unload_temp()
2675 zend_module_entry *module = (zend_module_entry *)Z_PTR_P(el); in module_registry_unload_temp_wrapper() local
2676 return module_registry_unload_temp((const zend_module_entry *)module); in module_registry_unload_temp_wrapper()
2682 zend_module_entry *module = (zend_module_entry *)Z_PTR_P(el); in exec_done_cb() local
2683 if (module->post_deactivate_func) { in exec_done_cb()
2684 module->post_deactivate_func(); in exec_done_cb()
2699 zend_module_entry *module = *p; in zend_post_deactivate_modules() local
2701 module->post_deactivate_func(); in zend_post_deactivate_modules()
2724 class_entry->info.internal.module = EG(current_module); in do_register_internal_class()
3684 zend_module_entry *module; in zend_get_module_version() local
3688 module = zend_hash_find_ptr(&module_registry, lname); in zend_get_module_version()
3690 return module ? module->version : NULL; in zend_get_module_version()
3706 && ce->info.internal.module->type == MODULE_PERSISTENT; in is_persistent_class()