mirror of
https://github.com/phpbb/phpbb.git
synced 2025-06-08 12:28:52 +00:00
[feature/extension-manager] Don't use the extension manager during install
Template needs to be able to work without extensions. PHPBB3-10323
This commit is contained in:
parent
ea46feb115
commit
482a8c47ea
2 changed files with 12 additions and 10 deletions
|
@ -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()
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -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');
|
||||
|
|
Loading…
Add table
Reference in a new issue