]> CyberLeo.Net >> Repos - SourceForge/phpwiki.git/blob - lib/WikiDB/flatfile.php
include [all] Include and file path should be devided with single space. File path...
[SourceForge/phpwiki.git] / lib / WikiDB / flatfile.php
1 <?php
2
3
4 /**
5  * Copyright 1999, 2005 $ThePhpWikiProgrammingTeam
6  *
7  * This file is part of PhpWiki.
8  *
9  * PhpWiki is free software; you can redistribute it and/or modify
10  * it under the terms of the GNU General Public License as published by
11  * the Free Software Foundation; either version 2 of the License, or
12  * (at your option) any later version.
13  *
14  * PhpWiki is distributed in the hope that it will be useful,
15  * but WITHOUT ANY WARRANTY; without even the implied warranty of
16  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
17  * GNU General Public License for more details.
18  *
19  * You should have received a copy of the GNU General Public License along
20  * with PhpWiki; if not, write to the Free Software Foundation, Inc.,
21  * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
22  */
23
24 require_once 'lib/WikiDB.php';
25 require_once 'lib/WikiDB/backend/flatfile.php';
26
27 /**
28  * Wrapper class for the flatfile backend.
29  * flatfile has readable (mimified) page_data files, the rest is the
30  * same as in the file backend (serialized arrays).
31  */
32 class WikiDB_flatfile extends WikiDB
33 {
34     /**
35      * Constructor requires the DB parameters.
36      */
37     function WikiDB_flatfile( $dbparams )
38     {
39         $backend = new WikiDB_backend_flatfile( $dbparams );
40         $backend->_wikidb =& $this;
41         $this->WikiDB($backend, $dbparams);
42
43         if (empty($dbparams['directory'])
44             || preg_match('@^/tmp\b@', $dbparams['directory']))
45             trigger_error(sprintf(_("The %s files are in the %s directory. Please read the INSTALL file and move the database to a permanent location or risk losing all the pages!"),
46                                   "Page", "/tmp"), E_USER_WARNING);
47     }
48 }
49
50 // Local Variables:
51 // mode: php
52 // tab-width: 8
53 // c-basic-offset: 4
54 // c-hanging-comment-ender-p: nil
55 // indent-tabs-mode: nil
56 // End: