diff options
author | Tristan Darricau <github@nicofuma.fr> | 2014-06-27 19:39:47 +0200 |
---|---|---|
committer | Tristan Darricau <github@nicofuma.fr> | 2014-07-07 01:02:09 +0200 |
commit | 301d9ce9902a35fb8015805882723ab382f30ef4 (patch) | |
tree | d9109abd79737ff9ed5e7ea6e636dacdacd96685 /phpBB/common.php | |
parent | cbe846a64eb73b99d11320c79678dd6dcb58b44b (diff) | |
download | forums-301d9ce9902a35fb8015805882723ab382f30ef4.tar forums-301d9ce9902a35fb8015805882723ab382f30ef4.tar.gz forums-301d9ce9902a35fb8015805882723ab382f30ef4.tar.bz2 forums-301d9ce9902a35fb8015805882723ab382f30ef4.tar.xz forums-301d9ce9902a35fb8015805882723ab382f30ef4.zip |
[ticket/12775] Add a config.php class (and service)
PHPBB3-12775
Diffstat (limited to 'phpBB/common.php')
-rw-r--r-- | phpBB/common.php | 17 |
1 files changed, 8 insertions, 9 deletions
diff --git a/phpBB/common.php b/phpBB/common.php index a30b7b989f..901c0bd713 100644 --- a/phpBB/common.php +++ b/phpBB/common.php @@ -21,10 +21,14 @@ if (!defined('IN_PHPBB')) } require($phpbb_root_path . 'includes/startup.' . $phpEx); -require($phpbb_root_path . 'phpbb/di/container_factory.' . $phpEx); +require($phpbb_root_path . 'phpbb/class_loader.' . $phpEx); + +// Setup class loader first +$phpbb_class_loader = new \phpbb\class_loader('phpbb\\', "{$phpbb_root_path}phpbb/", $phpEx); +$phpbb_class_loader->register(); -$factory = new \phpbb\di\container_factory($phpbb_root_path, $phpEx); -$config_file_data = $factory->load_config_file(); +$config_php_handler = new \phpbb\config_php($phpbb_root_path, $phpEx); +$config_file_data = $config_php_handler->load_config_file(); extract($config_file_data); if (!defined('PHPBB_INSTALLED')) @@ -76,8 +80,6 @@ $phpbb_adm_relative_path = (isset($phpbb_adm_relative_path)) ? $phpbb_adm_relati $phpbb_admin_path = (defined('PHPBB_ADMIN_PATH')) ? PHPBB_ADMIN_PATH : $phpbb_root_path . $phpbb_adm_relative_path; // Include files -require($phpbb_root_path . 'phpbb/class_loader.' . $phpEx); - require($phpbb_root_path . 'includes/functions.' . $phpEx); require($phpbb_root_path . 'includes/functions_content.' . $phpEx); include($phpbb_root_path . 'includes/functions_compatibility.' . $phpEx); @@ -88,18 +90,15 @@ require($phpbb_root_path . 'includes/utf/utf_tools.' . $phpEx); // Set PHP error handler to ours set_error_handler(defined('PHPBB_MSG_HANDLER') ? PHPBB_MSG_HANDLER : 'msg_handler'); -// Setup class loader first -$phpbb_class_loader = new \phpbb\class_loader('phpbb\\', "{$phpbb_root_path}phpbb/", $phpEx); -$phpbb_class_loader->register(); $phpbb_class_loader_ext = new \phpbb\class_loader('\\', "{$phpbb_root_path}ext/", $phpEx); $phpbb_class_loader_ext->register(); phpbb_load_extensions_autoloaders($phpbb_root_path); // Set up container +$factory = new \phpbb\di\container_factory($config_php_handler, $phpbb_root_path, $phpEx); $phpbb_container = $factory->get_container(); - $phpbb_class_loader->set_cache($phpbb_container->get('cache.driver')); $phpbb_class_loader_ext->set_cache($phpbb_container->get('cache.driver')); |