]> CyberLeo.Net >> Repos - SourceForge/phpwiki.git/blob - lib/WikiDB/backend/PDO_pgsql.php
Reformat code
[SourceForge/phpwiki.git] / lib / WikiDB / backend / PDO_pgsql.php
1 <?php
2
3 /*
4  * Copyright 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 /**
24  * @author: Reini Urban
25  */
26 require_once 'lib/WikiDB/backend/PDO.php';
27
28 class WikiDB_backend_PDO_pgsql
29     extends WikiDB_backend_PDO
30 {
31
32     /*
33      * convert from,count to SQL "LIMIT $count OFFSET $from"
34      */
35     function _limit_sql($limit = false)
36     {
37         if ($limit) {
38             list($offset, $count) = $this->limit($limit);
39             if ($offset)
40                 $limit = " LIMIT $count OFFSET $from";
41             else
42                 $limit = " LIMIT $count";
43         } else
44             $limit = '';
45         return $limit;
46     }
47
48     function backendType()
49     {
50         return 'pgsql';
51     }
52 }
53
54 // Local Variables:
55 // mode: php
56 // tab-width: 8
57 // c-basic-offset: 4
58 // c-hanging-comment-ender-p: nil
59 // indent-tabs-mode: nil
60 // End: