indvdum@0: 443) || (!$secure && $server_port <> 80))) indvdum@0: { indvdum@0: // HTTP HOST can carry a port number... indvdum@0: if (strpos($server_name, ':') === false) indvdum@0: { indvdum@0: $url .= ':' . $server_port; indvdum@0: } indvdum@0: } indvdum@0: indvdum@0: $url .= $script_path; indvdum@0: header('Location: ' . $url); indvdum@0: exit; indvdum@0: } indvdum@0: indvdum@0: if (defined('DEBUG_EXTRA')) indvdum@0: { indvdum@0: $base_memory_usage = 0; indvdum@0: if (function_exists('memory_get_usage')) indvdum@0: { indvdum@0: $base_memory_usage = memory_get_usage(); indvdum@0: } indvdum@0: } indvdum@0: indvdum@0: // Load Extensions indvdum@0: // dl() is deprecated and disabled by default as of PHP 5.3. indvdum@0: if (!empty($load_extensions) && function_exists('dl')) indvdum@0: { indvdum@0: $load_extensions = explode(',', $load_extensions); indvdum@0: indvdum@0: foreach ($load_extensions as $extension) indvdum@0: { indvdum@0: @dl(trim($extension)); indvdum@0: } indvdum@0: } indvdum@0: indvdum@0: // Include files indvdum@0: require($phpbb_root_path . 'includes/acm/acm_' . $acm_type . '.' . $phpEx); indvdum@0: require($phpbb_root_path . 'includes/cache.' . $phpEx); indvdum@0: require($phpbb_root_path . 'includes/template.' . $phpEx); indvdum@0: require($phpbb_root_path . 'includes/session.' . $phpEx); indvdum@0: require($phpbb_root_path . 'includes/auth.' . $phpEx); indvdum@0: indvdum@0: require($phpbb_root_path . 'includes/functions.' . $phpEx); indvdum@0: require($phpbb_root_path . 'includes/functions_content.' . $phpEx); indvdum@0: indvdum@0: require($phpbb_root_path . 'includes/constants.' . $phpEx); indvdum@0: require($phpbb_root_path . 'includes/db/' . $dbms . '.' . $phpEx); indvdum@0: require($phpbb_root_path . 'includes/utf/utf_tools.' . $phpEx); indvdum@0: indvdum@0: // Set PHP error handler to ours indvdum@0: set_error_handler(defined('PHPBB_MSG_HANDLER') ? PHPBB_MSG_HANDLER : 'msg_handler'); indvdum@0: indvdum@0: // Instantiate some basic classes indvdum@0: $user = new user(); indvdum@0: $auth = new auth(); indvdum@0: $template = new template(); indvdum@0: $cache = new cache(); indvdum@0: $db = new $sql_db(); indvdum@0: indvdum@0: // Connect to DB indvdum@0: $db->sql_connect($dbhost, $dbuser, $dbpasswd, $dbname, $dbport, false, defined('PHPBB_DB_NEW_LINK') ? PHPBB_DB_NEW_LINK : false); indvdum@0: indvdum@0: // We do not need this any longer, unset for safety purposes indvdum@0: unset($dbpasswd); indvdum@0: indvdum@0: // Grab global variables, re-cache if necessary indvdum@0: $config = $cache->obtain_config(); indvdum@0: indvdum@0: // Add own hook handler indvdum@0: require($phpbb_root_path . 'includes/hooks/index.' . $phpEx); indvdum@0: $phpbb_hook = new phpbb_hook(array('exit_handler', 'phpbb_user_session_handler', 'append_sid', array('template', 'display'))); indvdum@0: indvdum@0: foreach ($cache->obtain_hooks() as $hook) indvdum@0: { indvdum@0: @include($phpbb_root_path . 'includes/hooks/' . $hook . '.' . $phpEx); indvdum@0: } indvdum@0: indvdum@0: ?>