diff options
author | Joas Schilling <nickvergessen@gmx.de> | 2014-05-06 17:50:46 +0200 |
---|---|---|
committer | Joas Schilling <nickvergessen@gmx.de> | 2014-06-10 11:47:39 +0200 |
commit | d45c681b40cf0415ce49b2cd7f3f1083e84b367c (patch) | |
tree | ce42a1665c9ffa1c519964ad0df9bf6d502c1afa /phpBB | |
parent | c20653dfbe552b53fa3281ff8f2a9214fc8a26a9 (diff) | |
download | forums-d45c681b40cf0415ce49b2cd7f3f1083e84b367c.tar forums-d45c681b40cf0415ce49b2cd7f3f1083e84b367c.tar.gz forums-d45c681b40cf0415ce49b2cd7f3f1083e84b367c.tar.bz2 forums-d45c681b40cf0415ce49b2cd7f3f1083e84b367c.tar.xz forums-d45c681b40cf0415ce49b2cd7f3f1083e84b367c.zip |
[ticket/12508] Fix usages of the finder
PHPBB3-12508
Diffstat (limited to 'phpBB')
-rw-r--r-- | phpBB/develop/create_schema_files.php | 12 | ||||
-rw-r--r-- | phpBB/includes/acp/acp_modules.php | 4 | ||||
-rw-r--r-- | phpBB/phpbb/extension/manager.php | 14 |
3 files changed, 16 insertions, 14 deletions
diff --git a/phpBB/develop/create_schema_files.php b/phpBB/develop/create_schema_files.php index 5490e45afa..b12f5e4d25 100644 --- a/phpBB/develop/create_schema_files.php +++ b/phpBB/develop/create_schema_files.php @@ -44,17 +44,9 @@ require($phpbb_root_path . 'phpbb/class_loader.' . $phpEx); $phpbb_class_loader = new \phpbb\class_loader('phpbb\\', "{$phpbb_root_path}phpbb/", $phpEx); $phpbb_class_loader->register(); -class phpbb_extension_empty_manager extends \phpbb\extension\manager -{ - public function __construct() - { - $this->extensions = array(); - } -} - -$finder = new \phpbb\extension\finder(new \phpbb_extension_empty_manager(), new \phpbb\filesystem(), $phpbb_root_path); +$finder = new \phpbb\extension\finder(new \phpbb\filesystem(), $phpbb_root_path); $classes = $finder->core_path('phpbb/') - ->directory('db/migration/data') + ->directory('/db/migration/data') ->get_classes(); $db = new \phpbb\db\driver\sqlite(); diff --git a/phpBB/includes/acp/acp_modules.php b/phpBB/includes/acp/acp_modules.php index 61bae18557..5932f4cddd 100644 --- a/phpBB/includes/acp/acp_modules.php +++ b/phpBB/includes/acp/acp_modules.php @@ -561,14 +561,14 @@ class acp_modules $directory = $phpbb_root_path . 'includes/' . $module_class . '/info/'; $fileinfo = array(); - $finder = $phpbb_extension_manager->get_finder(); + $finder = $phpbb_extension_manager->get_finder($use_all_available); $modules = $finder ->extension_suffix('_module') ->extension_directory("/$module_class") ->core_path("includes/$module_class/info/") ->core_prefix($module_class . '_') - ->get_classes(true, $use_all_available); + ->get_classes(true); foreach ($modules as $cur_module) { 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; } } |