aboutsummaryrefslogtreecommitdiffstats
path: root/phpBB/common.php
diff options
context:
space:
mode:
Diffstat (limited to 'phpBB/common.php')
-rw-r--r--phpBB/common.php13
1 files changed, 12 insertions, 1 deletions
diff --git a/phpBB/common.php b/phpBB/common.php
index c8b2fb9609..1729729a61 100644
--- a/phpBB/common.php
+++ b/phpBB/common.php
@@ -186,6 +186,7 @@ if (!empty($load_extensions) && function_exists('dl'))
}
// Include files
+require($phpbb_root_path . 'includes/class_loader.' . $phpEx);
require($phpbb_root_path . 'includes/acm/acm_' . $acm_type . '.' . $phpEx);
require($phpbb_root_path . 'includes/cache.' . $phpEx);
require($phpbb_root_path . 'includes/template.' . $phpEx);
@@ -202,13 +203,23 @@ 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');
+// Cache must be loaded before class loader
+$cache = new cache();
+
+// Setup class loader first
+$class_loader = new phpbb_class_loader($phpbb_root_path, '.' . $phpEx, $cache);
+$class_loader->register();
+
// Instantiate some basic classes
+$request = new phpbb_request();
$user = new user();
$auth = new auth();
$template = new template();
-$cache = new cache();
$db = new $sql_db();
+// make sure request_var uses this request instance
+request_var('', 0, false, false, $request); // "dependency injection" for a function
+
// Connect to DB
$db->sql_connect($dbhost, $dbuser, $dbpasswd, $dbname, $dbport, false, defined('PHPBB_DB_NEW_LINK') ? PHPBB_DB_NEW_LINK : false);