]> CyberLeo.Net >> Repos - SourceForge/phpwiki.git/blob - lib/WikiDB/flatfile.php
Reformat code
[SourceForge/phpwiki.git] / lib / WikiDB / flatfile.php
1 <?php
2
3 /**
4  * Copyright 1999, 2005 $ThePhpWikiProgrammingTeam
5  *
6  * This file is part of PhpWiki.
7  *
8  * PhpWiki is free software; you can redistribute it and/or modify
9  * it under the terms of the GNU General Public License as published by
10  * the Free Software Foundation; either version 2 of the License, or
11  * (at your option) any later version.
12  *
13  * PhpWiki is distributed in the hope that it will be useful,
14  * but WITHOUT ANY WARRANTY; without even the implied warranty of
15  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
16  * GNU General Public License for more details.
17  *
18  * You should have received a copy of the GNU General Public License along
19  * with PhpWiki; if not, write to the Free Software Foundation, Inc.,
20  * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
21  */
22
23 require_once 'lib/WikiDB.php';
24 require_once 'lib/WikiDB/backend/flatfile.php';
25
26 /**
27  * Wrapper class for the flatfile backend.
28  * flatfile has readable (mimified) page_data files, the rest is the
29  * same as in the file backend (serialized arrays).
30  */
31 class WikiDB_flatfile extends WikiDB
32 {
33     /**
34      * Constructor requires the DB parameters.
35      */
36     function WikiDB_flatfile($dbparams)
37     {
38         $backend = new WikiDB_backend_flatfile($dbparams);
39         $backend->_wikidb =& $this;
40         $this->WikiDB($backend, $dbparams);
41
42         if (empty($dbparams['directory'])
43             || preg_match('@^/tmp\b@', $dbparams['directory'])
44         )
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: