aboutsummaryrefslogtreecommitdiffstats
path: root/phpBB/includes/db
diff options
context:
space:
mode:
authorMeik Sievertsen <acydburn@phpbb.com>2007-10-05 14:36:34 +0000
committerMeik Sievertsen <acydburn@phpbb.com>2007-10-05 14:36:34 +0000
commit7de5bb349890d84827d385670c76cd58c40e5b8f (patch)
tree8cf95d27809f5abc61054237d74569e818769a1f /phpBB/includes/db
parente6c79242e6a7debfccc643a09dfab4a4d7746a8a (diff)
downloadforums-7de5bb349890d84827d385670c76cd58c40e5b8f.tar
forums-7de5bb349890d84827d385670c76cd58c40e5b8f.tar.gz
forums-7de5bb349890d84827d385670c76cd58c40e5b8f.tar.bz2
forums-7de5bb349890d84827d385670c76cd58c40e5b8f.tar.xz
forums-7de5bb349890d84827d385670c76cd58c40e5b8f.zip
dumdidum... sorry. ;)
git-svn-id: file:///svn/phpbb/trunk@8147 89ea8834-ac86-4346-8a33-228a782c2dd0
Diffstat (limited to 'phpBB/includes/db')
-rw-r--r--phpBB/includes/db/db_tools.php34
-rw-r--r--phpBB/includes/db/dbal.php21
-rw-r--r--phpBB/includes/db/firebird.php8
-rw-r--r--phpBB/includes/db/mssql.php10
-rw-r--r--phpBB/includes/db/mssql_odbc.php8
-rw-r--r--phpBB/includes/db/mysql.php8
-rw-r--r--phpBB/includes/db/mysqli.php8
-rw-r--r--phpBB/includes/db/oracle.php6
-rw-r--r--phpBB/includes/db/postgres.php14
-rw-r--r--phpBB/includes/db/sqlite.php12
10 files changed, 69 insertions, 60 deletions
diff --git a/phpBB/includes/db/db_tools.php b/phpBB/includes/db/db_tools.php
index b8f3f2246b..589ca39258 100644
--- a/phpBB/includes/db/db_tools.php
+++ b/phpBB/includes/db/db_tools.php
@@ -1,14 +1,22 @@
<?php
-/**
+/**
*
* @package dbal
* @version $Id$
-* @copyright (c) 2007 phpBB Group
-* @license http://opensource.org/licenses/gpl-license.php GNU Public License
+* @copyright (c) 2007 phpBB Group
+* @license http://opensource.org/licenses/gpl-license.php GNU Public License
*
*/
/**
+* @ignore
+*/
+if (!defined('IN_PHPBB'))
+{
+ exit;
+}
+
+/**
* Database Tools for handling cross-db actions such as altering columns, etc.
* Currently not supported is returning SQL for creating tables.
*
@@ -547,8 +555,8 @@ class phpbb_db_tools
// ugh, SQLite
case 'sqlite':
$sql = "SELECT sql
- FROM sqlite_master
- WHERE type = 'table'
+ FROM sqlite_master
+ WHERE type = 'table'
AND name = '{$table}'";
$result = $this->db->sql_query($sql);
@@ -840,8 +848,8 @@ class phpbb_db_tools
if (version_compare(sqlite_libversion(), '3.0') == -1)
{
$sql = "SELECT sql
- FROM sqlite_master
- WHERE type = 'table'
+ FROM sqlite_master
+ WHERE type = 'table'
AND name = '{$table_name}'
ORDER BY type DESC, name;";
$result = $this->db->sql_query($sql);
@@ -932,8 +940,8 @@ class phpbb_db_tools
if (version_compare(sqlite_libversion(), '3.0') == -1)
{
$sql = "SELECT sql
- FROM sqlite_master
- WHERE type = 'table'
+ FROM sqlite_master
+ WHERE type = 'table'
AND name = '{$table_name}'
ORDER BY type DESC, name;";
$result = $this->db->sql_query($sql);
@@ -1053,8 +1061,8 @@ class phpbb_db_tools
case 'sqlite':
$sql = "SELECT sql
- FROM sqlite_master
- WHERE type = 'table'
+ FROM sqlite_master
+ WHERE type = 'table'
AND name = '{$table_name}'
ORDER BY type DESC, name;";
$result = $this->db->sql_query($sql);
@@ -1349,8 +1357,8 @@ class phpbb_db_tools
case 'sqlite':
$sql = "SELECT sql
- FROM sqlite_master
- WHERE type = 'table'
+ FROM sqlite_master
+ WHERE type = 'table'
AND name = '{$table_name}'
ORDER BY type DESC, name;";
$result = $this->db->sql_query($sql);
diff --git a/phpBB/includes/db/dbal.php b/phpBB/includes/db/dbal.php
index d838210d10..a68ce1e2a4 100644
--- a/phpBB/includes/db/dbal.php
+++ b/phpBB/includes/db/dbal.php
@@ -1,14 +1,22 @@
<?php
-/**
+/**
*
* @package dbal
* @version $Id$
-* @copyright (c) 2005 phpBB Group
-* @license http://opensource.org/licenses/gpl-license.php GNU Public License
+* @copyright (c) 2005 phpBB Group
+* @license http://opensource.org/licenses/gpl-license.php GNU Public License
*
*/
/**
+* @ignore
+*/
+if (!defined('IN_PHPBB'))
+{
+ exit;
+}
+
+/**
* Database Abstraction Layer
* @package dbal
*/
@@ -777,13 +785,6 @@ class dbal
}
/**
-*/
-if (!defined('IN_PHPBB'))
-{
- exit;
-}
-
-/**
* This variable holds the class name to use later
*/
$sql_db = 'dbal_' . $dbms;
diff --git a/phpBB/includes/db/firebird.php b/phpBB/includes/db/firebird.php
index 771592a02a..d23d1866c1 100644
--- a/phpBB/includes/db/firebird.php
+++ b/phpBB/includes/db/firebird.php
@@ -1,10 +1,10 @@
<?php
-/**
+/**
*
* @package dbal
* @version $Id$
-* @copyright (c) 2005 phpBB Group
-* @license http://opensource.org/licenses/gpl-license.php GNU Public License
+* @copyright (c) 2005 phpBB Group
+* @license http://opensource.org/licenses/gpl-license.php GNU Public License
*
*/
@@ -250,7 +250,7 @@ class dbal_firebird extends dbal
$query = 'SELECT FIRST ' . $total . ((!empty($offset)) ? ' SKIP ' . $offset : '') . substr($query, 6);
- return $this->sql_query($query, $cache_ttl);
+ return $this->sql_query($query, $cache_ttl);
}
/**
diff --git a/phpBB/includes/db/mssql.php b/phpBB/includes/db/mssql.php
index f07d1adfe9..a1fce22214 100644
--- a/phpBB/includes/db/mssql.php
+++ b/phpBB/includes/db/mssql.php
@@ -1,10 +1,10 @@
<?php
-/**
+/**
*
* @package dbal
* @version $Id$
-* @copyright (c) 2005 phpBB Group
-* @license http://opensource.org/licenses/gpl-license.php GNU Public License
+* @copyright (c) 2005 phpBB Group
+* @license http://opensource.org/licenses/gpl-license.php GNU Public License
*
*/
@@ -168,7 +168,7 @@ class dbal_mssql extends dbal
/**
* Build LIMIT query
*/
- function _sql_query_limit($query, $total, $offset = 0, $cache_ttl = 0)
+ function _sql_query_limit($query, $total, $offset = 0, $cache_ttl = 0)
{
$this->query_result = false;
@@ -345,7 +345,7 @@ class dbal_mssql extends dbal
}
// Get full error message if possible
- $sql = 'SELECT CAST(description as varchar(255)) as message
+ $sql = 'SELECT CAST(description as varchar(255)) as message
FROM master.dbo.sysmessages
WHERE error = ' . $error['code'];
$result_id = @mssql_query($sql);
diff --git a/phpBB/includes/db/mssql_odbc.php b/phpBB/includes/db/mssql_odbc.php
index 72a424f46d..7722f79952 100644
--- a/phpBB/includes/db/mssql_odbc.php
+++ b/phpBB/includes/db/mssql_odbc.php
@@ -1,10 +1,10 @@
<?php
-/**
+/**
*
* @package dbal
* @version $Id$
-* @copyright (c) 2005 phpBB Group
-* @license http://opensource.org/licenses/gpl-license.php GNU Public License
+* @copyright (c) 2005 phpBB Group
+* @license http://opensource.org/licenses/gpl-license.php GNU Public License
*
*/
@@ -180,7 +180,7 @@ class dbal_mssql_odbc extends dbal
/**
* Build LIMIT query
*/
- function _sql_query_limit($query, $total, $offset = 0, $cache_ttl = 0)
+ function _sql_query_limit($query, $total, $offset = 0, $cache_ttl = 0)
{
$this->query_result = false;
diff --git a/phpBB/includes/db/mysql.php b/phpBB/includes/db/mysql.php
index b3be4f9bd9..2d689f86f9 100644
--- a/phpBB/includes/db/mysql.php
+++ b/phpBB/includes/db/mysql.php
@@ -1,10 +1,10 @@
<?php
-/**
+/**
*
* @package dbal
* @version $Id$
-* @copyright (c) 2005 phpBB Group
-* @license http://opensource.org/licenses/gpl-license.php GNU Public License
+* @copyright (c) 2005 phpBB Group
+* @license http://opensource.org/licenses/gpl-license.php GNU Public License
*
*/
@@ -189,7 +189,7 @@ class dbal_mysql extends dbal
/**
* Build LIMIT query
*/
- function _sql_query_limit($query, $total, $offset = 0, $cache_ttl = 0)
+ function _sql_query_limit($query, $total, $offset = 0, $cache_ttl = 0)
{
$this->query_result = false;
diff --git a/phpBB/includes/db/mysqli.php b/phpBB/includes/db/mysqli.php
index 320171e852..32765d15f7 100644
--- a/phpBB/includes/db/mysqli.php
+++ b/phpBB/includes/db/mysqli.php
@@ -1,10 +1,10 @@
<?php
-/**
+/**
*
* @package dbal
* @version $Id$
-* @copyright (c) 2005 phpBB Group
-* @license http://opensource.org/licenses/gpl-license.php GNU Public License
+* @copyright (c) 2005 phpBB Group
+* @license http://opensource.org/licenses/gpl-license.php GNU Public License
*
*/
@@ -169,7 +169,7 @@ class dbal_mysqli extends dbal
/**
* Build LIMIT query
*/
- function _sql_query_limit($query, $total, $offset = 0, $cache_ttl = 0)
+ function _sql_query_limit($query, $total, $offset = 0, $cache_ttl = 0)
{
$this->query_result = false;
diff --git a/phpBB/includes/db/oracle.php b/phpBB/includes/db/oracle.php
index 18af5cbab0..a63c06e5c0 100644
--- a/phpBB/includes/db/oracle.php
+++ b/phpBB/includes/db/oracle.php
@@ -361,13 +361,13 @@ class dbal_oracle extends dbal
/**
* Build LIMIT query
*/
- function _sql_query_limit($query, $total, $offset = 0, $cache_ttl = 0)
+ function _sql_query_limit($query, $total, $offset = 0, $cache_ttl = 0)
{
- $this->query_result = false;
+ $this->query_result = false;
$query = 'SELECT * FROM (SELECT /*+ FIRST_ROWS */ rownum AS xrownum, a.* FROM (' . $query . ') a WHERE rownum <= ' . ($offset + $total) . ') WHERE xrownum >= ' . $offset;
- return $this->sql_query($query, $cache_ttl);
+ return $this->sql_query($query, $cache_ttl);
}
/**
diff --git a/phpBB/includes/db/postgres.php b/phpBB/includes/db/postgres.php
index 340c32b37a..bb689a7394 100644
--- a/phpBB/includes/db/postgres.php
+++ b/phpBB/includes/db/postgres.php
@@ -1,10 +1,10 @@
<?php
-/**
+/**
*
* @package dbal
* @version $Id$
-* @copyright (c) 2005 phpBB Group
-* @license http://opensource.org/licenses/gpl-license.php GNU Public License
+* @copyright (c) 2005 phpBB Group
+* @license http://opensource.org/licenses/gpl-license.php GNU Public License
*
*/
@@ -217,9 +217,9 @@ class dbal_postgres extends dbal
/**
* Build LIMIT query
*/
- function _sql_query_limit($query, $total, $offset = 0, $cache_ttl = 0)
- {
- $this->query_result = false;
+ function _sql_query_limit($query, $total, $offset = 0, $cache_ttl = 0)
+ {
+ $this->query_result = false;
// if $total is set to 0 we do not want to limit the number of rows
if ($total == 0)
@@ -229,7 +229,7 @@ class dbal_postgres extends dbal
$query .= "\n LIMIT $total OFFSET $offset";
- return $this->sql_query($query, $cache_ttl);
+ return $this->sql_query($query, $cache_ttl);
}
/**
diff --git a/phpBB/includes/db/sqlite.php b/phpBB/includes/db/sqlite.php
index 3248b439c6..5ae36df4f5 100644
--- a/phpBB/includes/db/sqlite.php
+++ b/phpBB/includes/db/sqlite.php
@@ -1,10 +1,10 @@
<?php
-/**
+/**
*
* @package dbal
* @version $Id$
-* @copyright (c) 2005 phpBB Group
-* @license http://opensource.org/licenses/gpl-license.php GNU Public License
+* @copyright (c) 2005 phpBB Group
+* @license http://opensource.org/licenses/gpl-license.php GNU Public License
*
*/
@@ -141,9 +141,9 @@ class dbal_sqlite extends dbal
/**
* Build LIMIT query
*/
- function _sql_query_limit($query, $total, $offset = 0, $cache_ttl = 0)
+ function _sql_query_limit($query, $total, $offset = 0, $cache_ttl = 0)
{
- $this->query_result = false;
+ $this->query_result = false;
// if $total is set to 0 we do not want to limit the number of rows
if ($total == 0)
@@ -153,7 +153,7 @@ class dbal_sqlite extends dbal
$query .= "\n LIMIT " . ((!empty($offset)) ? $offset . ', ' . $total : $total);
- return $this->sql_query($query, $cache_ttl);
+ return $this->sql_query($query, $cache_ttl);
}
/**