/
index.php
188 lines (157 loc) · 4.71 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
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
<?php
/**
* Bancha Requests Collector (Index file)
*
* @package Bancha
* @author Nicholas Valbusa - info@squallstar.it - @squallstar
* @copyright Copyright (c) 2011-2014, Squallstar
* @license GNU/GPL (General Public License)
* @link http://squallstar.it
*
*/
/*
*---------------------------------------------------------------
* BANCHA APPLICATION ENVIRONMENT
*---------------------------------------------------------------
*
* development : the default environment (DB: application/config/database.php)
* sqlite : uses the sqlite internal database (DB: application/config/sqlite/database.php)
* production : errors will not be displayed
*
*/
define('ENVIRONMENT', 'development');
/*
*/
if (defined('ENVIRONMENT'))
{
switch (ENVIRONMENT)
{
case 'sqlite':
case 'development':
error_reporting(-1);
break;
case 'testing':
case 'production':
error_reporting(0);
break;
default:
exit('Bancha application environment is not set correctly.');
}
}
/*
*---------------------------------------------------------------
* CORE FOLDER NAME
*---------------------------------------------------------------
*
* NO TRAILING SLASH!
*
*/
$core_folder = 'core';
/*
*---------------------------------------------------------------
* USER APPLICATION FOLDER NAME
*---------------------------------------------------------------
*
* NO TRAILING SLASH!
*
*/
$user_path = 'application';
/*
*---------------------------------------------------------------
* CODEIGNITER SYSTEM FOLDER NAME
*---------------------------------------------------------------
*
*/
$system_path = $core_folder . '/libraries/codeigniter';
/*
*---------------------------------------------------------------
* THEMES FOLDER NAME
*---------------------------------------------------------------
*
* NO TRAILING SLASH!
*
*/
$themes_folder = 'themes';
/*
*---------------------------------------------------------------
* ADMIN PUBLIC PATH
*---------------------------------------------------------------
*
*/
$admin_path = 'admin/';
// --------------------------------------------------------------------
// END OF USER CONFIGURABLE SETTINGS. DO NOT EDIT BELOW THIS LINE
// --------------------------------------------------------------------
// Set the current directory correctly for CLI requests
if (defined('STDIN'))
{
chdir(dirname(__FILE__));
}
if (realpath($system_path) !== FALSE)
{
$system_path = realpath($system_path).'/';
}
// ensure there's a trailing slash
$system_path = rtrim($system_path, '/').'/';
// Is the system path correct?
if ( ! is_dir($system_path))
{
exit("Your system 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
define('EXT', '.php');
// Path to the system folder
define('BASEPATH', str_replace("\\", "/", $system_path));
// Path to the front controller (this file)
define('FCPATH', str_replace(SELF, '', __FILE__));
// Name of the "system folder"
define('SYSDIR', trim(strrchr(trim(BASEPATH, '/'), '/'), '/'));
//The administration public path
define('ADMIN_PUB_PATH', $admin_path);
// The path to the core folder
if (is_dir($core_folder))
{
define('APPPATH', $core_folder.'/');
}
else
{
if ( ! is_dir(BASEPATH.$core_folder.'/'))
{
exit("Your core folder path does not appear to be set correctly. Please open the following file and correct this: ".SELF);
}
define('APPPATH', BASEPATH.$core_folder.'/');
}
// The path to the "application" folder
if (is_dir($themes_folder))
{
define('THEMESPATH', $themes_folder.'/');
}
else
{
if ( ! is_dir(BASEPATH.$themes_folder.'/'))
{
exit("Your themes folder path does not appear to be set correctly. Please open the following file and correct this: ".SELF);
}
define('THEMESPATH', BASEPATH.$themes_folder.'/');
}
define('USERPATH', $user_path.'/');
//New constant added in CI 2.1
define ('VIEWPATH', APPPATH.'views/' );
/*
* --------------------------------------------------------------------
* LOAD THE BOOTSTRAP FILE
* --------------------------------------------------------------------
*
* And away we go...
*
*/
session_start();
require_once BASEPATH.'core/CodeIgniter.php';
/* End of file index.php */