Skip to content
Closed
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
29 changes: 29 additions & 0 deletions libraries/src/Router/SiteRouter.php
Original file line number Diff line number Diff line change
Expand Up @@ -616,6 +616,35 @@ public function getComponentRouter($component)
{
$this->componentRouters[$component] = $componentInstance->createRouter($this->app, $this->menu);
}

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Remove tabs on lines 619, 625, 630, 637, and 641.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done

// Keep support for components implementing the new format but don't implement the RouterServiceInterface
if (!isset($this->componentRouters[$component]))
{
$compname = ucfirst(substr($component, 4));
$class = $compname . 'Router';

if (!class_exists($class))
{
// Use the component routing handler if it exists
$path = JPATH_SITE . '/components/' . $component . '/router.php';

// Use the custom routing handler if it exists
if (file_exists($path))
{
require_once $path;
}
}

if (class_exists($class))
{
$reflection = new \ReflectionClass($class);

if (in_array('Joomla\\CMS\\Component\\Router\\RouterInterface', $reflection->getInterfaceNames()))
{
$this->componentRouters[$component] = new $class($this->app, $this->menu);
}
}
}

if (!isset($this->componentRouters[$component]))
{
Expand Down