ID: 29455 Updated by: [EMAIL PROTECTED] Reported By: dada at bbs dot giga dot net dot tw Status: Feedback Bug Type: *Compile Issues Operating System: FreeBSD PHP Version: 5.0.0 Assigned To: helly New Comment:
Another thing we could do is providing a new subhandler called db1 to deal with teh db 1.85 format interface. The question is whether that makes sense and how to distinguish from ndbm interface and libs? Previous Comments: ------------------------------------------------------------------------ [2004-08-19 20:34:21] [EMAIL PROTECTED] The dbm extension didn't care for the data format. Neither do you if you are using ndm functions which are normally mapped to db2 or db3. Also dbm is a bad idea because you can only have one single file open (though we currently miss some check code for that). To verify which what version you are dealing look for 'DB_VERSION_STRING' in the db.h file or any file it includes. Maybe we can switch to search fro the db_185.h haeder and use that if available. This thing also provides a way to open multiple datase files. Probably this is what you see in your db.h file. ------------------------------------------------------------------------ [2004-08-18 17:23:20] dada at bbs dot giga dot net dot tw The deprecated DBM extension seems using 'ndbm' in FreeBSD (instead of built-in db library) for accessing Berkeley DB 1.85 format in BSD system. 1. Deprecated DBM extension use ndbm's dbm_open() in FreeBSD's /usr/include/ndbm.h 2. my solution use dbopen() in FreeBSD's /usr/include/db.h Both works! My codes use the 2nd solution to support db 1.85 format. Maybe you can barrow the codes from the deprecated DBM extension to utilize the 1st solution to support the Berkeley DB 1.85 format in FreeBSD. This may increase the portability. ~ dada ------------------------------------------------------------------------ [2004-08-05 04:05:21] dada at bbs dot giga dot net dot tw I just send the modified source to you. Thanks. ------------------------------------------------------------------------ [2004-08-05 00:37:40] [EMAIL PROTECTED] Please send me your handler file. I'll see what to do next. And thanks for your patience and very much for your efforts in helping. ------------------------------------------------------------------------ [2004-08-04 12:49:32] dada at bbs dot giga dot net dot tw The DBM is not the database format, but the API interface. So the 'support for DBM handler' may be confused. The PHP source use gdbm's dbm (api) emulation as underlying library to build DBM handler support in DBA. But the resulting database format for this kind of 'dbm' handler does NOT compatible with FreeBSD's built-in DB format. FreeBSD has its built-in database format (libc) which been used in the system everywhere, such as /etc/mail/aliases.db. In fact, FreeBSD/db's format is the same as 'Berkeley DB 1.85' So my question becomes: How to access 'Berkeley DB 1.85' by DBA extension ? -or- How to build 'dbm' handler with FreeBSD/db as underlying library ? The deprecated PHP dbm_* extension can open 'Berkeley DB 1.85' in FreeBSD. But this should be replaced by DBA. The codes in PHP/ext/dba/dba_dbm.c does not compatiable with the API of FreeBSD's db library. I decided to fix this myself. I rewrite the PHP/ext/dba/dba_dbm.c today, and it can be build with FreeBSD/db. It now runs perfectly. But I think this should be called as 'db1' handler. The codes can only be compiled in FreeBSD. I don't know if you would like to add this into PHP CVS. I'll be glad if I can contribute my codes. Thanks for your patience on the report and tolerate my poor english. ------------------------------------------------------------------------ The remainder of the comments for this report are too long. To view the rest of the comments, please view the bug report online at http://bugs.php.net/29455 -- Edit this bug report at http://bugs.php.net/?id=29455&edit=1