1
0
mirror of https://github.com/phpbb/phpbb.git synced 2025-07-31 22:10:45 +02:00

[ticket/11700] Fix extension loading with namespaces

class loader now expects all classes to be prefixed with a backslash
when resolving paths

PHPBB3-11700
This commit is contained in:
Nils Adermann
2013-09-19 18:29:08 +02:00
parent f205c4fad4
commit fe36375a36
23 changed files with 72 additions and 46 deletions

View File

@@ -91,7 +91,7 @@ class helper
page_footer(true, false, false);
return new \Response($this->template->assign_display('body'), $status_code);
return new Response($this->template->assign_display('body'), $status_code);
}
/**

View File

@@ -95,12 +95,12 @@ class resolver implements ControllerResolverInterface
* the style paths for the extension (the ext author can change them
* if necessary).
*/
$controller_dir = explode('_', get_class($controller_object));
$controller_dir = explode('\\', get_class($controller_object));
// 0 phpbb, 1 ext, 2 vendor, 3 extension name, ...
if (!is_null($this->template) && isset($controller_dir[3]) && $controller_dir[1] === 'ext')
// 0 vendor, 1 extension name, ...
if (!is_null($this->template) && isset($controller_dir[1]))
{
$controller_style_dir = 'ext/' . $controller_dir[2] . '/' . $controller_dir[3] . '/styles';
$controller_style_dir = 'ext/' . $controller_dir[0] . '/' . $controller_dir[1] . '/styles';
if (is_dir($controller_style_dir))
{