aboutsummaryrefslogtreecommitdiffstats
path: root/phpBB/includes/extension/finder.php
diff options
context:
space:
mode:
authorNils Adermann <naderman@naderman.de>2011-08-29 18:57:21 -0400
committerNils Adermann <naderman@naderman.de>2011-09-29 15:42:48 +0200
commit739e9eb58e7e9b899955b714aa3fc8bbe6a30ebc (patch)
treeac7c96b5c1e4616b2d5ff9e215465d24790034a6 /phpBB/includes/extension/finder.php
parentbd1366d62d018c6b71ea24b1f9915d89d4a240a5 (diff)
downloadforums-739e9eb58e7e9b899955b714aa3fc8bbe6a30ebc.tar
forums-739e9eb58e7e9b899955b714aa3fc8bbe6a30ebc.tar.gz
forums-739e9eb58e7e9b899955b714aa3fc8bbe6a30ebc.tar.bz2
forums-739e9eb58e7e9b899955b714aa3fc8bbe6a30ebc.tar.xz
forums-739e9eb58e7e9b899955b714aa3fc8bbe6a30ebc.zip
[feature/extension-manager] Make the cache variable name for extensions dynamic
Allows multiple instances to use cache simultaneously. PHPBB3-10323
Diffstat (limited to 'phpBB/includes/extension/finder.php')
-rw-r--r--phpBB/includes/extension/finder.php10
1 files changed, 7 insertions, 3 deletions
diff --git a/phpBB/includes/extension/finder.php b/phpBB/includes/extension/finder.php
index 7ba477582c..e94a94c733 100644
--- a/phpBB/includes/extension/finder.php
+++ b/phpBB/includes/extension/finder.php
@@ -26,6 +26,7 @@ class phpbb_extension_finder
protected $phpbb_root_path;
protected $cache;
protected $phpEx;
+ protected $cache_name;
/**
* @var array An associative array, containing all search parameters set in
@@ -48,13 +49,16 @@ class phpbb_extension_finder
* @param string $phpbb_root_path Path to the phpbb root directory
* @param phpbb_cache_driver_interface $cache A cache instance or null
* @param string $phpEx php file extension
+ * @param string $cache_name The name of the cache variable, defaults to
+ * _ext_finder
*/
- public function __construct(phpbb_extension_manager $extension_manager, $phpbb_root_path = '', phpbb_cache_driver_interface $cache = null, $phpEx = '.php')
+ public function __construct(phpbb_extension_manager $extension_manager, $phpbb_root_path = '', phpbb_cache_driver_interface $cache = null, $phpEx = '.php', $cache_name = '_ext_finder')
{
$this->extension_manager = $extension_manager;
$this->phpbb_root_path = $phpbb_root_path;
$this->cache = $cache;
$this->phpEx = $phpEx;
+ $this->cache_name = $cache_name;
$this->query = array(
'default_path' => false,
@@ -66,7 +70,7 @@ class phpbb_extension_finder
'directory' => false,
);
- $this->cached_queries = ($this->cache) ? $this->cache->get('_ext_finder') : false;
+ $this->cached_queries = ($this->cache) ? $this->cache->get($this->cache_name) : false;
}
/**
@@ -284,7 +288,7 @@ class phpbb_extension_finder
if ($cache && $this->cache)
{
$this->cached_queries[$query] = $files;
- $this->cache->put('_ext_finder', $this->cached_queries);
+ $this->cache->put($this->cache_name, $this->cached_queries);
}
return $files;