It appears that BDB 4.1 (at least) support in PHP4 has some 'issues' with
consistency with previous versions. Specifically, it treats the 'c' mode
the same as 'n' (blow the DB away and start again). Funnily enough, that
causes PHPWiki to reload (or go "what page?") every time you access a page.
Yuk.
The patch to fix it is:
---[BEGIN BDB_patch]---
--- phpwiki-1.3.6.orig/lib/WikiDB/backend/dba.php
+++ phpwiki-1.3.6/lib/WikiDB/backend/dba.php
@@ -19,7 +19,17 @@
// FIXME: error checking.
$db = new DbaDatabase($dbfile, false, $dba_handler);
$db->set_timeout($timeout);
- if (!$db->open('c')) {
+
+ // Workaround for BDB 4.1 fucktardedness
+ if (file_exists($dbfile))
+ {
+ $mode = 'w';
+ }
+ else
+ {
+ $mode = 'c';
+ }
+ if (!$db->open($mode)) {
trigger_error(sprintf(_("%s: Can't open dba database"),
$dbfile), E_USER_ERROR);
global $request;
$request->finish(fmt("%s: Can't open dba database", $dbfile));
---[END BDB_patch]---
It should apply cleanly against 1.3.6. I'd appreciate it if someone could
apply it to CVS and warn me, so I can take it out of the patches for future
versions for Debian.
I'm now going to apply the wirebrush of enlightenment to the foreskin of
poor testing on the PHP folks.
--
Another Fine Product From The Nonsense Factory.
|