aboutsummaryrefslogtreecommitdiffstats
path: root/phpBB/includes/extension
diff options
context:
space:
mode:
authorVjacheslav Trushkin <arty@phpbb.com>2012-03-31 21:20:18 +0300
committerVjacheslav Trushkin <arty@phpbb.com>2012-03-31 21:20:18 +0300
commitb3f46b9565117940b79c7530a1c21336cd072073 (patch)
tree90066a5ac6afdf000eb37eacba2cee0f615477ae /phpBB/includes/extension
parent7e2f16aafa47f8db51a12a293b0616cb75b4d12f (diff)
downloadforums-b3f46b9565117940b79c7530a1c21336cd072073.tar
forums-b3f46b9565117940b79c7530a1c21336cd072073.tar.gz
forums-b3f46b9565117940b79c7530a1c21336cd072073.tar.bz2
forums-b3f46b9565117940b79c7530a1c21336cd072073.tar.xz
forums-b3f46b9565117940b79c7530a1c21336cd072073.zip
[ticket/10735] Changing locator paths structure
Changing locator paths to 2 dimensional array PHPBB3-10735
Diffstat (limited to 'phpBB/includes/extension')
-rw-r--r--phpBB/includes/extension/finder.php18
1 files changed, 14 insertions, 4 deletions
diff --git a/phpBB/includes/extension/finder.php b/phpBB/includes/extension/finder.php
index 23b9f1c658..87ca40917d 100644
--- a/phpBB/includes/extension/finder.php
+++ b/phpBB/includes/extension/finder.php
@@ -270,11 +270,12 @@ class phpbb_extension_finder
* Finds all directories matching the configured options
*
* @param bool $cache Whether the result should be cached
+ * @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)
+ public function get_directories($cache = true, $extension_keys = false)
{
- return $this->find_with_root_path($cache, true);
+ return $this->find_with_root_path($cache, true, $extension_keys);
}
/**
@@ -294,16 +295,25 @@ 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 $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)
+ protected function find_with_root_path($cache = true, $is_dir = false, $extension_keys = false)
{
$items = $this->find($cache, $is_dir);
$result = array();
foreach ($items as $item => $ext_name)
{
- $result[] = $this->phpbb_root_path . $item;
+ if ($extension_keys)
+ {
+ $result[$ext_name] = $this->phpbb_root_path . $item;
+ }
+ else
+ {
+ $result[] = $this->phpbb_root_path . $item;
+ }
}
return $result;