1
0
mirror of https://github.com/phpbb/phpbb.git synced 2025-08-07 01:06:48 +02:00

[ticket/12775] Add a config.php class (and service)

PHPBB3-12775
This commit is contained in:
Tristan Darricau
2014-06-27 19:39:47 +02:00
parent cbe846a64e
commit 301d9ce990
4 changed files with 98 additions and 56 deletions

View File

@@ -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);
$factory = new \phpbb\di\container_factory($phpbb_root_path, $phpEx);
$config_file_data = $factory->load_config_file();
// Setup class loader first
$phpbb_class_loader = new \phpbb\class_loader('phpbb\\', "{$phpbb_root_path}phpbb/", $phpEx);
$phpbb_class_loader->register();
$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'));