mirror of
https://github.com/phpbb/phpbb.git
synced 2025-06-27 21:58:52 +00:00
D'OH!
(sql cache can expire, now) git-svn-id: file:///svn/phpbb/trunk@3637 89ea8834-ac86-4346-8a33-228a782c2dd0
This commit is contained in:
parent
b4e026844b
commit
b4fa782d8e
1 changed files with 5 additions and 3 deletions
|
@ -166,16 +166,18 @@ class acm
|
|||
return 'array(' . implode(',', $lines) . ')';
|
||||
}
|
||||
|
||||
function sql_load($query)
|
||||
function sql_load($query, $expire_time)
|
||||
{
|
||||
global $db, $phpEx;
|
||||
@include($this->cache_dir . md5($query) . '.' . $phpEx);
|
||||
|
||||
if (!isset($rowset))
|
||||
$filemtime = intval(@filemtime($this->cache_dir . md5($query) . '.' . $phpEx));
|
||||
if (time() - $filemtime > $expire_time)
|
||||
{
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
include($this->cache_dir . md5($query) . '.' . $phpEx);
|
||||
|
||||
$query_id = 'Cache id #' . count($this->sql_rowset);
|
||||
$this->sql_rowset[$query_id] = $rowset;
|
||||
$db->query_result = $query_id;
|
||||
|
|
Loading…
Add table
Reference in a new issue