mirror of
https://github.com/phpbb/phpbb.git
synced 2025-07-31 05:50:42 +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:
@@ -19,6 +19,7 @@ class acm
|
||||
var $is_modified = false;
|
||||
|
||||
var $sql_rowset = array();
|
||||
var $sql_row_pointer = array();
|
||||
|
||||
/**
|
||||
* Set cache path
|
||||
@@ -56,6 +57,7 @@ class acm
|
||||
unset($this->vars);
|
||||
unset($this->var_expires);
|
||||
unset($this->sql_rowset);
|
||||
unset($this->sql_row_pointer);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -311,6 +313,8 @@ class acm
|
||||
return false;
|
||||
}
|
||||
|
||||
$this->sql_row_pointer[$query_id] = 0;
|
||||
|
||||
return $query_id;
|
||||
}
|
||||
|
||||
@@ -331,6 +335,7 @@ class acm
|
||||
$lines = array();
|
||||
$query_id = sizeof($this->sql_rowset);
|
||||
$this->sql_rowset[$query_id] = array();
|
||||
$this->sql_row_pointer[$query_id] = 0;
|
||||
|
||||
while ($row = $db->sql_fetchrow($query_result))
|
||||
{
|
||||
@@ -361,7 +366,63 @@ class acm
|
||||
*/
|
||||
function sql_fetchrow($query_id)
|
||||
{
|
||||
return array_shift($this->sql_rowset[$query_id]);
|
||||
if ($this->sql_row_pointer[$query_id] < sizeof($this->sql_rowset[$query_id]))
|
||||
{
|
||||
return $this->sql_rowset[$query_id][$this->sql_row_pointer[$query_id]++];
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* Fetch the number of rows from cache (database)
|
||||
*/
|
||||
function sql_numrows($query_id)
|
||||
{
|
||||
return sizeof($this->sql_rowset[$query_id]);
|
||||
}
|
||||
|
||||
/**
|
||||
* Fetch a field from the current row of a cached database result (database)
|
||||
*/
|
||||
function sql_fetchfield($query_id, $field)
|
||||
{
|
||||
if ($this->sql_row_pointer[$query_id] < sizeof($this->sql_rowset[$query_id]))
|
||||
{
|
||||
return $this->sql_rowset[$query_id][$this->sql_row_pointer[$query_id]];
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* Seek a specific row in an a cached database result (database)
|
||||
*/
|
||||
function sql_rowseek($query_id, $rownum)
|
||||
{
|
||||
if ($rownum >= sizeof($this->sql_rowset[$query_id]))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
$this->sql_row_pointer[$query_id] = $rownum;
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* Free memory used for a cached database result (database)
|
||||
*/
|
||||
function sql_freeresult($query_id)
|
||||
{
|
||||
if (!isset($this->sql_rowset[$query_id]))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
unset($this->sql_rowset[$query_id]);
|
||||
unset($this->sql_row_pointer[$query_id]);
|
||||
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user