Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Newer
Older
100644 204 lines (176 sloc) 6.356 kB
e06ddc9 first commit
Alessandro Arnodo authored
1 <?php
2 /*
3 *---------------------------------------------------------------
4 * APPLICATION ENVIRONMENT
5 *---------------------------------------------------------------
6 *
7 * You can load different configurations depending on your
8 * current environment. Setting the environment also influences
9 * things like logging and error reporting.
10 *
11 * This can be set to anything, but default usage is:
12 *
13 * development
14 * testing
15 * production
16 *
17 * NOTE: If you change these, also change the error_reporting() code below
18 *
19 */
20 define('ENVIRONMENT', 'development');
21 /*
22 *---------------------------------------------------------------
23 * ERROR REPORTING
24 *---------------------------------------------------------------
25 *
26 * Different environments will require different levels of error reporting.
27 * By default development will show errors but testing and live will hide them.
28 */
29
30 if (defined('ENVIRONMENT'))
31 {
32 switch (ENVIRONMENT)
33 {
34 case 'development':
35 error_reporting(E_ALL);
36 break;
37
38 case 'testing':
39 case 'production':
40 error_reporting(0);
41 break;
42
43 default:
44 exit('The application environment is not set correctly.');
45 }
46 }
47
48 /*
49 *---------------------------------------------------------------
50 * SYSTEM FOLDER NAME
51 *---------------------------------------------------------------
52 *
53 * This variable must contain the name of your "system" folder.
54 * Include the path if the folder is not in the same directory
55 * as this file.
56 *
57 */
58 $system_path = 'system';
59
60 /*
61 *---------------------------------------------------------------
62 * APPLICATION FOLDER NAME
63 *---------------------------------------------------------------
64 *
65 * If you want this front controller to use a different "application"
66 * folder then the default one you can set its name here. The folder
67 * can also be renamed or relocated anywhere on your server. If
68 * you do, use a full server path. For more info please see the user guide:
69 * http://codeigniter.com/user_guide/general/managing_apps.html
70 *
71 * NO TRAILING SLASH!
72 *
73 */
74 $application_folder = 'application';
75
76 /*
77 * --------------------------------------------------------------------
78 * DEFAULT CONTROLLER
79 * --------------------------------------------------------------------
80 *
81 * Normally you will set your default controller in the routes.php file.
82 * You can, however, force a custom routing by hard-coding a
83 * specific controller class/function here. For most applications, you
84 * WILL NOT set your routing here, but it's an option for those
85 * special instances where you might want to override the standard
86 * routing in a specific front controller that shares a common CI installation.
87 *
88 * IMPORTANT: If you set the routing here, NO OTHER controller will be
89 * callable. In essence, this preference limits your application to ONE
90 * specific controller. Leave the function name blank if you need
91 * to call functions dynamically via the URI.
92 *
93 * Un-comment the $routing array below to use this feature
94 *
95 */
96 // The directory name, relative to the "controllers" folder. Leave blank
97 // if your controller is not in a sub-folder within the "controllers" folder
98 // $routing['directory'] = '';
99
100 // The controller class file name. Example: Mycontroller
101 // $routing['controller'] = '';
102
103 // The controller function you wish to be called.
104 // $routing['function'] = '';
105
106
107 /*
108 * -------------------------------------------------------------------
109 * CUSTOM CONFIG VALUES
110 * -------------------------------------------------------------------
111 *
112 * The $assign_to_config array below will be passed dynamically to the
113 * config class when initialized. This allows you to set custom config
114 * items or override any default config values found in the config.php file.
115 * This can be handy as it permits you to share one application between
116 * multiple front controller files, with each file containing different
117 * config values.
118 *
119 * Un-comment the $assign_to_config array below to use this feature
120 *
121 */
122 // $assign_to_config['name_of_config_item'] = 'value of config item';
123
124
125
126 // --------------------------------------------------------------------
127 // END OF USER CONFIGURABLE SETTINGS. DO NOT EDIT BELOW THIS LINE
128 // --------------------------------------------------------------------
129
130 /*
131 * ---------------------------------------------------------------
132 * Resolve the system path for increased reliability
133 * ---------------------------------------------------------------
134 */
135
136 // Set the current directory correctly for CLI requests
137 if (defined('STDIN'))
138 {
139 chdir(dirname(__FILE__));
140 }
141
142 if (realpath($system_path) !== FALSE)
143 {
144 $system_path = realpath($system_path).'/';
145 }
146
147 // ensure there's a trailing slash
148 $system_path = rtrim($system_path, '/').'/';
149
150 // Is the system path correct?
151 if ( ! is_dir($system_path))
152 {
153 exit("Your system folder path does not appear to be set correctly. Please open the following file and correct this: ".pathinfo(__FILE__, PATHINFO_BASENAME));
154 }
155
156 /*
157 * -------------------------------------------------------------------
158 * Now that we know the path, set the main path constants
159 * -------------------------------------------------------------------
160 */
161 // The name of THIS file
162 define('SELF', pathinfo(__FILE__, PATHINFO_BASENAME));
163
164 // The PHP file extension
165 // this global constant is deprecated.
166 define('EXT', '.php');
167
168 // Path to the system folder
169 define('BASEPATH', str_replace("\\", "/", $system_path));
170
171 // Path to the front controller (this file)
172 define('FCPATH', str_replace(SELF, '', __FILE__));
173
174 // Name of the "system folder"
175 define('SYSDIR', trim(strrchr(trim(BASEPATH, '/'), '/'), '/'));
176
177
178 // The path to the "application" folder
179 if (is_dir($application_folder))
180 {
181 define('APPPATH', $application_folder.'/');
182 }
183 else
184 {
185 if ( ! is_dir(BASEPATH.$application_folder.'/'))
186 {
187 exit("Your application folder path does not appear to be set correctly. Please open the following file and correct this: ".SELF);
188 }
189
190 define('APPPATH', BASEPATH.$application_folder.'/');
191 }
192
193 /*
194 * --------------------------------------------------------------------
195 * LOAD THE BOOTSTRAP FILE
196 * --------------------------------------------------------------------
197 *
198 * And away we go...
199 *
200 */
201 require_once BASEPATH.'core/CodeIgniter.php';
202
203 /* End of file index.php */
204 /* Location: ./index.php */
Something went wrong with that request. Please try again.