[PHP-DEV] a very silly dbm bug (was: Some strange problems with PHP 4 RC 1) From: geoff <email protected>
Date: 03/29/00

Jim (and PHP developers),

Here's a response to the second of the problems in Jim's "Some
strange problems with PHP 4 RC 1" email of two days ago.

I made loads of attempts to get the dbm calls running with lots
and lots of different options in the configuration and build.

Last night, after an incredibly frustrating afternoon I sat down
with a friend (The Red Fox) and we worked through the code (reading
header files, extracting symbols, etc).

Eventually, we discovered that somebody had messed with the
php_db.h file and had checked it back in with the phpext_db_ptr
#undef'd and then #define'd to NULL ... needless to say, this
makes it pretty difficult for the main php library to have access
to the dbm functions.

Below is the output of "cvs diff php_db.h" with the offending #defs
removed

After applying the patch below, I was able to compile again with
support for the dbm functions ... and they all worked.

Cheers
Geoff

PS Of course, there may be a connection with other bugs
    (including Bug #3423: dbmopen() not thread-safe) ... but
    that is not for me to judge right now ...

Index: php_db.h
===================================================================
RCS file: /repository/php4/ext/db/php_db.h,v
retrieving revision 1.4
diff -u -r1.4 php_db.h
--- php_db.h 2000/02/05 15:16:09 1.4
+++ php_db.h 2000/03/29 15:15:53
@@ -89,7 +89,4 @@
 PHP_FUNCTION(dbmfirstkey);
 PHP_FUNCTION(dbmnextkey);
 
-#undef phpext_db_ptr
-#define phpext_db_ptr NULL
-
 #endif /* _PHP_DB_H */

-- 
PHP Development Mailing List <http://www.php.net/>
To unsubscribe, e-mail: php-dev-unsubscribe <email protected>
For additional commands, e-mail: php-dev-help <email protected>
To contact the list administrators, e-mail: php-list-admin <email protected>