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