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