From d45c681b40cf0415ce49b2cd7f3f1083e84b367c Mon Sep 17 00:00:00 2001 From: Joas Schilling Date: Tue, 6 May 2014 17:50:46 +0200 Subject: [ticket/12508] Fix usages of the finder PHPBB3-12508 --- phpBB/phpbb/extension/manager.php | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) (limited to 'phpBB/phpbb/extension/manager.php') diff --git a/phpBB/phpbb/extension/manager.php b/phpBB/phpbb/extension/manager.php index cd7289e085..88404b025e 100644 --- a/phpBB/phpbb/extension/manager.php +++ b/phpBB/phpbb/extension/manager.php @@ -534,10 +534,20 @@ class manager /** * Instantiates a \phpbb\extension\finder. * + * @param bool $use_all_available Should we load all extensions, or just enabled ones * @return \phpbb\extension\finder An extension finder instance */ - public function get_finder() + public function get_finder($use_all_available = false) { - return new \phpbb\extension\finder($this, $this->filesystem, $this->phpbb_root_path, $this->cache, $this->php_ext, $this->cache_name . '_finder'); + $finder = new \phpbb\extension\finder($this->filesystem, $this->phpbb_root_path, $this->cache, $this->php_ext, $this->cache_name . '_finder'); + if ($use_all_available) + { + $finder->set_extensions($this->all_available()); + } + else + { + $finder->set_extensions($this->all_enabled()); + } + return $finder; } } -- cgit v1.2.1 From 183492b01931dec5052e2087f70fa432a2f51b03 Mon Sep 17 00:00:00 2001 From: Joas Schilling Date: Tue, 6 May 2014 18:27:30 +0200 Subject: [ticket/12508] Move \phpbb\extension\finder to \phpbb\finder PHPBB3-12508 --- phpBB/phpbb/extension/manager.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'phpBB/phpbb/extension/manager.php') diff --git a/phpBB/phpbb/extension/manager.php b/phpBB/phpbb/extension/manager.php index 88404b025e..bfc6e19b5b 100644 --- a/phpBB/phpbb/extension/manager.php +++ b/phpBB/phpbb/extension/manager.php @@ -532,14 +532,14 @@ class manager } /** - * Instantiates a \phpbb\extension\finder. + * Instantiates a \phpbb\finder. * * @param bool $use_all_available Should we load all extensions, or just enabled ones - * @return \phpbb\extension\finder An extension finder instance + * @return \phpbb\finder An extension finder instance */ public function get_finder($use_all_available = false) { - $finder = new \phpbb\extension\finder($this->filesystem, $this->phpbb_root_path, $this->cache, $this->php_ext, $this->cache_name . '_finder'); + $finder = new \phpbb\finder($this->filesystem, $this->phpbb_root_path, $this->cache, $this->php_ext, $this->cache_name . '_finder'); if ($use_all_available) { $finder->set_extensions($this->all_available()); -- cgit v1.2.1 From 6980fbd27bd57dc01d7265cc742ab01a4bd9f93a Mon Sep 17 00:00:00 2001 From: Joas Schilling Date: Fri, 9 May 2014 09:24:30 +0200 Subject: [ticket/12508] Only take a list of names for set_extensions() PHPBB3-12508 --- phpBB/phpbb/extension/manager.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'phpBB/phpbb/extension/manager.php') diff --git a/phpBB/phpbb/extension/manager.php b/phpBB/phpbb/extension/manager.php index bfc6e19b5b..b83bb1b189 100644 --- a/phpBB/phpbb/extension/manager.php +++ b/phpBB/phpbb/extension/manager.php @@ -542,11 +542,11 @@ class manager $finder = new \phpbb\finder($this->filesystem, $this->phpbb_root_path, $this->cache, $this->php_ext, $this->cache_name . '_finder'); if ($use_all_available) { - $finder->set_extensions($this->all_available()); + $finder->set_extensions(array_keys($this->all_available())); } else { - $finder->set_extensions($this->all_enabled()); + $finder->set_extensions(array_keys($this->all_enabled())); } return $finder; } -- cgit v1.2.1