summaryrefslogtreecommitdiff
path: root/ext/hash
diff options
context:
space:
mode:
authorScott MacVicar <scottmac@php.net>2008-11-27 21:11:55 +0000
committerScott MacVicar <scottmac@php.net>2008-11-27 21:11:55 +0000
commit9c11d5e1388e0ac66bbc841a911c02c00f1be023 (patch)
tree3d7858cdb3e5b6f16f036106278358730585595c /ext/hash
parentceabdbb4832d04ad625c898031e7dd730a10df04 (diff)
downloadphp-git-9c11d5e1388e0ac66bbc841a911c02c00f1be023.tar.gz
MFH Move mhash extension registration code into the hash module startup. This allows extension_loaded('mhash'); to work.
Diffstat (limited to 'ext/hash')
-rw-r--r--ext/hash/hash.c23
1 files changed, 23 insertions, 0 deletions
diff --git a/ext/hash/hash.c b/ext/hash/hash.c
index 4035cc999d..70e1915f6a 100644
--- a/ext/hash/hash.c
+++ b/ext/hash/hash.c
@@ -607,6 +607,27 @@ static void php_hash_dtor(zend_rsrc_list_entry *rsrc TSRMLS_DC) /* {{{ */
#ifdef PHP_MHASH_BC
+PHP_MINFO_FUNCTION(mhash)
+{
+ php_info_print_table_start();
+ php_info_print_table_row(2, "MHASH support", "Enabled");
+ php_info_print_table_row(2, "MHASH API Version", "Emulated Support");
+ php_info_print_table_end();
+}
+
+zend_module_entry mhash_module_entry = {
+ STANDARD_MODULE_HEADER,
+ "mhash",
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ PHP_MINFO(mhash),
+ NO_VERSION_YET,
+ STANDARD_MODULE_PROPERTIES,
+};
+
static void mhash_init(INIT_FUNC_ARGS)
{
char buf[128];
@@ -622,6 +643,8 @@ static void mhash_init(INIT_FUNC_ARGS)
len = slprintf(buf, 127, "MHASH_%s", algorithm.mhash_name, strlen(algorithm.mhash_name));
zend_register_long_constant(buf, len + 1, algorithm.value, CONST_CS | CONST_PERSISTENT, module_number TSRMLS_CC);
}
+
+ zend_register_module_ex(&mhash_module_entry TSRMLS_CC);
}
PHP_FUNCTION(mhash)