diff options
Diffstat (limited to 'phpBB')
-rw-r--r-- | phpBB/config/default/container/services.yml | 20 | ||||
-rw-r--r-- | phpBB/config/default/container/services_routing.yml | 19 | ||||
-rw-r--r-- | phpBB/phpbb/routing/router.php | 17 |
3 files changed, 30 insertions, 26 deletions
diff --git a/phpBB/config/default/container/services.yml b/phpBB/config/default/container/services.yml index 670ea3bd61..95d624a8ae 100644 --- a/phpBB/config/default/container/services.yml +++ b/phpBB/config/default/container/services.yml @@ -15,6 +15,7 @@ imports: - { resource: services_password.yml } - { resource: services_profilefield.yml } - { resource: services_report.yml } + - { resource: services_routing.yml } - { resource: services_text_formatter.yml } - { resource: services_twig.yml } - { resource: services_user.yml } @@ -157,25 +158,6 @@ services: - null - %core.disable_super_globals% - router: - class: phpbb\routing\router - arguments: - - @filesystem - - @ext.manager - - %core.root_path% - - %core.php_ext% - - %core.environment% - - router.listener: - class: Symfony\Component\HttpKernel\EventListener\RouterListener - arguments: - - @router - - null - - null - - @request_stack - tags: - - { name: kernel.event_subscriber } - # WARNING: The Symfony request does not escape the input and should be used very carefully # prefer the phpbb request (service @request) as possible symfony_request: diff --git a/phpBB/config/default/container/services_routing.yml b/phpBB/config/default/container/services_routing.yml new file mode 100644 index 0000000000..6749202c0d --- /dev/null +++ b/phpBB/config/default/container/services_routing.yml @@ -0,0 +1,19 @@ +services: + router: + class: phpbb\routing\router + arguments: + - @filesystem + - %core.root_path% + - %core.php_ext% + - %core.environment% + - @ext.manager + + router.listener: + class: Symfony\Component\HttpKernel\EventListener\RouterListener + arguments: + - @router + - null + - null + - @request_stack + tags: + - { name: kernel.event_subscriber } 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); } |