Update code_sniffer build.xml file to be executable on our system
[phpbb.git] / phpBB / includes / core / bootstrap.php
blobf44b48c7db4f1617c66d5125b007aff71f6e1f0d
1 <?php
2 /**
4 * @package core
5 * @version $Id$
6 * @copyright (c) 2008 phpBB Group
7 * @license http://opensource.org/licenses/gpl-license.php GNU Public License
9 * Within this file only the framework with all components but no phpBB-specific things will be loaded
12 /**
14 if (!defined('IN_PHPBB'))
16 exit;
19 $starttime = explode(' ', microtime());
20 $starttime = $starttime[1] + $starttime[0];
22 // Report all errors, except notices
23 error_reporting(E_ALL | E_STRICT); // ^ E_NOTICE
24 date_default_timezone_set('UTC');
26 // Initialize some standard variables, constants and classes we need
27 require_once PHPBB_ROOT_PATH . 'includes/core/core.' . PHP_EXT;
28 require_once PHPBB_ROOT_PATH . 'plugins/bootstrap.' . PHP_EXT;
30 // Define STRIP if it is not already defined
31 if (!defined('STRIP'))
33 // If we are on PHP >= 6.0.0 we do not need some code
34 if (version_compare(PHP_VERSION, '6.0.0-dev', '>='))
36 /**
37 * @ignore
39 define('STRIP', false);
41 else
43 @set_magic_quotes_runtime(0);
45 // We do not allow register globals set
46 if (@ini_get('register_globals') == '1' || strtolower(@ini_get('register_globals')) == 'on' || !function_exists('ini_get'))
48 die('phpBB will not work with register globals turned on. Please turn register globals off.');
51 define('STRIP', (@get_magic_quotes_gpc()) ? true : false);
55 // we check for the cron script and change the root path
56 if (defined('IN_CRON'))
58 @define('PHPBB_ROOT_PATH', dirname(__FILE__) . DIRECTORY_SEPARATOR);
61 // Set some default configuration parameter if the config file does not exist
62 if (!file_exists(PHPBB_ROOT_PATH . 'config.' . PHP_EXT))
64 // phpbb::$base_config['config_set'] = false
65 // This allows common.php or an installation script to do specific actions if the configuration is missing
67 else
69 require PHPBB_ROOT_PATH . 'config.' . PHP_EXT;
72 // Register autoload function
73 spl_autoload_register('__phpbb_autoload');
75 // Set error handler before a real one is there
76 set_error_handler(array('phpbb', 'error_handler'));
78 // Add constants
79 include_once PHPBB_ROOT_PATH . 'includes/constants.' . PHP_EXT;
81 // Add global functions
82 // @todo remove functions_content, trim down functions.php
83 require_once PHPBB_ROOT_PATH . 'includes/functions.' . PHP_EXT;
84 require_once PHPBB_ROOT_PATH . 'includes/functions_content.' . PHP_EXT;
86 // Add UTF8 tools
87 require_once PHPBB_ROOT_PATH . 'includes/utf/utf_tools.' . PHP_EXT;
89 // Add pre-defined system core files
90 require_once PHPBB_ROOT_PATH . 'includes/core/request.' . PHP_EXT;
92 phpbb::register('security', false, 'core/security');
93 phpbb::register('url', false, 'core/url');
94 phpbb::register('system', false, 'core/system');
95 phpbb::register('server-vars', 'phpbb_system_info', 'core/system_info');
97 // Make plugins structure available
98 phpbb::register('plugins');