aboutsummaryrefslogtreecommitdiffstats
path: root/phpBB/common.php
diff options
context:
space:
mode:
Diffstat (limited to 'phpBB/common.php')
-rw-r--r--phpBB/common.php42
1 files changed, 25 insertions, 17 deletions
diff --git a/phpBB/common.php b/phpBB/common.php
index 491addc5e0..061290dcea 100644
--- a/phpBB/common.php
+++ b/phpBB/common.php
@@ -6,7 +6,7 @@
* @copyright (c) 2005 phpBB Group
* @license http://opensource.org/licenses/gpl-license.php GNU Public License
*
-* Minimum Requirement: PHP 4.3.3
+* Minimum Requirement: PHP 5.2.0
*/
/**
@@ -59,15 +59,6 @@ if (!defined('PHPBB_INSTALLED'))
exit;
}
-if (defined('DEBUG_EXTRA'))
-{
- $base_memory_usage = 0;
- if (function_exists('memory_get_usage'))
- {
- $base_memory_usage = memory_get_usage();
- }
-}
-
// Load Extensions
// dl() is deprecated and disabled by default as of PHP 5.3.
if (!empty($load_extensions) && function_exists('dl'))
@@ -81,9 +72,7 @@ if (!empty($load_extensions) && function_exists('dl'))
}
// Include files
-require($phpbb_root_path . 'includes/acm/acm_' . $acm_type . '.' . $phpEx);
-require($phpbb_root_path . 'includes/cache.' . $phpEx);
-require($phpbb_root_path . 'includes/template.' . $phpEx);
+require($phpbb_root_path . 'includes/class_loader.' . $phpEx);
require($phpbb_root_path . 'includes/session.' . $phpEx);
require($phpbb_root_path . 'includes/auth.' . $phpEx);
@@ -97,13 +86,24 @@ 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
+$class_loader = new phpbb_class_loader($phpbb_root_path, '.' . $phpEx);
+$class_loader->register();
+
+// set up caching
+$cache_factory = new phpbb_cache_factory($acm_type);
+$cache = $cache_factory->get_service();
+$class_loader->set_cache($cache->get_driver());
+
// 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);
@@ -111,7 +111,12 @@ $db->sql_connect($dbhost, $dbuser, $dbpasswd, $dbname, $dbport, false, defined('
unset($dbpasswd);
// Grab global variables, re-cache if necessary
-$config = $cache->obtain_config();
+$config = new phpbb_config_db($db, $cache->get_driver(), CONFIG_TABLE);
+set_config(null, null, null, $config);
+set_config_count(null, null, null, $config);
+
+$template_locator = new phpbb_template_locator();
+$template = new phpbb_template($phpbb_root_path, $phpEx, $config, $user, $template_locator);
// Add own hook handler
require($phpbb_root_path . 'includes/hooks/index.' . $phpEx);
@@ -122,4 +127,7 @@ foreach ($cache->obtain_hooks() as $hook)
@include($phpbb_root_path . 'includes/hooks/' . $hook . '.' . $phpEx);
}
-?> \ No newline at end of file
+if (!$config['use_system_cron'])
+{
+ $cron = new phpbb_cron_manager($phpbb_root_path . 'includes/cron/task', $phpEx, $cache->get_driver());
+}