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

[ticket/13800] Make router's extension manager dependency optional

PHPBB3-13800
This commit is contained in:
MateBartus
2015-04-30 22:40:17 +02:00
parent 8596742579
commit 74dbaac039
6 changed files with 33 additions and 29 deletions

View File

@@ -94,13 +94,14 @@ class router implements RouterInterface
* Construct method
*
* @param \phpbb\filesystem\filesystem_interface $filesystem Filesystem helper
* @param manager $extension_manager Extension manager
* @param string $phpbb_root_path phpBB root path
* @param string $php_ext PHP file extension
* @param string $environment Name of the current environment
* @param array $routing_files Array of strings containing paths to YAML files holding route information
* @param string $phpbb_root_path phpBB root path
* @param string $php_ext PHP file extension
* @param string $environment Name of the current environment
* @param manager|null $extension_manager Extension manager
* @param array $routing_files Array of strings containing paths to YAML files
* holding route information
*/
public function __construct(\phpbb\filesystem\filesystem_interface $filesystem, manager $extension_manager, $phpbb_root_path, $php_ext, $environment, $routing_files = array())
public function __construct(\phpbb\filesystem\filesystem_interface $filesystem, $phpbb_root_path, $php_ext, $environment, manager $extension_manager = null, $routing_files = array())
{
$this->filesystem = $filesystem;
$this->extension_manager = $extension_manager;
@@ -172,7 +173,9 @@ class router implements RouterInterface
{
if ($this->route_collection == null || empty($this->routing_files))
{
$this->find_routing_files($this->extension_manager->all_enabled(false))
$this->find_routing_files(
($this->extension_manager !== null) ? $this->extension_manager->all_enabled(false) : array()
)
->find($this->phpbb_root_path);
}