-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathexponent_variables.php
More file actions
98 lines (89 loc) · 3.03 KB
/
exponent_variables.php
File metadata and controls
98 lines (89 loc) · 3.03 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
<?php
##################################################
#
# Copyright (c) 2004-2006 OIC Group, Inc.
# Written and Designed by James Hunt
#
# This file is part of Exponent
#
# Exponent is free software; you can redistribute
# it and/or modify it under the terms of the GNU
# General Public License as published by the Free
# Software Foundation; either version 2 of the
# License, or (at your option) any later version.
#
# GPL: http://www.gnu.org/licenses/gpl.txt
#
##################################################
if (!defined('BASE')) {
/*
* BASE Constant
*
* The BASE constant is the absolute path on the server filesystem, from the root (/ or C:\)
* to the Exponent directory.
*/
define('BASE',__realpath(dirname(__FILE__)).'/');
}
/*
* EXPONENT Constant
*
* The EXPONENT constant defines the current Major.Minor version of Exponent/Exponent (i.e. 0.95).
* It's definition also signals to other parts of the system that they are operating within the confines
* of the Exponent Framework. (Module actions check this -- if it is not defined, they must abort).
*/
define('EXPONENT', include(BASE.'exponent_version.php'));
if (!defined('PATH_RELATIVE')) {
if (isset($_SERVER['DOCUMENT_ROOT'])) {
/*
* PATH_RELATIVE Constant
*
* The PATH_RELATIVE constant is the web path to the Exponent directory,
* from the web root. It is related to the BASE constant, but different.
*/
define('PATH_RELATIVE',str_replace(__realpath($_SERVER['DOCUMENT_ROOT']),'',BASE));
} else {
// FIXME: PATH_RELATIVE definition will break in certain parts when the server does not offer the Document_root.
// FIXME: Notable, it breaks in the installer.
// This triggers on IIS, which has no DOCUMENT_ROOT.
define('PATH_RELATIVE',__realpath(dirname($_SERVER['SCRIPT_NAME']) . '/'));
}
}
if (!defined('HOSTNAME')) {
if (isset($_SERVER['HTTP_HOST'])) {
define('HOSTNAME',$_SERVER['HTTP_HOST']);
} else if (isset($_SERVER['SERVER_NAME'])) {
define('HOSTNAME',$_SERVER['SERVER_NAME']);
}
}
if (!defined('URL_BASE')) {
/*
* URL_BASE Constant
*
* The URL_BASE constant is the base URL of the domain hosting the Exponent site.
* It does not include the PATH_RELATIVE information. The automatic
* detection code can figure out if the server is running in SSL mode or not
*/
define('URL_BASE',((isset($_SERVER['HTTPS']) && $_SERVER['HTTPS'] == 'on') ? 'https://' : 'http://') . HOSTNAME);
}
if (!defined('URL_FULL')) {
/*
* URL_FULL Constant
*
* The URL_FULL constant is the full URL path to the Exponent directory. The automatic
* detection code can figure out if the server is running in SSL mode or not.
*/
define('URL_FULL', URL_BASE.PATH_RELATIVE);
}
if (defined('SCRIPT_EXP_RELATIVE')) {
define('SCRIPT_RELATIVE', PATH_RELATIVE.SCRIPT_EXP_RELATIVE);
define('SCRIPT_ABSOLUTE', BASE.SCRIPT_EXP_RELATIVE);
} else {
ob_start();
define('SCRIPT_RELATIVE', PATH_RELATIVE);
define('SCRIPT_ABSOLUTE', BASE);
}
if (!defined('SCRIPT_FILENAME')) {
define('SCRIPT_FILENAME', 'index.php');
}
include_once(BASE . '/subsystems/config/load.php');
?>