diff options
author | Tristan Darricau <github@nicofuma.fr> | 2014-06-27 21:02:20 +0200 |
---|---|---|
committer | Tristan Darricau <github@nicofuma.fr> | 2014-07-07 01:02:19 +0200 |
commit | e7804ecce4511d8befdcc28f6705c3589c47c878 (patch) | |
tree | aed1533f8280d78fffd5c8502b0bd26ccb073a16 /phpBB/phpbb | |
parent | f87e76b9109fa4da3d4c78f191cfd8889f1da1bb (diff) | |
download | forums-e7804ecce4511d8befdcc28f6705c3589c47c878.tar forums-e7804ecce4511d8befdcc28f6705c3589c47c878.tar.gz forums-e7804ecce4511d8befdcc28f6705c3589c47c878.tar.bz2 forums-e7804ecce4511d8befdcc28f6705c3589c47c878.tar.xz forums-e7804ecce4511d8befdcc28f6705c3589c47c878.zip |
[ticket/12775] Update phpBB/install/database_update.php
PHPBB3-12775
Diffstat (limited to 'phpBB/phpbb')
-rw-r--r-- | phpBB/phpbb/config_php.php | 23 | ||||
-rw-r--r-- | phpBB/phpbb/di/container_factory.php | 25 |
2 files changed, 44 insertions, 4 deletions
diff --git a/phpBB/phpbb/config_php.php b/phpBB/phpbb/config_php.php index d502088897..31a84662fa 100644 --- a/phpBB/phpbb/config_php.php +++ b/phpBB/phpbb/config_php.php @@ -36,6 +36,13 @@ class config_php protected $config_data = array(); /** + * The path to the config file. (Defaults: $phpbb_root_path . 'config.' . $php_ext) + * + * @var string + */ + protected $config_file; + + /** * Constructor * * @param string $phpbb_root_path Path to the phpbb includes directory. @@ -45,6 +52,18 @@ class config_php { $this->phpbb_root_path = $phpbb_root_path; $this->php_ext = $php_ext; + $this->config_file = $this->phpbb_root_path . 'config.' . $this->php_ext; + } + + /** + * Set the path to the config file. + * + * @param string $config_file + */ + public function set_config_file($config_file) + { + $this->config_file = $config_file; + $this->config_loaded = false; } /** @@ -87,12 +106,12 @@ class config_php { if (!$this->config_loaded) { - if (file_exists($this->phpbb_root_path . 'config.' . $this->php_ext)) + if (file_exists($this->config_file)) { $defined_vars = null; $defined_vars = get_defined_vars(); - require($this->phpbb_root_path . 'config.' . $this->php_ext); + require($this->config_file); $this->config_data = array_diff_key(get_defined_vars(), $defined_vars); $this->config_loaded = true; diff --git a/phpBB/phpbb/di/container_factory.php b/phpBB/phpbb/di/container_factory.php index dd348d8eee..548bbf153f 100644 --- a/phpBB/phpbb/di/container_factory.php +++ b/phpBB/phpbb/di/container_factory.php @@ -71,6 +71,13 @@ class container_factory protected $use_custom_pass = true; /** + * Indicates if the kernel compile pass have to be used (default to true). + * + * @var bool + */ + protected $use_kernel_pass = true; + + /** * Indicates if a dump container should be used (default to true). * * If DEBUG_CONTAINER is set this option is ignored and a new container is build. @@ -143,7 +150,11 @@ class container_factory if ($this->use_custom_pass) { $this->container->addCompilerPass(new \phpbb\di\pass\collection_pass()); - $this->container->addCompilerPass(new \phpbb\di\pass\kernel_pass()); + + if ($this->use_kernel_pass) + { + $this->container->addCompilerPass(new \phpbb\di\pass\kernel_pass()); + } } $this->inject_custom_parameters(); @@ -179,12 +190,22 @@ class container_factory * * @param bool $use_custom_pass */ - public function set_use_customPass($use_custom_pass) + public function set_use_custom_pass($use_custom_pass) { $this->use_custom_pass = $use_custom_pass; } /** + * Set if the kernel compile pass have to be used. + * + * @param bool $use_kernel_pass + */ + public function set_use_kernel_pass($use_kernel_pass) + { + $this->use_kernel_pass = $use_kernel_pass; + } + + /** * Set if the php config file should be injecting into the container. * * @param bool $inject_config |