mirror of
https://github.com/phpbb/phpbb.git
synced 2025-06-10 13:28:55 +00:00
[ticket/12529] Move $phpbb_root_path to the end of the constructor
PHPBB3-12529
This commit is contained in:
parent
197c801746
commit
16cd1db59a
3 changed files with 7 additions and 6 deletions
|
@ -103,8 +103,8 @@ services:
|
||||||
class: phpbb\controller\resolver
|
class: phpbb\controller\resolver
|
||||||
arguments:
|
arguments:
|
||||||
- @user
|
- @user
|
||||||
- %core.root_path%
|
|
||||||
- @service_container
|
- @service_container
|
||||||
|
- %core.root_path%
|
||||||
- @template
|
- @template
|
||||||
|
|
||||||
controller.provider:
|
controller.provider:
|
||||||
|
|
|
@ -33,7 +33,7 @@ class resolver implements ControllerResolverInterface
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* phpbb\template\template object
|
* phpbb\template\template object
|
||||||
* @var phpbb\template\template
|
* @var \phpbb\template\template
|
||||||
*/
|
*/
|
||||||
protected $template;
|
protected $template;
|
||||||
|
|
||||||
|
@ -48,9 +48,10 @@ class resolver implements ControllerResolverInterface
|
||||||
*
|
*
|
||||||
* @param \phpbb\user $user User Object
|
* @param \phpbb\user $user User Object
|
||||||
* @param ContainerInterface $container ContainerInterface object
|
* @param ContainerInterface $container ContainerInterface object
|
||||||
|
* @param string $phpbb_root_path Relative path to phpBB root
|
||||||
* @param \phpbb\template\template $template
|
* @param \phpbb\template\template $template
|
||||||
*/
|
*/
|
||||||
public function __construct(\phpbb\user $user, $phpbb_root_path, ContainerInterface $container, \phpbb\template\template $template = null)
|
public function __construct(\phpbb\user $user, ContainerInterface $container, $phpbb_root_path, \phpbb\template\template $template = null)
|
||||||
{
|
{
|
||||||
$this->user = $user;
|
$this->user = $user;
|
||||||
$this->container = $container;
|
$this->container = $container;
|
||||||
|
@ -61,7 +62,7 @@ class resolver implements ControllerResolverInterface
|
||||||
/**
|
/**
|
||||||
* Load a controller callable
|
* Load a controller callable
|
||||||
*
|
*
|
||||||
* @param Symfony\Component\HttpFoundation\Request $request Symfony Request object
|
* @param \Symfony\Component\HttpFoundation\Request $request Symfony Request object
|
||||||
* @return bool|Callable Callable or false
|
* @return bool|Callable Callable or false
|
||||||
* @throws \phpbb\controller\exception
|
* @throws \phpbb\controller\exception
|
||||||
*/
|
*/
|
||||||
|
@ -116,7 +117,7 @@ class resolver implements ControllerResolverInterface
|
||||||
* and should match the parameters of the method you are using as your
|
* and should match the parameters of the method you are using as your
|
||||||
* controller.
|
* controller.
|
||||||
*
|
*
|
||||||
* @param Symfony\Component\HttpFoundation\Request $request Symfony Request object
|
* @param \Symfony\Component\HttpFoundation\Request $request Symfony Request object
|
||||||
* @param mixed $controller A callable (controller class, method)
|
* @param mixed $controller A callable (controller class, method)
|
||||||
* @return bool False
|
* @return bool False
|
||||||
* @throws \phpbb\controller\exception
|
* @throws \phpbb\controller\exception
|
||||||
|
|
|
@ -68,7 +68,7 @@ class phpbb_controller_controller_test extends phpbb_test_case
|
||||||
include(__DIR__.'/phpbb/controller/foo.php');
|
include(__DIR__.'/phpbb/controller/foo.php');
|
||||||
}
|
}
|
||||||
|
|
||||||
$resolver = new \phpbb\controller\resolver(new \phpbb\user, dirname(__FILE__) . '/', $container);
|
$resolver = new \phpbb\controller\resolver(new \phpbb\user, $container, dirname(__FILE__) . '/');
|
||||||
$symfony_request = new Request();
|
$symfony_request = new Request();
|
||||||
$symfony_request->attributes->set('_controller', 'foo.controller:handle');
|
$symfony_request->attributes->set('_controller', 'foo.controller:handle');
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue