Verzeichnisstruktur phpBB-3.2.0


Veröffentlicht
06.01.2017

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.
Auf den Verzeichnisnamen klicken, dies zeigt nur das Verzeichnis mit Inhalt an

(Beispiel Datei-Icons)

Auf das Icon klicken um den Quellcode anzuzeigen

startup.php

Zuletzt modifiziert: 09.10.2024, 12:51 - Dateigröße: 4.34 KiB


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  $level = E_ALL & ~E_NOTICE & ~E_DEPRECATED;
023  error_reporting($level);
024   
025  /*
026  * Remove variables created by register_globals from the global scope
027  * Thanks to Matt Kavanagh
028  */
029  function deregister_globals()
030  {
031      $not_unset = array(
032          'GLOBALS'    => true,
033          '_GET'        => true,
034          '_POST'        => true,
035          '_COOKIE'    => true,
036          '_REQUEST'    => true,
037          '_SERVER'    => true,
038          '_SESSION'    => true,
039          '_ENV'        => true,
040          '_FILES'    => true,
041          'phpEx'        => true,
042          'phpbb_root_path'    => true
043      );
044   
045      // Not only will array_merge and array_keys give a warning if
046      // a parameter is not an array, array_merge will actually fail.
047      // So we check if _SESSION has been initialised.
048      if (!isset($_SESSION) || !is_array($_SESSION))
049      {
050          $_SESSION = array();
051      }
052   
053      // Merge all into one extremely huge array; unset this later
054      $input = array_merge(
055          array_keys($_GET),
056          array_keys($_POST),
057          array_keys($_COOKIE),
058          array_keys($_SERVER),
059          array_keys($_SESSION),
060          array_keys($_ENV),
061          array_keys($_FILES)
062      );
063   
064      foreach ($input as $varname)
065      {
066          if (isset($not_unset[$varname]))
067          {
068              // Hacking attempt. No point in continuing.
069              if (isset($_COOKIE[$varname]))
070              {
071                  echo "Clear your cookies. ";
072              }
073              echo "Malicious variable name detected. Contact the administrator and ask them to disable register_globals.";
074              exit;
075          }
076   
077          unset($GLOBALS[$varname]);
078      }
079   
080      unset($input);
081  }
082   
083  // Register globals and magic quotes have been dropped in PHP 5.4
084  if (version_compare(PHP_VERSION, '5.4.0-dev', '>='))
085  {
086      /**
087      * @ignore
088      */
089      define('STRIP', false);
090  }
091  else
092  {
093      if (get_magic_quotes_runtime())
094      {
095          // Deactivate
096          @set_magic_quotes_runtime(0);
097      }
098   
099      // Be paranoid with passed vars
100      if (@ini_get('register_globals') == '1' || strtolower(@ini_get('register_globals')) == 'on' || !function_exists('ini_get'))
101      {
102          deregister_globals();
103      }
104   
105      define('STRIP', (get_magic_quotes_gpc()) ? true : false);
106  }
107   
108  // In PHP 5.3.0 the error level has been raised to E_WARNING which causes problems
109  // because we show E_WARNING errors and do not set a default timezone.
110  // This is because we have our own timezone handling and work in UTC only anyway.
111   
112  // So what we basically want to do is set our timezone to UTC,
113  // but we don't know what other scripts (such as bridges) are involved,
114  // so we check whether a timezone is already set by calling date_default_timezone_get().
115   
116  // Unfortunately, date_default_timezone_get() itself might throw E_WARNING
117  // if no timezone has been set, so we have to keep it quiet with @.
118   
119  // date_default_timezone_get() tries to guess the correct timezone first
120  // and then falls back to UTC when everything fails.
121  // We just set the timezone to whatever date_default_timezone_get() returns.
122  date_default_timezone_set(@date_default_timezone_get());
123   
124  // Autoloading of dependencies.
125  // Three options are supported:
126  // 1. If dependencies are installed with Composer, Composer will create a
127  //    vendor/autoload.php. If this file exists it will be
128  //    automatically used by phpBB. This is the default mode that phpBB
129  //    will use when shipped.
130  // 2. To disable composer autoloading, PHPBB_NO_COMPOSER_AUTOLOAD can be specified.
131  //       Additionally specify PHPBB_AUTOLOAD=/path/to/autoload.php in the
132  //    environment. This is useful for running CLI scripts and tests.
133  //    /path/to/autoload.php should define and register class loaders
134  //    for all of phpBB's dependencies.
135  // 3. You can also set PHPBB_NO_COMPOSER_AUTOLOAD without setting PHPBB_AUTOLOAD.
136  //    In this case autoloading needs to be defined before running any phpBB
137  //    script. This might be useful in cases when phpBB is integrated into a
138  //    larger program.
139  if (getenv('PHPBB_NO_COMPOSER_AUTOLOAD'))
140  {
141      if (getenv('PHPBB_AUTOLOAD'))
142      {
143          require(getenv('PHPBB_AUTOLOAD'));
144      }
145  }
146  else
147  {
148      if (!file_exists($phpbb_root_path . 'vendor/autoload.php'))
149      {
150          trigger_error(
151              'Composer dependencies have not been set up yet, run ' .
152              "'php ../composer.phar install' from the phpBB directory to do so.",
153              E_USER_ERROR
154          );
155      }
156      require($phpbb_root_path . 'vendor/autoload.php');
157  }
158   
159  $starttime = microtime(true);
160