diff options
author | Tristan Darricau <tristan.darricau@sensiolabs.com> | 2016-03-23 22:48:58 +0100 |
---|---|---|
committer | Tristan Darricau <tristan.darricau@sensiolabs.com> | 2016-03-24 09:15:34 +0100 |
commit | 56c2caf6c0778c0da48fe0ac688c893777b89ee4 (patch) | |
tree | 2ed7f9cf6a26d0ea7b3f7bac255c777e36754b7c /phpBB/phpbb/routing | |
parent | eca4726f3c2fda312b3150b7b252a300d4603fbe (diff) | |
download | forums-56c2caf6c0778c0da48fe0ac688c893777b89ee4.tar forums-56c2caf6c0778c0da48fe0ac688c893777b89ee4.tar.gz forums-56c2caf6c0778c0da48fe0ac688c893777b89ee4.tar.bz2 forums-56c2caf6c0778c0da48fe0ac688c893777b89ee4.tar.xz forums-56c2caf6c0778c0da48fe0ac688c893777b89ee4.zip |
[ticket/14555] Uniformize cache directory usages
PHPBB3-14555
Diffstat (limited to 'phpBB/phpbb/routing')
-rw-r--r-- | phpBB/phpbb/routing/router.php | 31 |
1 files changed, 10 insertions, 21 deletions
diff --git a/phpBB/phpbb/routing/router.php b/phpBB/phpbb/routing/router.php index 5d237b6433..f19886fb0b 100644 --- a/phpBB/phpbb/routing/router.php +++ b/phpBB/phpbb/routing/router.php @@ -49,13 +49,6 @@ class router implements RouterInterface protected $loader; /** - * phpBB root path - * - * @var string - */ - protected $phpbb_root_path; - - /** * PHP file extensions * * @var string @@ -63,13 +56,6 @@ class router implements RouterInterface protected $php_ext; /** - * Name of the current environment - * - * @var string - */ - protected $environment; - - /** * @var \Symfony\Component\Routing\Matcher\UrlMatcherInterface|null */ protected $matcher; @@ -90,24 +76,27 @@ class router implements RouterInterface protected $route_collection; /** + * @var string + */ + protected $cache_dir; + + /** * Construct method * * @param ContainerInterface $container DI container * @param resources_locator_interface $resources_locator Resources locator * @param LoaderInterface $loader Resources loader - * @param string $phpbb_root_path phpBB root path * @param string $php_ext PHP file extension - * @param string $environment Name of the current environment + * @param string $cache_dir phpBB cache directory */ - public function __construct(ContainerInterface $container, resources_locator_interface $resources_locator, LoaderInterface $loader, $phpbb_root_path, $php_ext, $environment) + public function __construct(ContainerInterface $container, resources_locator_interface $resources_locator, LoaderInterface $loader, $php_ext, $cache_dir) { $this->container = $container; $this->resources_locator = $resources_locator; $this->loader = $loader; - $this->phpbb_root_path = $phpbb_root_path; $this->php_ext = $php_ext; - $this->environment = $environment; $this->context = new RequestContext(); + $this->cache_dir = $cache_dir; } /** @@ -211,7 +200,7 @@ class router implements RouterInterface { try { - $cache = new ConfigCache("{$this->phpbb_root_path}cache/{$this->environment}/url_matcher.{$this->php_ext}", defined('DEBUG')); + $cache = new ConfigCache("{$this->cache_dir}url_matcher.{$this->php_ext}", defined('DEBUG')); if (!$cache->isFresh()) { $dumper = new PhpMatcherDumper($this->get_routes()); @@ -266,7 +255,7 @@ class router implements RouterInterface { try { - $cache = new ConfigCache("{$this->phpbb_root_path}cache/{$this->environment}/url_generator.{$this->php_ext}", defined('DEBUG')); + $cache = new ConfigCache("{$this->cache_dir}url_generator.{$this->php_ext}", defined('DEBUG')); if (!$cache->isFresh()) { $dumper = new PhpGeneratorDumper($this->get_routes()); |