XOOPS  2.6.0
mainfile.dist.php
Go to the documentation of this file.
1 <?php
2 /*
3  You may not change or alter any portion of this comment or credits
4  of supporting developers from this source code or any supporting source code
5  which is considered copyrighted (c) material of the original comment or credit authors.
6 
7  This program is distributed in the hope that it will be useful,
8  but WITHOUT ANY WARRANTY; without even the implied warranty of
9  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
10 */
11 
20 if (!defined("XOOPS_MAINFILE_INCLUDED")) {
21  define("XOOPS_MAINFILE_INCLUDED", 1);
22 
23  // XOOPS Physical Paths
24 
25  // Physical path to the XOOPS documents (served) directory WITHOUT trailing slash
26  define("XOOPS_ROOT_PATH", "");
27 
28  // For forward compatibility
29  // Physical path to the XOOPS library directory WITHOUT trailing slash
30  define("XOOPS_PATH", "");
31  // Physical path to the XOOPS datafiles (writable) directory WITHOUT trailing slash
32  define("XOOPS_VAR_PATH", "");
33  // Alias of XOOPS_PATH, for compatibility, temporary solution
34  define("XOOPS_TRUST_PATH", XOOPS_PATH);
35 
36  // URL Association for SSL and Protocol Compatibility
37  $http = 'http://';
38  if (!empty($_SERVER['HTTPS'])) {
39  $http = ($_SERVER['HTTPS']=='on') ? 'https://' : 'http://';
40  }
41  define('XOOPS_PROT', $http);
42 
43  // XOOPS Virtual Path (URL)
44  // Virtual path to your main XOOPS directory WITHOUT trailing slash
45  // Example: define("XOOPS_URL", "http://url_to_xoops_directory");
46  define("XOOPS_URL", "http://");
47 
48  // Shall be handled later, don't forget!
49  define("XOOPS_CHECK_PATH", 0);
50  // Protect against external scripts execution if safe mode is not enabled
51  if (XOOPS_CHECK_PATH && !@ini_get("safe_mode")) {
52  if (function_exists("debug_backtrace")) {
53  $xoopsScriptPath = debug_backtrace();
54  if (!count($xoopsScriptPath)) {
55  die("XOOPS path check: this file cannot be requested directly");
56  }
57  $xoopsScriptPath = $xoopsScriptPath[0]["file"];
58  } else {
59  $xoopsScriptPath = isset($_SERVER["PATH_TRANSLATED"]) ? $_SERVER["PATH_TRANSLATED"] : $_SERVER["SCRIPT_FILENAME"];
60  }
61  if (DIRECTORY_SEPARATOR != "/") {
62  // IIS6 may double the \ chars
63  $xoopsScriptPath = str_replace(strpos($xoopsScriptPath, "\\\\", 2) ? "\\\\" : DIRECTORY_SEPARATOR, "/", $xoopsScriptPath);
64  }
65  if (strcasecmp(substr($xoopsScriptPath, 0, strlen(XOOPS_ROOT_PATH)), str_replace(DIRECTORY_SEPARATOR, "/", XOOPS_ROOT_PATH))) {
66  exit("XOOPS path check: Script is not inside XOOPS_ROOT_PATH and cannot run.");
67  }
68  }
69 
70  // Secure file
71  require XOOPS_VAR_PATH . '/data/secure.php';
72 
73  if (!class_exists('XoopsBaseConfig', false)) {
74  include __DIR__ . '/class/XoopsBaseConfig.php';
76  }
77 
78  if (!isset($xoopsOption["nocommon"]) && XOOPS_ROOT_PATH != "") {
79  include XOOPS_ROOT_PATH."/include/common.php";
80  }
81 
82 }
$_SERVER['REQUEST_URI']
$xoopsOption['nocommon']
Definition: browse.php:22
exit
Definition: browse.php:104
static bootstrapTransition()
defined('DS') or define('DS' DIRECTORY_SEPARATOR
Definition: common.php:41