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

      (Beispiel Datei-Icons)

Auf das Icon klicken um den Quellcode anzuzeigen

common.php

Zuletzt modifiziert: 09.10.2024, 12:50 - Dateigröße: 4.63 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  * Minimum Requirement: PHP 5.3.3
 016  */
 017   
 018  if (!defined('IN_PHPBB'))
 019  {
 020      exit;
 021  }
 022   
 023  require($phpbb_root_path . 'includes/startup.' . $phpEx);
 024  require($phpbb_root_path . 'phpbb/class_loader.' . $phpEx);
 025   
 026  $phpbb_class_loader = new \phpbb\class_loader('phpbb\\', "{$phpbb_root_path}phpbb/", $phpEx);
 027  $phpbb_class_loader->register();
 028   
 029  $phpbb_config_php_file = new \phpbb\config_php_file($phpbb_root_path, $phpEx);
 030  extract($phpbb_config_php_file->get_all());
 031   
 032  if (!defined('PHPBB_INSTALLED'))
 033  {
 034      // Redirect the user to the installer
 035      require($phpbb_root_path . 'includes/functions.' . $phpEx);
 036   
 037      // We have to generate a full HTTP/1.1 header here since we can't guarantee to have any of the information
 038      // available as used by the redirect function
 039      $server_name = (!empty($_SERVER['HTTP_HOST'])) ? strtolower($_SERVER['HTTP_HOST']) : ((!empty($_SERVER['SERVER_NAME'])) ? $_SERVER['SERVER_NAME'] : getenv('SERVER_NAME'));
 040      $server_port = (!empty($_SERVER['SERVER_PORT'])) ? (int) $_SERVER['SERVER_PORT'] : (int) getenv('SERVER_PORT');
 041      $secure = (isset($_SERVER['HTTPS']) && $_SERVER['HTTPS'] == 'on') ? 1 : 0;
 042   
 043      $script_name = (!empty($_SERVER['PHP_SELF'])) ? $_SERVER['PHP_SELF'] : getenv('PHP_SELF');
 044      if (!$script_name)
 045      {
 046          $script_name = (!empty($_SERVER['REQUEST_URI'])) ? $_SERVER['REQUEST_URI'] : getenv('REQUEST_URI');
 047      }
 048   
 049      // $phpbb_root_path accounts for redirects from e.g. /adm
 050      $script_path = trim(dirname($script_name)) . '/' . $phpbb_root_path . 'install/index.' . $phpEx;
 051      // Replace any number of consecutive backslashes and/or slashes with a single slash
 052      // (could happen on some proxy setups and/or Windows servers)
 053      $script_path = preg_replace('#[\\\\/]{2,}#', '/', $script_path);
 054   
 055      // Eliminate . and .. from the path
 056      require($phpbb_root_path . 'phpbb/filesystem.' . $phpEx);
 057      $phpbb_filesystem = new phpbb\filesystem();
 058      $script_path = $phpbb_filesystem->clean_path($script_path);
 059   
 060      $url = (($secure) ? 'https://' : 'http://') . $server_name;
 061   
 062      if ($server_port && (($secure && $server_port <> 443) || (!$secure && $server_port <> 80)))
 063      {
 064          // HTTP HOST can carry a port number...
 065          if (strpos($server_name, ':') === false)
 066          {
 067              $url .= ':' . $server_port;
 068          }
 069      }
 070   
 071      $url .= $script_path;
 072      header('Location: ' . $url);
 073      exit;
 074  }
 075   
 076  // In case $phpbb_adm_relative_path is not set (in case of an update), use the default.
 077  $phpbb_adm_relative_path = (isset($phpbb_adm_relative_path)) ? $phpbb_adm_relative_path : 'adm/';
 078  $phpbb_admin_path = (defined('PHPBB_ADMIN_PATH')) ? PHPBB_ADMIN_PATH : $phpbb_root_path . $phpbb_adm_relative_path;
 079   
 080  // Include files
 081  require($phpbb_root_path . 'includes/functions.' . $phpEx);
 082  require($phpbb_root_path . 'includes/functions_content.' . $phpEx);
 083  include($phpbb_root_path . 'includes/functions_compatibility.' . $phpEx);
 084   
 085  require($phpbb_root_path . 'includes/constants.' . $phpEx);
 086  require($phpbb_root_path . 'includes/utf/utf_tools.' . $phpEx);
 087   
 088  // Set PHP error handler to ours
 089  set_error_handler(defined('PHPBB_MSG_HANDLER') ? PHPBB_MSG_HANDLER : 'msg_handler');
 090   
 091  $phpbb_class_loader_ext = new \phpbb\class_loader('\\', "{$phpbb_root_path}ext/", $phpEx);
 092  $phpbb_class_loader_ext->register();
 093   
 094  phpbb_load_extensions_autoloaders($phpbb_root_path);
 095   
 096  // Set up container
 097  $phpbb_container_builder = new \phpbb\di\container_builder($phpbb_config_php_file, $phpbb_root_path, $phpEx);
 098  $phpbb_container = $phpbb_container_builder->get_container();
 099   
 100  $phpbb_class_loader->set_cache($phpbb_container->get('cache.driver'));
 101  $phpbb_class_loader_ext->set_cache($phpbb_container->get('cache.driver'));
 102   
 103  require($phpbb_root_path . 'includes/compatibility_globals.' . $phpEx);
 104   
 105  // Add own hook handler
 106  require($phpbb_root_path . 'includes/hooks/index.' . $phpEx);
 107  $phpbb_hook = new phpbb_hook(array('exit_handler', 'phpbb_user_session_handler', 'append_sid', array('template', 'display')));
 108  $phpbb_hook_finder = $phpbb_container->get('hook_finder');
 109   
 110  foreach ($phpbb_hook_finder->find() as $hook)
 111  {
 112      @include($phpbb_root_path . 'includes/hooks/' . $hook . '.' . $phpEx);
 113  }
 114   
 115  /**
 116  * Main event which is triggered on every page
 117  *
 118  * You can use this event to load function files and initiate objects
 119  *
 120  * NOTE:    At this point the global session ($user) and permissions ($auth)
 121  *        do NOT exist yet. If you need to use the user object
 122  *        (f.e. to include language files) or need to check permissions,
 123  *        please use the core.user_setup event instead!
 124  *
 125  * @event core.common
 126  * @since 3.1.0-a1
 127  */
 128  $phpbb_dispatcher->dispatch('core.common');
 129