aboutsummaryrefslogtreecommitdiffstats
path: root/phpBB/includes/db/driver
diff options
context:
space:
mode:
authorIgor Wiedler <igor@wiedler.ch>2012-11-12 11:10:25 +0100
committerIgor Wiedler <igor@wiedler.ch>2012-11-12 11:16:39 +0100
commit0fd3bb170b95bc8c99329e47990e38c038629075 (patch)
tree4222da246667aba91d51a4c2e335c317a766f18a /phpBB/includes/db/driver
parentbf641a7f31f87eb7b88437214315872bff36ae84 (diff)
downloadforums-0fd3bb170b95bc8c99329e47990e38c038629075.tar
forums-0fd3bb170b95bc8c99329e47990e38c038629075.tar.gz
forums-0fd3bb170b95bc8c99329e47990e38c038629075.tar.bz2
forums-0fd3bb170b95bc8c99329e47990e38c038629075.tar.xz
forums-0fd3bb170b95bc8c99329e47990e38c038629075.zip
[ticket/11015] Fixup some things from the big merge
PHPBB3-11015
Diffstat (limited to 'phpBB/includes/db/driver')
-rw-r--r--phpBB/includes/db/driver/driver.php8
-rw-r--r--phpBB/includes/db/driver/firebird.php16
-rw-r--r--phpBB/includes/db/driver/mssql.php16
-rw-r--r--phpBB/includes/db/driver/mssql_odbc.php16
-rw-r--r--phpBB/includes/db/driver/mssqlnative.php17
-rw-r--r--phpBB/includes/db/driver/mysql.php18
-rw-r--r--phpBB/includes/db/driver/mysqli.php18
-rw-r--r--phpBB/includes/db/driver/oracle.php18
-rw-r--r--phpBB/includes/db/driver/postgres.php18
-rw-r--r--phpBB/includes/db/driver/sqlite.php18
10 files changed, 81 insertions, 82 deletions
diff --git a/phpBB/includes/db/driver/driver.php b/phpBB/includes/db/driver/driver.php
index 9692ee71b9..4b831d2f79 100644
--- a/phpBB/includes/db/driver/driver.php
+++ b/phpBB/includes/db/driver/driver.php
@@ -206,7 +206,7 @@ class phpbb_db_driver
$query_id = $this->query_result;
}
- if (isset($cache->sql_rowset[$query_id]))
+ if ($cache->sql_exists($query_id))
{
return $cache->sql_rowseek($rownum, $query_id);
}
@@ -256,7 +256,7 @@ class phpbb_db_driver
$this->sql_rowseek($rownum, $query_id);
}
- if (!is_object($query_id) && isset($cache->sql_rowset[$query_id]))
+ if (!is_object($query_id) && $cache->sql_exists($query_id))
{
return $cache->sql_fetchfield($query_id, $field);
}
@@ -766,8 +766,8 @@ class phpbb_db_driver
// Show complete SQL error and path to administrators only
// Additionally show complete error on installation or if extended debug mode is enabled
- // The DEBUG_EXTRA constant is for development only!
- if ((isset($auth) && $auth->acl_get('a_')) || defined('IN_INSTALL') || defined('DEBUG_EXTRA'))
+ // The DEBUG constant is for development only!
+ if ((isset($auth) && $auth->acl_get('a_')) || defined('IN_INSTALL') || defined('DEBUG'))
{
$message .= ($sql) ? '<br /><br />SQL<br /><br />' . htmlspecialchars($sql) : '';
}
diff --git a/phpBB/includes/db/driver/firebird.php b/phpBB/includes/db/driver/firebird.php
index c793e0a51f..a55175c345 100644
--- a/phpBB/includes/db/driver/firebird.php
+++ b/phpBB/includes/db/driver/firebird.php
@@ -148,13 +148,13 @@ class phpbb_db_driver_firebird extends phpbb_db_driver
global $cache;
// EXPLAIN only in extra debug mode
- if (defined('DEBUG_EXTRA'))
+ if (defined('DEBUG'))
{
$this->sql_report('start', $query);
}
$this->last_query_text = $query;
- $this->query_result = ($cache_ttl && method_exists($cache, 'sql_load')) ? $cache->sql_load($query) : false;
+ $this->query_result = ($cache_ttl) ? $cache->sql_load($query) : false;
$this->sql_add_num_queries($this->query_result);
if ($this->query_result === false)
@@ -249,7 +249,7 @@ class phpbb_db_driver_firebird extends phpbb_db_driver
$this->sql_error($query);
}
- if (defined('DEBUG_EXTRA'))
+ if (defined('DEBUG'))
{
$this->sql_report('stop', $query);
}
@@ -267,17 +267,17 @@ class phpbb_db_driver_firebird extends phpbb_db_driver
}
}
- if ($cache_ttl && method_exists($cache, 'sql_save'))
+ if ($cache_ttl)
{
$this->open_queries[(int) $this->query_result] = $this->query_result;
- $cache->sql_save($query, $this->query_result, $cache_ttl);
+ $this->query_result = $cache->sql_save($query, $this->query_result, $cache_ttl);
}
else if (strpos($query, 'SELECT') === 0 && $this->query_result)
{
$this->open_queries[(int) $this->query_result] = $this->query_result;
}
}
- else if (defined('DEBUG_EXTRA'))
+ else if (defined('DEBUG'))
{
$this->sql_report('fromcache', $query);
}
@@ -330,7 +330,7 @@ class phpbb_db_driver_firebird extends phpbb_db_driver
$query_id = $this->query_result;
}
- if (isset($cache->sql_rowset[$query_id]))
+ if ($cache->sql_exists($query_id))
{
return $cache->sql_fetchrow($query_id);
}
@@ -396,7 +396,7 @@ class phpbb_db_driver_firebird extends phpbb_db_driver
$query_id = $this->query_result;
}
- if (isset($cache->sql_rowset[$query_id]))
+ if ($cache->sql_exists($query_id))
{
return $cache->sql_freeresult($query_id);
}
diff --git a/phpBB/includes/db/driver/mssql.php b/phpBB/includes/db/driver/mssql.php
index e68738f918..04bb75f5ce 100644
--- a/phpBB/includes/db/driver/mssql.php
+++ b/phpBB/includes/db/driver/mssql.php
@@ -137,12 +137,12 @@ class phpbb_db_driver_mssql extends phpbb_db_driver
global $cache;
// EXPLAIN only in extra debug mode
- if (defined('DEBUG_EXTRA'))
+ if (defined('DEBUG'))
{
$this->sql_report('start', $query);
}
- $this->query_result = ($cache_ttl && method_exists($cache, 'sql_load')) ? $cache->sql_load($query) : false;
+ $this->query_result = ($cache_ttl) ? $cache->sql_load($query) : false;
$this->sql_add_num_queries($this->query_result);
if ($this->query_result === false)
@@ -152,7 +152,7 @@ class phpbb_db_driver_mssql extends phpbb_db_driver
$this->sql_error($query);
}
- if (defined('DEBUG_EXTRA'))
+ if (defined('DEBUG'))
{
$this->sql_report('stop', $query);
}
@@ -160,14 +160,14 @@ class phpbb_db_driver_mssql extends phpbb_db_driver
if ($cache_ttl && method_exists($cache, 'sql_save'))
{
$this->open_queries[(int) $this->query_result] = $this->query_result;
- $cache->sql_save($query, $this->query_result, $cache_ttl);
+ $this->query_result = $cache->sql_save($query, $this->query_result, $cache_ttl);
}
else if (strpos($query, 'SELECT') === 0 && $this->query_result)
{
$this->open_queries[(int) $this->query_result] = $this->query_result;
}
}
- else if (defined('DEBUG_EXTRA'))
+ else if (defined('DEBUG'))
{
$this->sql_report('fromcache', $query);
}
@@ -232,7 +232,7 @@ class phpbb_db_driver_mssql extends phpbb_db_driver
$query_id = $this->query_result;
}
- if (isset($cache->sql_rowset[$query_id]))
+ if ($cache->sql_exists($query_id))
{
return $cache->sql_fetchrow($query_id);
}
@@ -269,7 +269,7 @@ class phpbb_db_driver_mssql extends phpbb_db_driver
$query_id = $this->query_result;
}
- if (isset($cache->sql_rowset[$query_id]))
+ if ($cache->sql_exists($query_id))
{
return $cache->sql_rowseek($rownum, $query_id);
}
@@ -308,7 +308,7 @@ class phpbb_db_driver_mssql extends phpbb_db_driver
$query_id = $this->query_result;
}
- if (isset($cache->sql_rowset[$query_id]))
+ if ($cache->sql_exists($query_id))
{
return $cache->sql_freeresult($query_id);
}
diff --git a/phpBB/includes/db/driver/mssql_odbc.php b/phpBB/includes/db/driver/mssql_odbc.php
index 7b35ce3d11..d1f31a6554 100644
--- a/phpBB/includes/db/driver/mssql_odbc.php
+++ b/phpBB/includes/db/driver/mssql_odbc.php
@@ -155,13 +155,13 @@ class phpbb_db_driver_mssql_odbc extends phpbb_db_driver
global $cache;
// EXPLAIN only in extra debug mode
- if (defined('DEBUG_EXTRA'))
+ if (defined('DEBUG'))
{
$this->sql_report('start', $query);
}
$this->last_query_text = $query;
- $this->query_result = ($cache_ttl && method_exists($cache, 'sql_load')) ? $cache->sql_load($query) : false;
+ $this->query_result = ($cache_ttl) ? $cache->sql_load($query) : false;
$this->sql_add_num_queries($this->query_result);
if ($this->query_result === false)
@@ -171,22 +171,22 @@ class phpbb_db_driver_mssql_odbc extends phpbb_db_driver
$this->sql_error($query);
}
- if (defined('DEBUG_EXTRA'))
+ if (defined('DEBUG'))
{
$this->sql_report('stop', $query);
}
- if ($cache_ttl && method_exists($cache, 'sql_save'))
+ if ($cache_ttl)
{
$this->open_queries[(int) $this->query_result] = $this->query_result;
- $cache->sql_save($query, $this->query_result, $cache_ttl);
+ $this->query_result = $cache->sql_save($query, $this->query_result, $cache_ttl);
}
else if (strpos($query, 'SELECT') === 0 && $this->query_result)
{
$this->open_queries[(int) $this->query_result] = $this->query_result;
}
}
- else if (defined('DEBUG_EXTRA'))
+ else if (defined('DEBUG'))
{
$this->sql_report('fromcache', $query);
}
@@ -252,7 +252,7 @@ class phpbb_db_driver_mssql_odbc extends phpbb_db_driver
$query_id = $this->query_result;
}
- if (isset($cache->sql_rowset[$query_id]))
+ if ($cache->sql_exists($query_id))
{
return $cache->sql_fetchrow($query_id);
}
@@ -293,7 +293,7 @@ class phpbb_db_driver_mssql_odbc extends phpbb_db_driver
$query_id = $this->query_result;
}
- if (isset($cache->sql_rowset[$query_id]))
+ if ($cache->sql_exists($query_id))
{
return $cache->sql_freeresult($query_id);
}
diff --git a/phpBB/includes/db/driver/mssqlnative.php b/phpBB/includes/db/driver/mssqlnative.php
index 99b9d7975a..67a019f5a5 100644
--- a/phpBB/includes/db/driver/mssqlnative.php
+++ b/phpBB/includes/db/driver/mssqlnative.php
@@ -216,7 +216,6 @@ class phpbb_db_driver_mssqlnative extends phpbb_db_driver
$this->server = $sqlserver . (($port) ? $port_delimiter . $port : '');
//connect to database
- error_reporting(E_ALL);
$this->db_connect_id = sqlsrv_connect($this->server, array(
'Database' => $this->dbname,
'UID' => $this->user,
@@ -310,13 +309,13 @@ class phpbb_db_driver_mssqlnative extends phpbb_db_driver
global $cache;
// EXPLAIN only in extra debug mode
- if (defined('DEBUG_EXTRA'))
+ if (defined('DEBUG'))
{
$this->sql_report('start', $query);
}
$this->last_query_text = $query;
- $this->query_result = ($cache_ttl && method_exists($cache, 'sql_load')) ? $cache->sql_load($query) : false;
+ $this->query_result = ($cache_ttl) ? $cache->sql_load($query) : false;
$this->sql_add_num_queries($this->query_result);
if ($this->query_result === false)
@@ -328,22 +327,22 @@ class phpbb_db_driver_mssqlnative extends phpbb_db_driver
// reset options for next query
$this->query_options = array();
- if (defined('DEBUG_EXTRA'))
+ if (defined('DEBUG'))
{
$this->sql_report('stop', $query);
}
- if ($cache_ttl && method_exists($cache, 'sql_save'))
+ if ($cache_ttl)
{
$this->open_queries[(int) $this->query_result] = $this->query_result;
- $cache->sql_save($query, $this->query_result, $cache_ttl);
+ $this->query_result = $cache->sql_save($query, $this->query_result, $cache_ttl);
}
else if (strpos($query, 'SELECT') === 0 && $this->query_result)
{
$this->open_queries[(int) $this->query_result] = $this->query_result;
}
}
- else if (defined('DEBUG_EXTRA'))
+ else if (defined('DEBUG'))
{
$this->sql_report('fromcache', $query);
}
@@ -416,7 +415,7 @@ class phpbb_db_driver_mssqlnative extends phpbb_db_driver
$query_id = $this->query_result;
}
- if (isset($cache->sql_rowset[$query_id]))
+ if ($cache->sql_exists($query_id))
{
return $cache->sql_fetchrow($query_id);
}
@@ -476,7 +475,7 @@ class phpbb_db_driver_mssqlnative extends phpbb_db_driver
$query_id = $this->query_result;
}
- if (isset($cache->sql_rowset[$query_id]))
+ if ($cache->sql_exists($query_id))
{
return $cache->sql_freeresult($query_id);
}
diff --git a/phpBB/includes/db/driver/mysql.php b/phpBB/includes/db/driver/mysql.php
index 987691341a..f8c2be2366 100644
--- a/phpBB/includes/db/driver/mysql.php
+++ b/phpBB/includes/db/driver/mysql.php
@@ -165,12 +165,12 @@ class phpbb_db_driver_mysql extends phpbb_db_driver
global $cache;
// EXPLAIN only in extra debug mode
- if (defined('DEBUG_EXTRA'))
+ if (defined('DEBUG'))
{
$this->sql_report('start', $query);
}
- $this->query_result = ($cache_ttl && method_exists($cache, 'sql_load')) ? $cache->sql_load($query) : false;
+ $this->query_result = ($cache_ttl) ? $cache->sql_load($query) : false;
$this->sql_add_num_queries($this->query_result);
if ($this->query_result === false)
@@ -180,22 +180,22 @@ class phpbb_db_driver_mysql extends phpbb_db_driver
$this->sql_error($query);
}
- if (defined('DEBUG_EXTRA'))
+ if (defined('DEBUG'))
{
$this->sql_report('stop', $query);
}
- if ($cache_ttl && method_exists($cache, 'sql_save'))
+ if ($cache_ttl)
{
$this->open_queries[(int) $this->query_result] = $this->query_result;
- $cache->sql_save($query, $this->query_result, $cache_ttl);
+ $this->query_result = $cache->sql_save($query, $this->query_result, $cache_ttl);
}
else if (strpos($query, 'SELECT') === 0 && $this->query_result)
{
$this->open_queries[(int) $this->query_result] = $this->query_result;
}
}
- else if (defined('DEBUG_EXTRA'))
+ else if (defined('DEBUG'))
{
$this->sql_report('fromcache', $query);
}
@@ -247,7 +247,7 @@ class phpbb_db_driver_mysql extends phpbb_db_driver
$query_id = $this->query_result;
}
- if (isset($cache->sql_rowset[$query_id]))
+ if ($cache->sql_exists($query_id))
{
return $cache->sql_fetchrow($query_id);
}
@@ -268,7 +268,7 @@ class phpbb_db_driver_mysql extends phpbb_db_driver
$query_id = $this->query_result;
}
- if (isset($cache->sql_rowset[$query_id]))
+ if ($cache->sql_exists($query_id))
{
return $cache->sql_rowseek($rownum, $query_id);
}
@@ -296,7 +296,7 @@ class phpbb_db_driver_mysql extends phpbb_db_driver
$query_id = $this->query_result;
}
- if (isset($cache->sql_rowset[$query_id]))
+ if ($cache->sql_exists($query_id))
{
return $cache->sql_freeresult($query_id);
}
diff --git a/phpBB/includes/db/driver/mysqli.php b/phpBB/includes/db/driver/mysqli.php
index c473c7fe99..0cc3eb359a 100644
--- a/phpBB/includes/db/driver/mysqli.php
+++ b/phpBB/includes/db/driver/mysqli.php
@@ -172,12 +172,12 @@ class phpbb_db_driver_mysqli extends phpbb_db_driver
global $cache;
// EXPLAIN only in extra debug mode
- if (defined('DEBUG_EXTRA'))
+ if (defined('DEBUG'))
{
$this->sql_report('start', $query);
}
- $this->query_result = ($cache_ttl && method_exists($cache, 'sql_load')) ? $cache->sql_load($query) : false;
+ $this->query_result = ($cache_ttl) ? $cache->sql_load($query) : false;
$this->sql_add_num_queries($this->query_result);
if ($this->query_result === false)
@@ -187,17 +187,17 @@ class phpbb_db_driver_mysqli extends phpbb_db_driver
$this->sql_error($query);
}
- if (defined('DEBUG_EXTRA'))
+ if (defined('DEBUG'))
{
$this->sql_report('stop', $query);
}
- if ($cache_ttl && method_exists($cache, 'sql_save'))
+ if ($cache_ttl)
{
- $cache->sql_save($query, $this->query_result, $cache_ttl);
+ $this->query_result = $cache->sql_save($query, $this->query_result, $cache_ttl);
}
}
- else if (defined('DEBUG_EXTRA'))
+ else if (defined('DEBUG'))
{
$this->sql_report('fromcache', $query);
}
@@ -249,7 +249,7 @@ class phpbb_db_driver_mysqli extends phpbb_db_driver
$query_id = $this->query_result;
}
- if (!is_object($query_id) && isset($cache->sql_rowset[$query_id]))
+ if (!is_object($query_id) && $cache->sql_exists($query_id))
{
return $cache->sql_fetchrow($query_id);
}
@@ -276,7 +276,7 @@ class phpbb_db_driver_mysqli extends phpbb_db_driver
$query_id = $this->query_result;
}
- if (!is_object($query_id) && isset($cache->sql_rowset[$query_id]))
+ if (!is_object($query_id) && $cache->sql_exists($query_id))
{
return $cache->sql_rowseek($rownum, $query_id);
}
@@ -304,7 +304,7 @@ class phpbb_db_driver_mysqli extends phpbb_db_driver
$query_id = $this->query_result;
}
- if (!is_object($query_id) && isset($cache->sql_rowset[$query_id]))
+ if (!is_object($query_id) && $cache->sql_exists($query_id))
{
return $cache->sql_freeresult($query_id);
}
diff --git a/phpBB/includes/db/driver/oracle.php b/phpBB/includes/db/driver/oracle.php
index 25803e57bd..d8474694e3 100644
--- a/phpBB/includes/db/driver/oracle.php
+++ b/phpBB/includes/db/driver/oracle.php
@@ -234,13 +234,13 @@ class phpbb_db_driver_oracle extends phpbb_db_driver
global $cache;
// EXPLAIN only in extra debug mode
- if (defined('DEBUG_EXTRA'))
+ if (defined('DEBUG'))
{
$this->sql_report('start', $query);
}
$this->last_query_text = $query;
- $this->query_result = ($cache_ttl && method_exists($cache, 'sql_load')) ? $cache->sql_load($query) : false;
+ $this->query_result = ($cache_ttl) ? $cache->sql_load($query) : false;
$this->sql_add_num_queries($this->query_result);
if ($this->query_result === false)
@@ -411,22 +411,22 @@ class phpbb_db_driver_oracle extends phpbb_db_driver
}
}
- if (defined('DEBUG_EXTRA'))
+ if (defined('DEBUG'))
{
$this->sql_report('stop', $query);
}
- if ($cache_ttl && method_exists($cache, 'sql_save'))
+ if ($cache_ttl)
{
$this->open_queries[(int) $this->query_result] = $this->query_result;
- $cache->sql_save($query, $this->query_result, $cache_ttl);
+ $this->query_result = $cache->sql_save($query, $this->query_result, $cache_ttl);
}
else if (strpos($query, 'SELECT') === 0 && $this->query_result)
{
$this->open_queries[(int) $this->query_result] = $this->query_result;
}
}
- else if (defined('DEBUG_EXTRA'))
+ else if (defined('DEBUG'))
{
$this->sql_report('fromcache', $query);
}
@@ -471,7 +471,7 @@ class phpbb_db_driver_oracle extends phpbb_db_driver
$query_id = $this->query_result;
}
- if (isset($cache->sql_rowset[$query_id]))
+ if ($cache->sql_exists($query_id))
{
return $cache->sql_fetchrow($query_id);
}
@@ -523,7 +523,7 @@ class phpbb_db_driver_oracle extends phpbb_db_driver
$query_id = $this->query_result;
}
- if (isset($cache->sql_rowset[$query_id]))
+ if ($cache->sql_exists($query_id))
{
return $cache->sql_rowseek($rownum, $query_id);
}
@@ -592,7 +592,7 @@ class phpbb_db_driver_oracle extends phpbb_db_driver
$query_id = $this->query_result;
}
- if (isset($cache->sql_rowset[$query_id]))
+ if ($cache->sql_exists($query_id))
{
return $cache->sql_freeresult($query_id);
}
diff --git a/phpBB/includes/db/driver/postgres.php b/phpBB/includes/db/driver/postgres.php
index 3f54936d23..147ecd04d9 100644
--- a/phpBB/includes/db/driver/postgres.php
+++ b/phpBB/includes/db/driver/postgres.php
@@ -187,13 +187,13 @@ class phpbb_db_driver_postgres extends phpbb_db_driver
global $cache;
// EXPLAIN only in extra debug mode
- if (defined('DEBUG_EXTRA'))
+ if (defined('DEBUG'))
{
$this->sql_report('start', $query);
}
$this->last_query_text = $query;
- $this->query_result = ($cache_ttl && method_exists($cache, 'sql_load')) ? $cache->sql_load($query) : false;
+ $this->query_result = ($cache_ttl) ? $cache->sql_load($query) : false;
$this->sql_add_num_queries($this->query_result);
if ($this->query_result === false)
@@ -203,22 +203,22 @@ class phpbb_db_driver_postgres extends phpbb_db_driver
$this->sql_error($query);
}
- if (defined('DEBUG_EXTRA'))
+ if (defined('DEBUG'))
{
$this->sql_report('stop', $query);
}
- if ($cache_ttl && method_exists($cache, 'sql_save'))
+ if ($cache_ttl)
{
$this->open_queries[(int) $this->query_result] = $this->query_result;
- $cache->sql_save($query, $this->query_result, $cache_ttl);
+ $this->query_result = $cache->sql_save($query, $this->query_result, $cache_ttl);
}
else if (strpos($query, 'SELECT') === 0 && $this->query_result)
{
$this->open_queries[(int) $this->query_result] = $this->query_result;
}
}
- else if (defined('DEBUG_EXTRA'))
+ else if (defined('DEBUG'))
{
$this->sql_report('fromcache', $query);
}
@@ -278,7 +278,7 @@ class phpbb_db_driver_postgres extends phpbb_db_driver
$query_id = $this->query_result;
}
- if (isset($cache->sql_rowset[$query_id]))
+ if ($cache->sql_exists($query_id))
{
return $cache->sql_fetchrow($query_id);
}
@@ -299,7 +299,7 @@ class phpbb_db_driver_postgres extends phpbb_db_driver
$query_id = $this->query_result;
}
- if (isset($cache->sql_rowset[$query_id]))
+ if ($cache->sql_exists($query_id))
{
return $cache->sql_rowseek($rownum, $query_id);
}
@@ -348,7 +348,7 @@ class phpbb_db_driver_postgres extends phpbb_db_driver
$query_id = $this->query_result;
}
- if (isset($cache->sql_rowset[$query_id]))
+ if ($cache->sql_exists($query_id))
{
return $cache->sql_freeresult($query_id);
}
diff --git a/phpBB/includes/db/driver/sqlite.php b/phpBB/includes/db/driver/sqlite.php
index 363f26da2b..0b09fa758d 100644
--- a/phpBB/includes/db/driver/sqlite.php
+++ b/phpBB/includes/db/driver/sqlite.php
@@ -110,12 +110,12 @@ class phpbb_db_driver_sqlite extends phpbb_db_driver
global $cache;
// EXPLAIN only in extra debug mode
- if (defined('DEBUG_EXTRA'))
+ if (defined('DEBUG'))
{
$this->sql_report('start', $query);
}
- $this->query_result = ($cache_ttl && method_exists($cache, 'sql_load')) ? $cache->sql_load($query) : false;
+ $this->query_result = ($cache_ttl) ? $cache->sql_load($query) : false;
$this->sql_add_num_queries($this->query_result);
if ($this->query_result === false)
@@ -125,22 +125,22 @@ class phpbb_db_driver_sqlite extends phpbb_db_driver
$this->sql_error($query);
}
- if (defined('DEBUG_EXTRA'))
+ if (defined('DEBUG'))
{
$this->sql_report('stop', $query);
}
- if ($cache_ttl && method_exists($cache, 'sql_save'))
+ if ($cache_ttl)
{
$this->open_queries[(int) $this->query_result] = $this->query_result;
- $cache->sql_save($query, $this->query_result, $cache_ttl);
+ $this->query_result = $cache->sql_save($query, $this->query_result, $cache_ttl);
}
else if (strpos($query, 'SELECT') === 0 && $this->query_result)
{
$this->open_queries[(int) $this->query_result] = $this->query_result;
}
}
- else if (defined('DEBUG_EXTRA'))
+ else if (defined('DEBUG'))
{
$this->sql_report('fromcache', $query);
}
@@ -191,7 +191,7 @@ class phpbb_db_driver_sqlite extends phpbb_db_driver
$query_id = $this->query_result;
}
- if (isset($cache->sql_rowset[$query_id]))
+ if ($cache->sql_exists($query_id))
{
return $cache->sql_fetchrow($query_id);
}
@@ -212,7 +212,7 @@ class phpbb_db_driver_sqlite extends phpbb_db_driver
$query_id = $this->query_result;
}
- if (isset($cache->sql_rowset[$query_id]))
+ if ($cache->sql_exists($query_id))
{
return $cache->sql_rowseek($rownum, $query_id);
}
@@ -240,7 +240,7 @@ class phpbb_db_driver_sqlite extends phpbb_db_driver
$query_id = $this->query_result;
}
- if (isset($cache->sql_rowset[$query_id]))
+ if ($cache->sql_exists($query_id))
{
return $cache->sql_freeresult($query_id);
}