Verzeichnisstruktur phpBB-3.1.0
- Veröffentlicht
- 27.10.2014
So funktioniert es
|
Auf das letzte Element klicken. Dies geht jeweils ein Schritt zurück |
Auf das Icon klicken, dies öffnet das Verzeichnis. Nochmal klicken schließt das Verzeichnis. |
|
(Beispiel Datei-Icons)
|
Auf das Icon klicken um den Quellcode anzuzeigen |
startup.php
001 <?php
002 /**
003 *
004 * This file is part of the phpBB Forum Software package.
005 *
006 * @copyright (c) phpBB Limited <https://www.phpbb.com>
007 * @license GNU General Public License, version 2 (GPL-2.0)
008 *
009 * For full copyright and license information, please see
010 * the docs/CREDITS.txt file.
011 *
012 */
013
014 /**
015 */
016 if (!defined('IN_PHPBB'))
017 {
018 exit;
019 }
020
021 // Report all errors, except notices and deprecation messages
022 if (!defined('E_DEPRECATED'))
023 {
024 define('E_DEPRECATED', 8192);
025 }
026 $level = E_ALL & ~E_NOTICE & ~E_DEPRECATED;
027 error_reporting($level);
028
029 /*
030 * Remove variables created by register_globals from the global scope
031 * Thanks to Matt Kavanagh
032 */
033 function deregister_globals()
034 {
035 $not_unset = array(
036 'GLOBALS' => true,
037 '_GET' => true,
038 '_POST' => true,
039 '_COOKIE' => true,
040 '_REQUEST' => true,
041 '_SERVER' => true,
042 '_SESSION' => true,
043 '_ENV' => true,
044 '_FILES' => true,
045 'phpEx' => true,
046 'phpbb_root_path' => true
047 );
048
049 // Not only will array_merge and array_keys give a warning if
050 // a parameter is not an array, array_merge will actually fail.
051 // So we check if _SESSION has been initialised.
052 if (!isset($_SESSION) || !is_array($_SESSION))
053 {
054 $_SESSION = array();
055 }
056
057 // Merge all into one extremely huge array; unset this later
058 $input = array_merge(
059 array_keys($_GET),
060 array_keys($_POST),
061 array_keys($_COOKIE),
062 array_keys($_SERVER),
063 array_keys($_SESSION),
064 array_keys($_ENV),
065 array_keys($_FILES)
066 );
067
068 foreach ($input as $varname)
069 {
070 if (isset($not_unset[$varname]))
071 {
072 // Hacking attempt. No point in continuing unless it's a COOKIE (so a cookie called GLOBALS doesn't lock users out completely)
073 if ($varname !== 'GLOBALS' || isset($_GET['GLOBALS']) || isset($_POST['GLOBALS']) || isset($_SERVER['GLOBALS']) || isset($_SESSION['GLOBALS']) || isset($_ENV['GLOBALS']) || isset($_FILES['GLOBALS']))
074 {
075 exit;
076 }
077 else
078 {
079 $cookie = &$_COOKIE;
080 while (isset($cookie['GLOBALS']))
081 {
082 if (!is_array($cookie['GLOBALS']))
083 {
084 break;
085 }
086
087 foreach ($cookie['GLOBALS'] as $registered_var => $value)
088 {
089 if (!isset($not_unset[$registered_var]))
090 {
091 unset($GLOBALS[$registered_var]);
092 }
093 }
094 $cookie = &$cookie['GLOBALS'];
095 }
096 }
097 }
098
099 unset($GLOBALS[$varname]);
100 }
101
102 unset($input);
103 }
104
105 // Register globals and magic quotes have been dropped in PHP 5.4
106 if (version_compare(PHP_VERSION, '5.4.0-dev', '>='))
107 {
108 /**
109 * @ignore
110 */
111 define('STRIP', false);
112 }
113 else
114 {
115 @set_magic_quotes_runtime(0);
116
117 // Be paranoid with passed vars
118 if (@ini_get('register_globals') == '1' || strtolower(@ini_get('register_globals')) == 'on' || !function_exists('ini_get'))
119 {
120 deregister_globals();
121 }
122
123 define('STRIP', (get_magic_quotes_gpc()) ? true : false);
124 }
125
126 // Prevent date/time functions from throwing E_WARNING on PHP 5.3 by setting a default timezone
127 if (function_exists('date_default_timezone_set') && function_exists('date_default_timezone_get'))
128 {
129 // For PHP 5.1.0 the date/time functions have been rewritten
130 // and setting a timezone is required prior to calling any date/time function.
131
132 // Since PHP 5.2.0 calls to date/time functions without having a timezone set
133 // result in E_STRICT errors being thrown.
134 // Note: We already exclude E_STRICT errors
135 // (to be exact: they are not included in E_ALL in PHP 5.2)
136
137 // In PHP 5.3.0 the error level has been raised to E_WARNING which causes problems
138 // because we show E_WARNING errors and do not set a default timezone.
139 // This is because we have our own timezone handling and work in UTC only anyway.
140
141 // So what we basically want to do is set our timezone to UTC,
142 // but we don't know what other scripts (such as bridges) are involved,
143 // so we check whether a timezone is already set by calling date_default_timezone_get().
144
145 // Unfortunately, date_default_timezone_get() itself might throw E_WARNING
146 // if no timezone has been set, so we have to keep it quiet with @.
147
148 // date_default_timezone_get() tries to guess the correct timezone first
149 // and then falls back to UTC when everything fails.
150 // We just set the timezone to whatever date_default_timezone_get() returns.
151 date_default_timezone_set(@date_default_timezone_get());
152 }
153
154 // Autoloading of dependencies.
155 // Three options are supported:
156 // 1. If dependencies are installed with Composer, Composer will create a
157 // vendor/autoload.php. If this file exists it will be
158 // automatically used by phpBB. This is the default mode that phpBB
159 // will use when shipped.
160 // 2. To disable composer autoloading, PHPBB_NO_COMPOSER_AUTOLOAD can be specified.
161 // Additionally specify PHPBB_AUTOLOAD=/path/to/autoload.php in the
162 // environment. This is useful for running CLI scripts and tests.
163 // /path/to/autoload.php should define and register class loaders
164 // for all of phpBB's dependencies.
165 // 3. You can also set PHPBB_NO_COMPOSER_AUTOLOAD without setting PHPBB_AUTOLOAD.
166 // In this case autoloading needs to be defined before running any phpBB
167 // script. This might be useful in cases when phpBB is integrated into a
168 // larger program.
169 if (getenv('PHPBB_NO_COMPOSER_AUTOLOAD'))
170 {
171 if (getenv('PHPBB_AUTOLOAD'))
172 {
173 require(getenv('PHPBB_AUTOLOAD'));
174 }
175 }
176 else
177 {
178 if (!file_exists($phpbb_root_path . 'vendor/autoload.php'))
179 {
180 trigger_error(
181 'Composer dependencies have not been set up yet, run ' .
182 "'php ../composer.phar install' from the phpBB directory to do so.",
183 E_USER_ERROR
184 );
185 }
186 require($phpbb_root_path . 'vendor/autoload.php');
187 }
188
189 $starttime = explode(' ', microtime());
190 $starttime = $starttime[1] + $starttime[0];
191