1
0
mirror of https://github.com/phpbb/phpbb.git synced 2025-07-31 22:10:45 +02:00

Merge pull request #932 from EXreaction/ticket/10875

Ticket/10875
This commit is contained in:
Nils Adermann
2012-08-14 02:30:49 -07:00
18 changed files with 103 additions and 42 deletions

View File

@@ -364,7 +364,7 @@ class phpbb_cache_driver_file extends phpbb_cache_driver_base
/**
* Save sql query
*/
function sql_save($query, &$query_result, $ttl)
function sql_save($query, $query_result, $ttl)
{
global $db;
@@ -385,6 +385,8 @@ class phpbb_cache_driver_file extends phpbb_cache_driver_base
{
$query_result = $query_id;
}
return $query_id;
}
/**

View File

@@ -75,7 +75,7 @@ interface phpbb_cache_driver_interface
/**
* Save sql query
*/
public function sql_save($query, &$query_result, $ttl);
public function sql_save($query, $query_result, $ttl);
/**
* Ceck if a given sql query exist in cache

View File

@@ -280,7 +280,7 @@ class phpbb_cache_driver_memory extends phpbb_cache_driver_base
/**
* Save sql query
*/
function sql_save($query, &$query_result, $ttl)
function sql_save($query, $query_result, $ttl)
{
global $db;
@@ -335,6 +335,8 @@ class phpbb_cache_driver_memory extends phpbb_cache_driver_base
$this->_write('sql_' . $hash, $this->sql_rowset[$query_id], $ttl);
$query_result = $query_id;
return $query_id;
}
/**

View File

@@ -107,7 +107,7 @@ class phpbb_cache_driver_null extends phpbb_cache_driver_base
/**
* Save sql query
*/
function sql_save($query, &$query_result, $ttl)
function sql_save($query, $query_result, $ttl)
{
}

View File

@@ -206,7 +206,7 @@ class dbal
$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 dbal
$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);
}

View File

@@ -272,7 +272,7 @@ class dbal_firebird extends dbal
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)
{
@@ -332,7 +332,7 @@ class dbal_firebird extends dbal
$query_id = $this->query_result;
}
if (isset($cache->sql_rowset[$query_id]))
if ($cache->sql_exists($query_id))
{
return $cache->sql_fetchrow($query_id);
}
@@ -398,7 +398,7 @@ class dbal_firebird extends dbal
$query_id = $this->query_result;
}
if (isset($cache->sql_rowset[$query_id]))
if ($cache->sql_exists($query_id))
{
return $cache->sql_freeresult($query_id);
}

View File

@@ -162,7 +162,7 @@ class dbal_mssql extends dbal
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)
{
@@ -234,7 +234,7 @@ class dbal_mssql extends dbal
$query_id = $this->query_result;
}
if (isset($cache->sql_rowset[$query_id]))
if ($cache->sql_exists($query_id))
{
return $cache->sql_fetchrow($query_id);
}
@@ -271,7 +271,7 @@ class dbal_mssql extends dbal
$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);
}
@@ -310,7 +310,7 @@ class dbal_mssql extends dbal
$query_id = $this->query_result;
}
if (isset($cache->sql_rowset[$query_id]))
if ($cache->sql_exists($query_id))
{
return $cache->sql_freeresult($query_id);
}

View File

@@ -181,7 +181,7 @@ class dbal_mssql_odbc extends dbal
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)
{
@@ -254,7 +254,7 @@ class dbal_mssql_odbc extends dbal
$query_id = $this->query_result;
}
if (isset($cache->sql_rowset[$query_id]))
if ($cache->sql_exists($query_id))
{
return $cache->sql_fetchrow($query_id);
}
@@ -295,7 +295,7 @@ class dbal_mssql_odbc extends dbal
$query_id = $this->query_result;
}
if (isset($cache->sql_rowset[$query_id]))
if ($cache->sql_exists($query_id))
{
return $cache->sql_freeresult($query_id);
}

View File

@@ -338,7 +338,7 @@ class dbal_mssqlnative extends dbal
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)
{
@@ -418,7 +418,7 @@ class dbal_mssqlnative extends dbal
$query_id = $this->query_result;
}
if (isset($cache->sql_rowset[$query_id]))
if ($cache->sql_exists($query_id))
{
return $cache->sql_fetchrow($query_id);
}
@@ -478,7 +478,7 @@ class dbal_mssqlnative extends dbal
$query_id = $this->query_result;
}
if (isset($cache->sql_rowset[$query_id]))
if ($cache->sql_exists($query_id))
{
return $cache->sql_freeresult($query_id);
}

View File

@@ -190,7 +190,7 @@ class dbal_mysql extends dbal
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)
{
@@ -249,7 +249,7 @@ class dbal_mysql extends dbal
$query_id = $this->query_result;
}
if (isset($cache->sql_rowset[$query_id]))
if ($cache->sql_exists($query_id))
{
return $cache->sql_fetchrow($query_id);
}
@@ -270,7 +270,7 @@ class dbal_mysql extends dbal
$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);
}
@@ -298,7 +298,7 @@ class dbal_mysql extends dbal
$query_id = $this->query_result;
}
if (isset($cache->sql_rowset[$query_id]))
if ($cache->sql_exists($query_id))
{
return $cache->sql_freeresult($query_id);
}

View File

@@ -196,7 +196,7 @@ class dbal_mysqli extends dbal
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'))
@@ -251,7 +251,7 @@ class dbal_mysqli extends dbal
$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);
}
@@ -278,7 +278,7 @@ class dbal_mysqli extends dbal
$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);
}
@@ -306,7 +306,7 @@ class dbal_mysqli extends dbal
$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);
}

View File

@@ -421,7 +421,7 @@ class dbal_oracle extends dbal
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)
{
@@ -473,7 +473,7 @@ class dbal_oracle extends dbal
$query_id = $this->query_result;
}
if (isset($cache->sql_rowset[$query_id]))
if ($cache->sql_exists($query_id))
{
return $cache->sql_fetchrow($query_id);
}
@@ -525,7 +525,7 @@ class dbal_oracle extends dbal
$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);
}
@@ -594,7 +594,7 @@ class dbal_oracle extends dbal
$query_id = $this->query_result;
}
if (isset($cache->sql_rowset[$query_id]))
if ($cache->sql_exists($query_id))
{
return $cache->sql_freeresult($query_id);
}

View File

@@ -218,7 +218,7 @@ class dbal_postgres extends dbal
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)
{
@@ -285,7 +285,7 @@ class dbal_postgres extends dbal
$query_id = $this->query_result;
}
if (isset($cache->sql_rowset[$query_id]))
if ($cache->sql_exists($query_id))
{
return $cache->sql_fetchrow($query_id);
}
@@ -306,7 +306,7 @@ class dbal_postgres extends dbal
$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);
}
@@ -355,7 +355,7 @@ class dbal_postgres extends dbal
$query_id = $this->query_result;
}
if (isset($cache->sql_rowset[$query_id]))
if ($cache->sql_exists($query_id))
{
return $cache->sql_freeresult($query_id);
}

View File

@@ -135,7 +135,7 @@ class dbal_sqlite extends dbal
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)
{
@@ -193,7 +193,7 @@ class dbal_sqlite extends dbal
$query_id = $this->query_result;
}
if (isset($cache->sql_rowset[$query_id]))
if ($cache->sql_exists($query_id))
{
return $cache->sql_fetchrow($query_id);
}
@@ -214,7 +214,7 @@ class dbal_sqlite extends dbal
$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);
}
@@ -242,7 +242,7 @@ class dbal_sqlite extends dbal
$query_id = $this->query_result;
}
if (isset($cache->sql_rowset[$query_id]))
if ($cache->sql_exists($query_id))
{
return $cache->sql_freeresult($query_id);
}