Lines Matching refs:module

1813 ZEND_API int zend_startup_module_ex(zend_module_entry *module) /* {{{ */  in zend_startup_module_ex()  argument
1818 if (module->module_started) { in zend_startup_module_ex()
1821 module->module_started = 1; in zend_startup_module_ex()
1824 if (module->deps) { in zend_startup_module_ex()
1825 const zend_module_dep *dep = module->deps; in zend_startup_module_ex()
1838 …NG, "Cannot load module '%s' because required module '%s' is not loaded", module->name, dep->name); in zend_startup_module_ex()
1839 module->module_started = 0; in zend_startup_module_ex()
1849 if (module->globals_size) { in zend_startup_module_ex()
1851 …ts_allocate_id(module->globals_id_ptr, module->globals_size, (ts_allocate_ctor) module->globals_ct… in zend_startup_module_ex()
1853 if (module->globals_ctor) { in zend_startup_module_ex()
1854 module->globals_ctor(module->globals_ptr); in zend_startup_module_ex()
1858 if (module->module_startup_func) { in zend_startup_module_ex()
1859 EG(current_module) = module; in zend_startup_module_ex()
1860 if (module->module_startup_func(module->type, module->module_number)==FAILURE) { in zend_startup_module_ex()
1861 zend_error_noreturn(E_CORE_ERROR,"Unable to start %s module", module->name); in zend_startup_module_ex()
1873 zend_module_entry *module = Z_PTR_P(zv); in zend_startup_module_zval() local
1875 return (zend_startup_module_ex(module) == SUCCESS) ? ZEND_HASH_APPLY_KEEP : ZEND_HASH_APPLY_REMOVE; in zend_startup_module_zval()
1916 zend_module_entry *module; in zend_collect_module_handlers() local
1924 ZEND_HASH_FOREACH_PTR(&module_registry, module) { in zend_collect_module_handlers()
1925 if (module->request_startup_func) { in zend_collect_module_handlers()
1928 if (module->request_shutdown_func) { in zend_collect_module_handlers()
1931 if (module->post_deactivate_func) { in zend_collect_module_handlers()
1947 ZEND_HASH_FOREACH_PTR(&module_registry, module) { in zend_collect_module_handlers()
1948 if (module->request_startup_func) { in zend_collect_module_handlers()
1949 module_request_startup_handlers[startup_count++] = module; in zend_collect_module_handlers()
1951 if (module->request_shutdown_func) { in zend_collect_module_handlers()
1952 module_request_shutdown_handlers[--shutdown_count] = module; in zend_collect_module_handlers()
1954 if (module->post_deactivate_func) { in zend_collect_module_handlers()
1955 module_post_deactivate_handlers[--post_deactivate_count] = module; in zend_collect_module_handlers()
1999 ZEND_API zend_module_entry* zend_register_module_ex(zend_module_entry *module) /* {{{ */ in zend_register_module_ex() argument
2005 if (!module) { in zend_register_module_ex()
2010 zend_printf("%s: Registering module %d\n", module->name, module->module_number); in zend_register_module_ex()
2014 if (module->deps) { in zend_register_module_ex()
2015 const zend_module_dep *dep = module->deps; in zend_register_module_ex()
2026 …nnot load module '%s' because conflicting module '%s' is already loaded", module->name, dep->name); in zend_register_module_ex()
2035 name_len = strlen(module->name); in zend_register_module_ex()
2036 lcname = zend_string_alloc(name_len, module->type == MODULE_PERSISTENT); in zend_register_module_ex()
2037 zend_str_tolower_copy(ZSTR_VAL(lcname), module->name, name_len); in zend_register_module_ex()
2040 …if ((module_ptr = zend_hash_add_mem(&module_registry, lcname, module, sizeof(zend_module_entry))) … in zend_register_module_ex()
2041 zend_error(E_CORE_WARNING, "Module '%s' already loaded", module->name); in zend_register_module_ex()
2045 module = module_ptr; in zend_register_module_ex()
2046 EG(current_module) = module; in zend_register_module_ex()
2048 …if (module->functions && zend_register_functions(NULL, module->functions, NULL, module->type)==FAI… in zend_register_module_ex()
2052 zend_error(E_CORE_WARNING,"%s: Unable to register functions, unable to load", module->name); in zend_register_module_ex()
2058 return module; in zend_register_module_ex()
2062 ZEND_API zend_module_entry* zend_register_internal_module(zend_module_entry *module) /* {{{ */ in zend_register_internal_module() argument
2064 module->module_number = zend_next_free_module(); in zend_register_internal_module()
2065 module->type = MODULE_PERSISTENT; in zend_register_internal_module()
2066 return zend_register_module_ex(module); in zend_register_internal_module()
2164 internal_function->module = EG(current_module); in zend_register_functions()
2514 ZEND_API int zend_startup_module(zend_module_entry *module) /* {{{ */ in zend_startup_module() argument
2516 …if ((module = zend_register_internal_module(module)) != NULL && zend_startup_module_ex(module) == … in zend_startup_module()
2525 zend_module_entry *module; in zend_get_module_started() local
2527 module = zend_hash_str_find_ptr(&module_registry, module_name, strlen(module_name)); in zend_get_module_started()
2528 return (module && module->module_started) ? SUCCESS : FAILURE; in zend_get_module_started()
2536 if (ce->type == ZEND_INTERNAL_CLASS && ce->info.internal.module->module_number == module_number) { in clean_module_class()
2550 void module_destructor(zend_module_entry *module) /* {{{ */ in module_destructor() argument
2553 if (module->type == MODULE_TEMPORARY) { in module_destructor()
2554 zend_clean_module_rsrc_dtors(module->module_number); in module_destructor()
2555 clean_module_constants(module->module_number); in module_destructor()
2556 clean_module_classes(module->module_number); in module_destructor()
2559 if (module->module_started && module->module_shutdown_func) { in module_destructor()
2561 zend_printf("%s: Module shutdown\n", module->name); in module_destructor()
2563 module->module_shutdown_func(module->type, module->module_number); in module_destructor()
2566 if (module->module_started in module_destructor()
2567 && !module->module_shutdown_func in module_destructor()
2568 && module->type == MODULE_TEMPORARY) { in module_destructor()
2569 zend_unregister_ini_entries(module->module_number); in module_destructor()
2573 if (module->globals_size) { in module_destructor()
2575 if (*module->globals_id_ptr) { in module_destructor()
2576 ts_free_id(*module->globals_id_ptr); in module_destructor()
2579 if (module->globals_dtor) { in module_destructor()
2580 module->globals_dtor(module->globals_ptr); in module_destructor()
2585 module->module_started=0; in module_destructor()
2586 if (module->type == MODULE_TEMPORARY && module->functions) { in module_destructor()
2587 zend_unregister_functions(module->functions, -1, NULL); in module_destructor()
2591 if (module->handle && !getenv("ZEND_DONT_UNLOAD_MODULES")) { in module_destructor()
2592 DL_UNLOAD(module->handle); in module_destructor()
2603 zend_module_entry *module = *p; in zend_activate_modules() local
2605 if (module->request_startup_func(module->type, module->module_number)==FAILURE) { in zend_activate_modules()
2606 zend_error(E_WARNING, "request_startup() for %s module failed", module->name); in zend_activate_modules()
2620 zend_module_entry *module; in zend_deactivate_modules() local
2622 ZEND_HASH_REVERSE_FOREACH_PTR(&module_registry, module) { in zend_deactivate_modules()
2623 if (module->request_shutdown_func) { in zend_deactivate_modules()
2625 zend_printf("%s: Request shutdown\n", module->name); in zend_deactivate_modules()
2627 module->request_shutdown_func(module->type, module->module_number); in zend_deactivate_modules()
2634 zend_module_entry *module = *p; in zend_deactivate_modules() local
2636 module->request_shutdown_func(module->type, module->module_number); in zend_deactivate_modules()
2658 zend_module_entry *module; in zend_post_deactivate_modules() local
2662 ZEND_HASH_FOREACH_PTR(&module_registry, module) { in zend_post_deactivate_modules()
2663 if (module->post_deactivate_func) { in zend_post_deactivate_modules()
2664 module->post_deactivate_func(); in zend_post_deactivate_modules()
2668 module = Z_PTR_P(zv); in zend_post_deactivate_modules()
2669 if (module->type != MODULE_TEMPORARY) { in zend_post_deactivate_modules()
2672 module_destructor(module); in zend_post_deactivate_modules()
2673 free(module); in zend_post_deactivate_modules()
2680 zend_module_entry *module = *p; in zend_post_deactivate_modules() local
2682 module->post_deactivate_func(); in zend_post_deactivate_modules()
2705 class_entry->info.internal.module = EG(current_module); in do_register_internal_class()
3675 zend_module_entry *module; in zend_get_module_version() local
3679 module = zend_hash_find_ptr(&module_registry, lname); in zend_get_module_version()
3681 return module ? module->version : NULL; in zend_get_module_version()
3697 && ce->info.internal.module->type == MODULE_PERSISTENT; in is_persistent_class()