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;