-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.php
148 lines (121 loc) · 3.86 KB
/
index.php
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
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
<?php
/*
* To change this template, choose Tools | Templates
* and open the template in the editor.
* @Author:tutengfei
* 2014/08/19
* ---------------------------------------------------------------
* APPLICATION ENVIRONMENT
* ---------------------------------------------------------------
*
* You can load different configurations depending on your
* current environment. Setting the environment also influences
* things like logging and error reporting.
*
* This can be set to anything, but default usage is:
*
* development
* testing
* production
*
* NOTE: If you change these, also change the error_reporting() code below
*
*/
/** define error report parameter * */
define('ENVIRONMENT', 'development');
/*
*
* The Type of ENVIRONMENT:
* E_ERROR | E_WARNING | E_PARSE | E_NOTICE
* Your can select type of ENVIROMENT.
*
*/
if (defined('ENVIRONMENT')) {
switch (ENVIRONMENT) {
case 'development':
error_reporting(E_ALL);
break;
case 'testing':
error_reporting(E_ALL);
break;
case 'production':
error_reporting(0);
break;
default:
exit('The application environment is not set correctly.');
}
}
/*
* ---------------------------------------------------------------
* SAPPHO FOLDER NAME
* ---------------------------------------------------------------
*
* This variable must contain the name of your "saphho" folder.
* Include the path if the folder is not in the same directory
* as this file.
*
*/
$spahho_path = 'sappho';
/*
* ---------------------------------------------------------------
* APPLICATION FOLDER NAME
* ---------------------------------------------------------------
*
* If you want this front controller to use a different "application"
* folder then the default one you can set its name here. The folder
* can also be renamed or relocated anywhere on your server. If
* you do, use a full server path.
*
*
*/
$application_folder = 'application';
// Set the current directory correctly for CLI requests
if (defined('STDIN')) {
chdir(dirname(__FILE__));
}
if (realpath($spahho_path) !== FALSE) {
$spahho_path = realpath($spahho_path) . '/';
}
// ensure there's a trailing slash
$spahho_path = rtrim($spahho_path, '/') . '/';
// Is the spahho path correct?
if (!is_dir($spahho_path)) {
exit("Your spahho folder path does not appear to be set correctly. Please open the following file and correct this: " . pathinfo(__FILE__, PATHINFO_BASENAME));
}
/*
* -------------------------------------------------------------------
* Now that we know the path, set the main path constants
* -------------------------------------------------------------------
*/
// The name of THIS file
define('SELF', pathinfo(__FILE__, PATHINFO_BASENAME));
// The PHP file extension
// this global constant is deprecated.
define('EXT', '.php');
// Path to the sappho folder
define('BASEPATH', str_replace("\\", "/", $spahho_path));
// Path to the front controller (this file)
define('FCPATH', str_replace(SELF, '', __FILE__));
// Name of the "spahho folder"
define('SYSDIR', trim(strrchr(trim(BASEPATH, '/'), '/'), '/'));
// The path to the "application" folder
if (is_dir($application_folder)) {
define('APPPATH', $application_folder . '/');
} else {
if (!is_dir(BASEPATH . $application_folder . '/')) {
exit("Your application folder path does not appear to be set correctly. Please open the following file and correct this: " . SELF);
}
define('APPPATH', BASEPATH . $application_folder . '/');
}
/*
* --------------------------------------------------------------------
* LOAD THE BOOTSTRAP FILE
* --------------------------------------------------------------------
*
* And away we go...
*
*/
require_once BASEPATH.'core/Sappho.php';
/* End of file index.php */
/* Location: ./index.php */
?>