diff options
author | Nils Adermann <naderman@naderman.de> | 2011-08-29 22:51:15 -0400 |
---|---|---|
committer | Nils Adermann <naderman@naderman.de> | 2011-09-29 15:42:49 +0200 |
commit | 7d16007d6a1c042389039ab9ab59c073ecd7c933 (patch) | |
tree | b33609b4fd0bcd25f649fe5bb9290c96b395468c /phpBB/includes/extension/finder.php | |
parent | fd4259919188df2d7e4667108bf86d9bd22a8e2b (diff) | |
download | forums-7d16007d6a1c042389039ab9ab59c073ecd7c933.tar forums-7d16007d6a1c042389039ab9ab59c073ecd7c933.tar.gz forums-7d16007d6a1c042389039ab9ab59c073ecd7c933.tar.bz2 forums-7d16007d6a1c042389039ab9ab59c073ecd7c933.tar.xz forums-7d16007d6a1c042389039ab9ab59c073ecd7c933.zip |
[feature/extension-manager] Prepend the phpbb_root_path if necessary.
PHPBB3-10323
Diffstat (limited to 'phpBB/includes/extension/finder.php')
-rw-r--r-- | phpBB/includes/extension/finder.php | 26 |
1 files changed, 23 insertions, 3 deletions
diff --git a/phpBB/includes/extension/finder.php b/phpBB/includes/extension/finder.php index 1c1f150673..ee08b0a82a 100644 --- a/phpBB/includes/extension/finder.php +++ b/phpBB/includes/extension/finder.php @@ -205,7 +205,7 @@ class phpbb_extension_finder $this->query['suffix'] .= $this->phpEx; $this->query['default_suffix'] .= $this->phpEx; - $files = $this->get_files($cache); + $files = $this->find($cache, false); $classes = array(); foreach ($files as $file) @@ -225,7 +225,7 @@ class phpbb_extension_finder */ public function get_directories($cache = true) { - return $this->find($cache, true); + return $this->find_with_root_path($cache, true); } /** @@ -236,7 +236,27 @@ class phpbb_extension_finder */ public function get_files($cache = true) { - return $this->find($cache, false); + return $this->find_with_root_path($cache, false); + } + + /** + * A wrapper around the general find which prepends a root path to results + * + * @param bool $cache Whether the result should be cached + * @param bool $is_dir Whether the found items should be directories + * @return array An array of paths to found items + */ + protected function find_with_root_path($cache = true, $is_dir = false) + { + $items = $this->find($cache, $is_dir); + + $result = array(); + foreach ($items as $item) + { + $result[] = $this->phpbb_root_path . $item; + } + + return $result; } /** |