1
0
mirror of https://github.com/phpbb/phpbb.git synced 2025-08-11 03:04:09 +02:00

[ticket/10714] Remove dependency injection and use global instead

This avoids loading functions_admin.php globally and was suggested by naderman

PHPBB3-10714
This commit is contained in:
Joas Schilling
2012-08-21 16:49:08 +02:00
parent d828ef93f2
commit d289bc13ac
3 changed files with 13 additions and 43 deletions

View File

@@ -76,7 +76,6 @@ if (!empty($load_extensions) && function_exists('dl'))
require($phpbb_root_path . 'includes/class_loader.' . $phpEx);
require($phpbb_root_path . 'includes/functions.' . $phpEx);
require($phpbb_root_path . 'includes/functions_admin.' . $phpEx);
require($phpbb_root_path . 'includes/functions_content.' . $phpEx);
require($phpbb_root_path . 'includes/constants.' . $phpEx);
@@ -119,6 +118,8 @@ $config = new phpbb_config_db($db, $cache->get_driver(), CONFIG_TABLE);
set_config(null, null, null, $config);
set_config_count(null, null, null, $config);
$phpbb_log = new phpbb_log(LOG_TABLE);
// load extensions
$phpbb_extension_manager = new phpbb_extension_manager($db, EXT_TABLE, $phpbb_root_path, ".$phpEx", $cache->get_driver());
@@ -140,14 +141,6 @@ foreach ($cache->obtain_hooks() as $hook)
@include($phpbb_root_path . 'includes/hooks/' . $hook . '.' . $phpEx);
}
// make sure add_log uses this log instance
$phpbb_log = new phpbb_log(LOG_TABLE);
add_log($phpbb_log); // "dependency injection" for a function
// Parameter 2 and 3 are passed by reference, so we need to create a variable for it.
$tmp_var = '';
view_log($phpbb_log, $tmp_var, $tmp_var); // "dependency injection" for a function
unset($tmp_var);
if (!$config['use_system_cron'])
{
$cron = new phpbb_cron_manager(new phpbb_cron_task_provider($phpbb_extension_manager), $cache->get_driver());