diff options
| author | Nils Adermann <naderman@naderman.de> | 2011-08-29 18:57:21 -0400 |
|---|---|---|
| committer | Nils Adermann <naderman@naderman.de> | 2011-09-29 15:42:48 +0200 |
| commit | 739e9eb58e7e9b899955b714aa3fc8bbe6a30ebc (patch) | |
| tree | ac7c96b5c1e4616b2d5ff9e215465d24790034a6 /phpBB/includes/extension/manager.php | |
| parent | bd1366d62d018c6b71ea24b1f9915d89d4a240a5 (diff) | |
| download | forums-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/manager.php')
| -rw-r--r-- | phpBB/includes/extension/manager.php | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/phpBB/includes/extension/manager.php b/phpBB/includes/extension/manager.php index 45250e623a..443eaf011b 100644 --- a/phpBB/includes/extension/manager.php +++ b/phpBB/includes/extension/manager.php @@ -27,6 +27,7 @@ class phpbb_extension_manager protected $extensions; protected $extension_table; protected $phpbb_root_path; + protected $cache_name; /** * Creates a manager and loads information from database @@ -36,16 +37,18 @@ class phpbb_extension_manager * @param string $phpbb_root_path Path to the phpbb includes directory. * @param string $phpEx php file extension * @param phpbb_cache_driver_interface $cache A cache instance or null + * @param string $cache_name The name of the cache variable, defaults to _ext */ - public function __construct(dbal $db, $extension_table, $phpbb_root_path, $phpEx = '.php', phpbb_cache_driver_interface $cache = null) + public function __construct(dbal $db, $extension_table, $phpbb_root_path, $phpEx = '.php', phpbb_cache_driver_interface $cache = null, $cache_name = '_ext') { $this->phpbb_root_path = $phpbb_root_path; $this->db = $db; $this->cache = $cache; $this->phpEx = $phpEx; $this->extension_table = $extension_table; + $this->cache_name = $cache_name; - $this->extensions = $this->cache->get('_ext'); + $this->extensions = $this->cache->get($this->cache_name); if ($this->extensions === false) { @@ -75,7 +78,7 @@ class phpbb_extension_manager } ksort($this->extensions); - $this->cache->put('_ext', $this->extensions); + $this->cache->put($this->cache_name, $this->extensions); } /** @@ -356,6 +359,6 @@ class phpbb_extension_manager */ public function get_finder() { - return new phpbb_extension_finder($this, $this->phpbb_root_path, $this->cache, $this->phpEx); + return new phpbb_extension_finder($this, $this->phpbb_root_path, $this->cache, $this->phpEx, $this->cache_name . '_finder'); } } |
