1
0
mirror of https://github.com/phpbb/phpbb.git synced 2025-08-09 02:06:32 +02:00

- acm_file uses an index pointer to the current row instead of shifting the result array now [Bug #2451]

- all dbals adjusted to use the cache in sql_fetchfield, sql_rowseek, sql_numrows and sql_freeresult [Bug #2451]
- use include_once for dbal.php to at least theoretically allow connections to multiple databases at once
- added a space to an SQL query [Bug #3506]
- detailed information on adding friends/foes [Bugs #2509, #2499]
- e modifier stands for evil, so I removed it ;-)
- corrected progress_bar image filename in imageset.cfg [Bug #3374]


git-svn-id: file:///svn/phpbb/trunk@6225 89ea8834-ac86-4346-8a33-228a782c2dd0
This commit is contained in:
Nils Adermann
2006-08-01 16:14:14 +00:00
parent ced8624b8e
commit 09081e410f
15 changed files with 475 additions and 50 deletions

View File

@@ -22,7 +22,7 @@ if (!defined('SQL_LAYER'))
{
define('SQL_LAYER', 'firebird');
include($phpbb_root_path . 'includes/db/dbal.' . $phpEx);
include_once($phpbb_root_path . 'includes/db/dbal.' . $phpEx);
/**
* Firebird/Interbase Database Abstraction Layer
@@ -93,6 +93,12 @@ class dbal_firebird extends dbal
/**
* Base query method
*
* @param string $query Contains the SQL query which shall be executed
* @param int $cache_ttl Either 0 to avoid caching or the time in seconds which the result shall be kept in cache
* @return mixed When casted to bool the returned value returns true on success and false on failure
*
* @access public
*/
function sql_query($query = '', $cache_ttl = 0)
{
@@ -160,6 +166,18 @@ class dbal_firebird extends dbal
*/
function sql_numrows($query_id = false)
{
global $cache;
if (!$query_id)
{
$query_id = $this->query_result;
}
if (isset($cache->sql_rowset[$query_id]))
{
return $cache->sql_numrows($query_id);
}
return false;
}
@@ -218,6 +236,8 @@ class dbal_firebird extends dbal
*/
function sql_fetchfield($field, $rownum = false, $query_id = false)
{
global $cache;
if (!$query_id)
{
$query_id = $this->query_result;
@@ -230,6 +250,11 @@ class dbal_firebird extends dbal
$this->sql_rowseek($rownum, $query_id);
}
if (isset($cache->sql_rowset[$query_id]))
{
return $cache->sql_fetchfield($query_id, $field);
}
$row = $this->sql_fetchrow($query_id);
return isset($row[$field]) ? $row[$field] : false;
}
@@ -243,11 +268,18 @@ class dbal_firebird extends dbal
*/
function sql_rowseek($rownum, $query_id = false)
{
global $cache;
if (!$query_id)
{
$query_id = $this->query_result;
}
if (isset($cache->sql_rowset[$query_id]))
{
return $cache->sql_rowseek($query_id, $rownum);
}
// We do not fetch the row for rownum == 0 because then the next resultset would be the second row
for ($i = 0; $i < $rownum; $i++)
{
@@ -293,11 +325,18 @@ class dbal_firebird extends dbal
*/
function sql_freeresult($query_id = false)
{
global $cache;
if (!$query_id)
{
$query_id = $this->query_result;
}
if (isset($cache->sql_rowset[$query_id]))
{
return $cache->sql_freeresult($query_id);
}
if (isset($this->open_queries[(int) $query_id]))
{
unset($this->open_queries[(int) $query_id]);