diff options
| author | javiexin <javiexin@gmail.com> | 2017-03-09 16:12:25 +0100 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2017-03-09 16:12:25 +0100 |
| commit | bd12504f6cf03b36821a5cea2bf77a419496dcdb (patch) | |
| tree | d30cc3506e1bbdc284dc7cca910c5dac6b927ae0 /phpBB/phpbb/cache/driver/memory.php | |
| parent | 96a90d3f81c1fcce3834ee72b7d1b9f76aa9354c (diff) | |
| parent | 3e9f12d12d7dbdd2cee39425e81b5fdf66fcfbc8 (diff) | |
| download | forums-bd12504f6cf03b36821a5cea2bf77a419496dcdb.tar forums-bd12504f6cf03b36821a5cea2bf77a419496dcdb.tar.gz forums-bd12504f6cf03b36821a5cea2bf77a419496dcdb.tar.bz2 forums-bd12504f6cf03b36821a5cea2bf77a419496dcdb.tar.xz forums-bd12504f6cf03b36821a5cea2bf77a419496dcdb.zip | |
Merge branch '3.2.x' into ticket/15068
Diffstat (limited to 'phpBB/phpbb/cache/driver/memory.php')
| -rw-r--r-- | phpBB/phpbb/cache/driver/memory.php | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/phpBB/phpbb/cache/driver/memory.php b/phpBB/phpbb/cache/driver/memory.php index 0b0e323e3d..cc03804705 100644 --- a/phpBB/phpbb/cache/driver/memory.php +++ b/phpBB/phpbb/cache/driver/memory.php @@ -25,9 +25,9 @@ abstract class memory extends \phpbb\cache\driver\base */ function __construct() { - global $phpbb_root_path, $dbname, $table_prefix; + global $phpbb_root_path, $dbname, $table_prefix, $phpbb_container; - $this->cache_dir = $phpbb_root_path . 'cache/'; + $this->cache_dir = $phpbb_container->getParameter('core.cache_dir'); $this->key_prefix = substr(md5($dbname . $table_prefix), 0, 8) . '_'; if (!isset($this->extension) || !extension_loaded($this->extension)) @@ -81,9 +81,10 @@ abstract class memory extends \phpbb\cache\driver\base */ function tidy() { - // cache has auto GC, no need to have any code here :) + global $config; - set_config('cache_last_gc', time(), true); + // cache has auto GC, no need to have any code here :) + $config->set('cache_last_gc', time(), false); } /** @@ -203,7 +204,7 @@ abstract class memory extends \phpbb\cache\driver\base { // Remove extra spaces and tabs $query = preg_replace('/[\n\r\s\t]+/', ' ', $query); - $hash = md5($query); + $query_id = md5($query); // determine which tables this query belongs to // Some queries use backticks, namely the get_database_size() query @@ -244,14 +245,13 @@ abstract class memory extends \phpbb\cache\driver\base $temp = array(); } - $temp[$hash] = true; + $temp[$query_id] = true; // This must never expire $this->_write('sql_' . $table_name, $temp, 0); } // store them in the right place - $query_id = sizeof($this->sql_rowset); $this->sql_rowset[$query_id] = array(); $this->sql_row_pointer[$query_id] = 0; @@ -261,7 +261,7 @@ abstract class memory extends \phpbb\cache\driver\base } $db->sql_freeresult($query_result); - $this->_write('sql_' . $hash, $this->sql_rowset[$query_id], $ttl); + $this->_write('sql_' . $query_id, $this->sql_rowset[$query_id], $ttl); return $query_id; } |
