Add zend_get_module_started() to quickly check whether a module is present

and its MINIT function has been called.
This commit is contained in:
Marcus Boerger 2004-01-19 00:39:29 +00:00
parent 3ee59febe7
commit 805dfab890
2 changed files with 9 additions and 0 deletions

View file

@ -1350,6 +1350,14 @@ ZEND_API int zend_register_module(zend_module_entry *module)
}
ZEND_API int zend_get_module_started(char *module_name)
{
zend_module_entry *module;
return (zend_hash_find(&module_registry, module_name, strlen(module_name)+1, (void**)&module) == SUCCESS && module->module_started) ? SUCCESS : FAILURE;
}
void module_destructor(zend_module_entry *module)
{
TSRMLS_FETCH();

View file

@ -176,6 +176,7 @@ ZEND_API void zend_wrong_param_count(TSRMLS_D);
ZEND_API zend_bool zend_is_callable(zval *callable, zend_bool syntax_only, char **callable_name);
ZEND_API zend_bool zend_make_callable(zval *callable, char **callable_name TSRMLS_DC);
ZEND_API char *zend_get_module_version(char *module_name);
ZEND_API int zend_get_module_started(char *module_name);
ZEND_API int zend_declare_property(zend_class_entry *ce, char *name, int name_length, zval *property, int access_type TSRMLS_DC);
ZEND_API int zend_declare_property_null(zend_class_entry *ce, char *name, int name_length, int access_type TSRMLS_DC);
ZEND_API int zend_declare_property_long(zend_class_entry *ce, char *name, int name_length, long value, int access_type TSRMLS_DC);