I've come up with a rather ugly workaround for this bug, but it does work and it only touches interbase.c.

It basically works in the following way:
- the module refuses to be loaded by dl() [MODULE_TEMPORARY], so
only loading from php.ini is allowed [MODULE_PERSISTENT],
- the module NULLs its dlopen() handle in its shutdown phase, so module_destructor() will not dlclose() it.


Feedback, anyone ?

--
Ard

Index: interbase.c
===================================================================
RCS file: /repository/php-src/ext/interbase/interbase.c,v
retrieving revision 1.91.2.27
diff -u -r1.91.2.27 interbase.c
--- interbase.c 7 Jan 2004 09:44:21 -0000       1.91.2.27
+++ interbase.c 20 Jan 2004 22:58:57 -0000
@@ -536,6 +536,12 @@

 PHP_MINIT_FUNCTION(ibase)
 {
+       if (type == MODULE_TEMPORARY)
+       {
+               _php_ibase_module_error("Per request loading not supported by this 
module. Try loading it from php.ini instead");
+               return FAILURE;
+       }
+
        ZEND_INIT_MODULE_GLOBALS(ibase, php_ibase_init_globals, NULL);

        REGISTER_INI_ENTRIES();
@@ -594,6 +600,12 @@

 PHP_MSHUTDOWN_FUNCTION(ibase)
 {
+       zend_module_entry *ibase_entry;
+       if (SUCCESS == zend_hash_find(&module_registry, ibase_module_entry.name, 
strlen(ibase_module_entry.name) +1, (void*) &ibase_entry))
+       {
+               ibase_entry->handle = NULL;
+       }
+
        UNREGISTER_INI_ENTRIES();
        return SUCCESS;
 }

-- 
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to