diff options
Diffstat (limited to 'phpBB/includes')
-rw-r--r-- | phpBB/includes/acm/acm_file.php | 15 | ||||
-rw-r--r-- | phpBB/includes/db/mysql.php | 10 |
2 files changed, 24 insertions, 1 deletions
diff --git a/phpBB/includes/acm/acm_file.php b/phpBB/includes/acm/acm_file.php index 229685d431..27a126dc84 100644 --- a/phpBB/includes/acm/acm_file.php +++ b/phpBB/includes/acm/acm_file.php @@ -28,7 +28,14 @@ class acm function load() { global $phpEx; - @include($this->cache_dir . 'data_global.' . $phpEx); + if (file_exists($this->cache_dir . 'data_global.' . $phpEx)) + { + @include($this->cache_dir . 'data_global.' . $phpEx); + } + else + { + return false; + } } function unload() @@ -230,7 +237,13 @@ class acm $query = preg_replace('/[\n\r\s\t]+/', ' ', $query); $query_id = 'Cache id #' . count($this->sql_rowset); + if (!file_exists($this->cache_dir . 'sql_' . md5($query) . ".$phpEx")) + { + return false; + } + @include($this->cache_dir . 'sql_' . md5($query) . ".$phpEx"); + if (!isset($expired)) { return FALSE; diff --git a/phpBB/includes/db/mysql.php b/phpBB/includes/db/mysql.php index abfdd576f6..ccaca5e884 100644 --- a/phpBB/includes/db/mysql.php +++ b/phpBB/includes/db/mysql.php @@ -345,6 +345,16 @@ class sql_db $query_id = $this->query_result; } + if ($query_id) + { + // If it is not found within the open queries, we try to free a cached result. ;) + if (!(array_search($query_id, $this->open_queries) > 0)) + { + return false; + } + unset($this->open_queries[array_search($query_id, $this->open_queries)]); + } + return ($query_id) ? @mysql_free_result($query_id) : false; } |