diff --git a/phpBB/includes/extension/finder.php b/phpBB/includes/extension/finder.php index fb19b98429..af31478337 100644 --- a/phpBB/includes/extension/finder.php +++ b/phpBB/includes/extension/finder.php @@ -247,14 +247,16 @@ class phpbb_extension_finder * phpBB naming rules an incorrect class name will be returned. * * @param bool $cache Whether the result should be cached + * @param bool $use_all_available Use all available instead of just all + * enabled extensions * @return array An array of found class names */ - public function get_classes($cache = true) + public function get_classes($cache = true, $use_all_available = false) { $this->query['extension_suffix'] .= $this->php_ext; $this->query['core_suffix'] .= $this->php_ext; - $files = $this->find($cache, false); + $files = $this->find($cache, false, $use_all_available); $classes = array(); foreach ($files as $file => $ext_name) @@ -270,23 +272,27 @@ class phpbb_extension_finder * Finds all directories matching the configured options * * @param bool $cache Whether the result should be cached + * @param bool $use_all_available Use all available instead of just all + * enabled extensions * @param bool $extension_keys Whether the result should have extension name as array key * @return array An array of paths to found directories */ - public function get_directories($cache = true, $extension_keys = false) + public function get_directories($cache = true, $use_all_available = false, $extension_keys = false) { - return $this->find_with_root_path($cache, true, $extension_keys); + return $this->find_with_root_path($cache, true, $use_all_available, $extension_keys); } /** * Finds all files matching the configured options. * * @param bool $cache Whether the result should be cached + * @param bool $use_all_available Use all available instead of just all + * enabled extensions * @return array An array of paths to found files */ - public function get_files($cache = true) + public function get_files($cache = true, $use_all_available = false) { - return $this->find_with_root_path($cache, false); + return $this->find_with_root_path($cache, false, $use_all_available); } /** @@ -295,13 +301,15 @@ class phpbb_extension_finder * @param bool $cache Whether the result should be cached * @param bool $is_dir Directories will be returned when true, only files * otherwise + * @param bool $use_all_available Use all available instead of just all + * enabled extensions * @param bool $extension_keys If true, result will be associative array * with extension name as key * @return array An array of paths to found items */ - protected function find_with_root_path($cache = true, $is_dir = false, $extension_keys = false) + protected function find_with_root_path($cache = true, $is_dir = false, $use_all_available = false, $extension_keys = false) { - $items = $this->find($cache, $is_dir); + $items = $this->find($cache, $is_dir, $use_all_available); $result = array(); foreach ($items as $item => $ext_name) @@ -325,9 +333,11 @@ class phpbb_extension_finder * @param bool $cache Whether the result should be cached * @param bool $is_dir Directories will be returned when true, only files * otherwise + * @param bool $use_all_available Use all available instead of just all + * enabled extensions * @return array An array of paths to found items */ - public function find($cache = true, $is_dir = false) + public function find($cache = true, $is_dir = false, $use_all_available = false) { $this->query['is_dir'] = $is_dir; $query = md5(serialize($this->query)); @@ -339,7 +349,14 @@ class phpbb_extension_finder $files = array(); - $extensions = $this->extension_manager->all_enabled(); + if ($use_all_available) + { + $extensions = $this->extension_manager->all_available(); + } + else + { + $extensions = $this->extension_manager->all_enabled(); + } if ($this->query['core_path']) { diff --git a/phpBB/includes/style/extension_path_provider.php b/phpBB/includes/style/extension_path_provider.php index 4eac300424..6976a45ed0 100644 --- a/phpBB/includes/style/extension_path_provider.php +++ b/phpBB/includes/style/extension_path_provider.php @@ -92,7 +92,7 @@ class phpbb_style_extension_path_provider extends phpbb_extension_provider imple if ($path && !phpbb_is_absolute($path)) { $result = $finder->directory('/' . $this->ext_dir_prefix . $path) - ->get_directories(true, true); + ->get_directories(true, false, true); foreach ($result as $ext => $ext_path) { $directories[$ext][] = $ext_path;