2 rcs_id('$Id: ADODB.php,v 1.2 2004-04-06 20:00:10 rurban Exp $');
4 require_once('lib/WikiDB.php');
7 * WikiDB layer for ADODB, which does nothing more than calling the mysql-specific ADODB backend.
8 * Support for a newer adodb library, the adodb extension library
9 * and more databases will come with PhpWiki v1.3.9
11 * @author: Lawrence Akka
13 class WikiDB_ADODB extends WikiDB
15 function WikiDB_ADODB ($dbparams) {
16 $backend_type = 'mysql'; // default value. FIXME
17 /* if (preg_match('/^(\w+):/', $dbparams['dsn'], $m))
18 $backend_type = $m[1]; */
19 include_once("lib/WikiDB/backend/ADODB_$backend_type.php");
20 $backend_class = "WikiDB_backend_ADODB_$backend_type";
21 $backend = new $backend_class($dbparams);
23 $this->WikiDB($backend, $dbparams);
28 * Determine whether page exists (in non-default form).
29 * @see WikiDB::isWikiPage
31 function isWikiPage ($pagename) {
33 if (empty($this->_iwpcache))
34 $this->_iwpcache = array_flip($this->_backend->get_all_pagenames());
35 return isset($this->_iwpcache[$pagename]);
38 if (!isset($this->_iwpcache[$pagename]))
39 $this->_iwpcache[$pagename] = $this->_backend->is_wiki_page($pagename);
40 return $this->_iwpcache[$pagename];
42 // Talk to the backend directly for max speed.
44 $pagedata = $this->_cache->get_pagedata($pagename);
45 return !empty($pagedata[':non_default']);
56 // c-hanging-comment-ender-p: nil
57 // indent-tabs-mode: nil