diff options
author | Ludovic Arnaud <ludovic_arnaud@users.sourceforge.net> | 2003-03-12 23:20:57 +0000 |
---|---|---|
committer | Ludovic Arnaud <ludovic_arnaud@users.sourceforge.net> | 2003-03-12 23:20:57 +0000 |
commit | b4fa782d8e2881dbe98dabc73837a10ae962e78a (patch) | |
tree | aac51dd3c47adac14bf3e6f717abd9087df4712b /phpBB/includes/acm | |
parent | b4e026844bf4f158c23c334378a762518784ce06 (diff) | |
download | forums-b4fa782d8e2881dbe98dabc73837a10ae962e78a.tar forums-b4fa782d8e2881dbe98dabc73837a10ae962e78a.tar.gz forums-b4fa782d8e2881dbe98dabc73837a10ae962e78a.tar.bz2 forums-b4fa782d8e2881dbe98dabc73837a10ae962e78a.tar.xz forums-b4fa782d8e2881dbe98dabc73837a10ae962e78a.zip |
D'OH!
(sql cache can expire, now)
git-svn-id: file:///svn/phpbb/trunk@3637 89ea8834-ac86-4346-8a33-228a782c2dd0
Diffstat (limited to 'phpBB/includes/acm')
-rw-r--r-- | phpBB/includes/acm/cache_file.php | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/phpBB/includes/acm/cache_file.php b/phpBB/includes/acm/cache_file.php index 816746e787..7dad56cb31 100644 --- a/phpBB/includes/acm/cache_file.php +++ b/phpBB/includes/acm/cache_file.php @@ -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; |