From 01c25d3d6b1d09389a6cbd5808832ed5d146b6d6 Mon Sep 17 00:00:00 2001 From: Tristan Darricau Date: Fri, 27 Jun 2014 20:08:26 +0200 Subject: [ticket/12775] Use the config.php handler in \phpbb\config_php PHPBB3-12775 --- phpBB/phpbb/di/container_factory.php | 25 ++++++++----------------- 1 file changed, 8 insertions(+), 17 deletions(-) (limited to 'phpBB/phpbb/di/container_factory.php') diff --git a/phpBB/phpbb/di/container_factory.php b/phpBB/phpbb/di/container_factory.php index 37fe9f486f..dd348d8eee 100644 --- a/phpBB/phpbb/di/container_factory.php +++ b/phpBB/phpbb/di/container_factory.php @@ -42,13 +42,6 @@ class container_factory */ protected $installed_exts = null; - /** - * The content of the php config file - * - * @var array - */ - protected $config_data = array(); - /** * Indicates if the php config file should be injecting into the container (default to true). * @@ -142,8 +135,7 @@ class container_factory if ($this->inject_config) { - $this->config_data = $this->config_php_handler->load_config_file(); - $container_extensions[] = new \phpbb\di\extension\config($this->config_data); + $container_extensions[] = new \phpbb\di\extension\config($this->config_php_handler); } $this->container = $this->create_container($container_extensions); @@ -271,15 +263,14 @@ class container_factory { if ($this->dbal_connection === null) { - $this->config_data = $this->config_php_handler->load_config_file(); - $dbal_driver_class = phpbb_convert_30_dbms_to_31($this->config_data['dbms']); + $dbal_driver_class = phpbb_convert_30_dbms_to_31($this->config_php_handler->get('dbms')); $this->dbal_connection = new $dbal_driver_class(); $this->dbal_connection->sql_connect( - $this->config_data['dbhost'], - $this->config_data['dbuser'], - $this->config_data['dbpasswd'], - $this->config_data['dbname'], - $this->config_data['dbport'], + $this->config_php_handler->get('dbhost'), + $this->config_php_handler->get('dbuser'), + $this->config_php_handler->get('dbpasswd'), + $this->config_php_handler->get('dbname'), + $this->config_php_handler->get('dbport'), defined('PHPBB_DB_NEW_LINK') && PHPBB_DB_NEW_LINK ); } @@ -295,7 +286,7 @@ class container_factory protected function get_installed_extensions() { $db = $this->get_dbal_connection(); - $extension_table = $this->config_data['table_prefix'] . 'ext'; + $extension_table = $this->config_php_handler->get('table_prefix') . 'ext'; $sql = 'SELECT * FROM ' . $extension_table . ' -- cgit v1.2.1