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

[ticket/16178] Make container_builder use same cache directory as Container

Both should be using the same core.cache_dir directory.

PHPBB3-16178
This commit is contained in:
Joshua Angnoe
2019-10-05 04:13:41 +07:00
committed by rxu
parent eefd3c0197
commit c6fe6d49bc
2 changed files with 141 additions and 5 deletions

View File

@@ -116,6 +116,11 @@ class container_builder
/** @var \Exception */
private $build_exception;
/**
* @var array
*/
private $env_parameters = [];
/**
* Constructor
*
@@ -124,8 +129,14 @@ class container_builder
*/
public function __construct($phpbb_root_path, $php_ext)
{
$this->phpbb_root_path = $phpbb_root_path;
$this->php_ext = $php_ext;
$this->phpbb_root_path = $phpbb_root_path;
$this->php_ext = $php_ext;
$this->env_parameters = $this->get_env_parameters();
if (isset($this->env_parameters['core.cache_dir']))
{
$this->with_cache_dir($this->env_parameters['core.cache_dir']);
}
}
/**
@@ -581,14 +592,14 @@ class container_builder
protected function get_core_parameters()
{
return array_merge(
array(
[
'core.root_path' => $this->phpbb_root_path,
'core.php_ext' => $this->php_ext,
'core.environment' => $this->get_environment(),
'core.debug' => defined('DEBUG') ? DEBUG : false,
'core.cache_dir' => $this->get_cache_dir(),
),
$this->get_env_parameters()
],
$this->env_parameters
);
}