1
0
mirror of https://github.com/phpbb/phpbb.git synced 2025-07-31 05:50:42 +02:00

[feature/extension-manager] Prepend the phpbb_root_path if necessary.

PHPBB3-10323
This commit is contained in:
Nils Adermann
2011-08-29 22:51:15 -04:00
parent fd42599191
commit 7d16007d6a
2 changed files with 27 additions and 8 deletions

View File

@@ -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;
}
/**