mirror of
https://github.com/phpbb/phpbb.git
synced 2025-06-08 20:38: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
|
* @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
|
// no super call to avoid find() call
|
||||||
$this->extension_manager = $extension_manager;
|
$this->extension_manager = $extension_manager;
|
||||||
|
@ -61,10 +61,11 @@ class phpbb_template_path_provider extends phpbb_extension_provider
|
||||||
*/
|
*/
|
||||||
public function find()
|
public function find()
|
||||||
{
|
{
|
||||||
$finder = $this->extension_manager->get_finder();
|
|
||||||
|
|
||||||
$directories = array();
|
$directories = array();
|
||||||
|
|
||||||
|
if ($this->extension_manager)
|
||||||
|
{
|
||||||
|
$finder = $this->extension_manager->get_finder();
|
||||||
foreach ($this->templates as $name => $path)
|
foreach ($this->templates as $name => $path)
|
||||||
{
|
{
|
||||||
if ($path && !phpbb_is_absolute($path))
|
if ($path && !phpbb_is_absolute($path))
|
||||||
|
@ -75,6 +76,7 @@ class phpbb_template_path_provider extends phpbb_extension_provider
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
foreach ($this->templates as $name => $path)
|
foreach ($this->templates as $name => $path)
|
||||||
{
|
{
|
||||||
|
|
|
@ -203,7 +203,7 @@ $config = new phpbb_config(array(
|
||||||
));
|
));
|
||||||
|
|
||||||
$phpbb_template_locator = new phpbb_template_locator();
|
$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 = new phpbb_template($phpbb_root_path, $phpEx, $config, $user, $phpbb_template_locator, $phpbb_template_path_provider);
|
||||||
$template->set_ext_dir_prefix('adm/');
|
$template->set_ext_dir_prefix('adm/');
|
||||||
$template->set_custom_template('../adm/style', 'admin');
|
$template->set_custom_template('../adm/style', 'admin');
|
||||||
|
|
Loading…
Add table
Reference in a new issue