]> granicus.if.org Git - php/commitdiff
Fix dl() and extension=
authorWez Furlong <wez@php.net>
Tue, 18 May 2004 15:26:32 +0000 (15:26 +0000)
committerWez Furlong <wez@php.net>
Tue, 18 May 2004 15:26:32 +0000 (15:26 +0000)
ext/standard/dl.c

index bbb0d69030c09dc35a263fdbc4ff2d636033d62b..709370503db429ee7f943034cfbb4a4144fd5352 100644 (file)
@@ -108,8 +108,6 @@ void php_dl(pval *file, int type, pval *return_value TSRMLS_DC)
        zend_module_entry *(*get_module)(void);
        int error_type;
        char *extension_dir;
-       int name_len;
-       char *lcname;
 
        if (type==MODULE_PERSISTENT) {
                /* Use the configuration hash directly, the INI mechanism is not yet initialized */
@@ -236,25 +234,9 @@ void php_dl(pval *file, int type, pval *return_value TSRMLS_DC)
                        DL_UNLOAD(handle);
                        RETURN_FALSE;
        }
-       name_len = strlen(module_entry->name);
-       lcname = zend_str_tolower_dup(module_entry->name, name_len);
-       if (zend_hash_exists(&module_registry, lcname, name_len+1)) {
-               efree(lcname);
-               php_error_docref(NULL TSRMLS_CC, error_type, "Module '%s' already loaded", module_entry->name);
-               DL_UNLOAD(handle);
-               RETURN_FALSE;
-       }
-       efree(lcname);
        Z_TYPE_P(module_entry) = type;
        module_entry->module_number = zend_next_free_module();
-       if (module_entry->module_startup_func) {
-               if (module_entry->module_startup_func(type, module_entry->module_number TSRMLS_CC)==FAILURE) {
-                       php_error_docref(NULL TSRMLS_CC, error_type, "Unable to initialize module '%s'", module_entry->name);
-                       DL_UNLOAD(handle);
-                       RETURN_FALSE;
-               }
-       }
-       zend_register_module(module_entry);
+       zend_register_module_ex(module_entry TSRMLS_CC);
 
        if ((type == MODULE_TEMPORARY) && module_entry->request_startup_func) {
                if (module_entry->request_startup_func(type, module_entry->module_number TSRMLS_CC)) {