From 482a8c47ea77dcaaa3c0c23c9a141aea583cf24f Mon Sep 17 00:00:00 2001 From: Nils Adermann Date: Tue, 30 Aug 2011 19:15:38 -0400 Subject: [PATCH] [feature/extension-manager] Don't use the extension manager during install Template needs to be able to work without extensions. PHPBB3-10323 --- phpBB/includes/template/path_provider.php | 20 +++++++++++--------- phpBB/install/index.php | 2 +- 2 files changed, 12 insertions(+), 10 deletions(-) diff --git a/phpBB/includes/template/path_provider.php b/phpBB/includes/template/path_provider.php index 02d48cbea5..69ac68bdb7 100644 --- a/phpBB/includes/template/path_provider.php +++ b/phpBB/includes/template/path_provider.php @@ -33,7 +33,7 @@ class phpbb_template_path_provider extends phpbb_extension_provider * * @param phpbb_extension_manager $extension_manager phpBB extension manager */ - public function __construct(phpbb_extension_manager $extension_manager) + public function __construct(phpbb_extension_manager $extension_manager = null) { // no super call to avoid find() call $this->extension_manager = $extension_manager; @@ -61,18 +61,20 @@ class phpbb_template_path_provider extends phpbb_extension_provider */ public function find() { - $finder = $this->extension_manager->get_finder(); - $directories = array(); - foreach ($this->templates as $name => $path) + if ($this->extension_manager) { - if ($path && !phpbb_is_absolute($path)) + $finder = $this->extension_manager->get_finder(); + foreach ($this->templates as $name => $path) { - $directories = array_merge($directories, $finder - ->directory('/' . $this->ext_dir_prefix . $path) - ->get_directories() - ); + if ($path && !phpbb_is_absolute($path)) + { + $directories = array_merge($directories, $finder + ->directory('/' . $this->ext_dir_prefix . $path) + ->get_directories() + ); + } } } diff --git a/phpBB/install/index.php b/phpBB/install/index.php index 93effc27f1..abe5d1e485 100644 --- a/phpBB/install/index.php +++ b/phpBB/install/index.php @@ -203,7 +203,7 @@ $config = new phpbb_config(array( )); $phpbb_template_locator = new phpbb_template_locator(); -$phpbb_template_path_provider = new phpbb_template_path_provider($phpbb_extension_manager); +$phpbb_template_path_provider = new phpbb_template_path_provider(); $template = new phpbb_template($phpbb_root_path, $phpEx, $config, $user, $phpbb_template_locator, $phpbb_template_path_provider); $template->set_ext_dir_prefix('adm/'); $template->set_custom_template('../adm/style', 'admin');