diff options
author | Nicofuma <github@nicofuma.fr> | 2015-05-14 16:47:18 +0200 |
---|---|---|
committer | Nicofuma <github@nicofuma.fr> | 2015-05-14 16:47:18 +0200 |
commit | a26ab86dc63b196c79d86f3da36b8596a7beeb02 (patch) | |
tree | be417ba6874bc300c9bf6ad393dcbf4b9789b836 /phpBB/phpbb | |
parent | 11167f606015bc4663fa5a122ca95436ff412afc (diff) | |
parent | 74dbaac0394f45955553ff46515404fe5b06bfba (diff) | |
download | forums-a26ab86dc63b196c79d86f3da36b8596a7beeb02.tar forums-a26ab86dc63b196c79d86f3da36b8596a7beeb02.tar.gz forums-a26ab86dc63b196c79d86f3da36b8596a7beeb02.tar.bz2 forums-a26ab86dc63b196c79d86f3da36b8596a7beeb02.tar.xz forums-a26ab86dc63b196c79d86f3da36b8596a7beeb02.zip |
Merge pull request #3577 from MateBartus/ticket/13800
[ticket/13800] Make router's extension manager dependency optional
Diffstat (limited to 'phpBB/phpbb')
-rw-r--r-- | phpBB/phpbb/routing/router.php | 17 |
1 files changed, 10 insertions, 7 deletions
diff --git a/phpBB/phpbb/routing/router.php b/phpBB/phpbb/routing/router.php index 7444f06253..dd5bffe22b 100644 --- a/phpBB/phpbb/routing/router.php +++ b/phpBB/phpbb/routing/router.php @@ -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); } |