]> CyberLeo.Net >> Repos - SourceForge/phpwiki.git/blob - lib/WikiDB/ADODB.php
Cleanup of special PageList column types
[SourceForge/phpwiki.git] / lib / WikiDB / ADODB.php
1 <?php // -*-php-*-
2 rcs_id('$Id: ADODB.php,v 1.2 2004-04-06 20:00:10 rurban Exp $');
3
4 require_once('lib/WikiDB.php');
5
6 /**
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
10  *
11  * @author: Lawrence Akka
12  */
13 class WikiDB_ADODB extends WikiDB
14 {
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);
22
23         $this->WikiDB($backend, $dbparams);
24     }
25     
26     
27     /**
28      * Determine whether page exists (in non-default form).
29      * @see WikiDB::isWikiPage
30      */
31     function isWikiPage ($pagename) {
32         /*
33         if (empty($this->_iwpcache))
34             $this->_iwpcache = array_flip($this->_backend->get_all_pagenames());
35         return isset($this->_iwpcache[$pagename]);
36         */
37
38         if (!isset($this->_iwpcache[$pagename]))
39             $this->_iwpcache[$pagename] = $this->_backend->is_wiki_page($pagename);
40         return $this->_iwpcache[$pagename];
41         
42         // Talk to the backend directly for max speed.
43         /*
44         $pagedata = $this->_cache->get_pagedata($pagename);
45         return !empty($pagedata[':non_default']);
46         */
47     }
48 };
49
50   
51 // For emacs users
52 // Local Variables:
53 // mode: php
54 // tab-width: 8
55 // c-basic-offset: 4
56 // c-hanging-comment-ender-p: nil
57 // indent-tabs-mode: nil
58 // End:
59
60 ?>