From: Jeff D. <da...@da...> - 2000-07-11 04:57:22
|
In message <Pin...@bo...>,Steve Wa instead writes: >I want to >set it up so that we only need one call to OpenDataBase(), ... I agree, and have been thinking along the same lines. We should anticipate the addition of version control too. I see something like (letting my bias towards objects show through): In wiki_config.php3: $dbi = new WikiMySqlDB('localhost','test','guest',''); Then in wiki_xxx.php3: // Get current version of page $current_page = $dbi->retrievePage($pagename); // Get most recent archived page $archived_page = $dbi->retrievePage($pagename, -1); // Get second most recent archived page (or false if there is none) $old_archived_page = $dbi->retrievePage($pagename, -2); // Get version 12 of the page (o4 false if version 12 is not in the database). $page_version12 = $dbi->retrievePage($pagename, 12); This would be a good time to clean up the InitXXX(), XXXNextMatch() interface too. As stated in a previous post, I suggest iterators: $search = $dbi->fullSearch("findme"); while ($page = $search->next()) { // do something; } or similar... Jeff PS Anyone else notice anything funny going on with phpwiki-talk? I posted two notes earlier today (one re: ZIP file stuff, and one about bugs in wiki_transform) and I've only seen one come back. Also I can't get into the archives (I get the oh-so-informative "An error occured.") |