From dea1d660fb63b07451f1a43310de359251462644 Mon Sep 17 00:00:00 2001 From: Nils Adermann Date: Fri, 25 Jun 2010 14:38:53 +0200 Subject: [feature/auto-loading] Added autoloader to common and ensured compatability The autoloader is registered in install without caching, since caching is set up during installation. This provides the same functionality, performance is not a concern during installation anyway. In common.php the autoloader is instantiated after the cache is initialised and is started with the standard cache backend used for other cached values. A few places in the code using class_exists had to be updated to explicitly avoid autoloading, since they are used to check whether a file needs to be included which does not (yet) follow the naming scheme the autoloader follows. PHPBB3-9682 --- phpBB/common.php | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'phpBB/common.php') diff --git a/phpBB/common.php b/phpBB/common.php index 9b6913e95f..6cc7abf118 100644 --- a/phpBB/common.php +++ b/phpBB/common.php @@ -188,6 +188,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); @@ -211,6 +212,9 @@ $template = new template(); $cache = new cache(); $db = new $sql_db(); +$class_loader = new phpbb_class_loader($phpbb_root_path, '.' . $phpEx, $cache); +$class_loader->register(); + // Connect to DB $db->sql_connect($dbhost, $dbuser, $dbpasswd, $dbname, $dbport, false, defined('PHPBB_DB_NEW_LINK') ? PHPBB_DB_NEW_LINK : false); -- cgit v1.2.1