blob: c50cfed43c7981f67cb17d0d86bcad90b8a04405 [file] [log] [blame]
Derek Allard2067d1a2008-11-13 22:59:24 +00001<?php
Derek Jones0c1e4052010-03-02 14:31:31 -06002
Derek Allard2067d1a2008-11-13 22:59:24 +00003/*
Derek Jones0c1e4052010-03-02 14:31:31 -06004 *---------------------------------------------------------------
joelcoxcee80752011-01-15 23:09:47 +01005 * APPLICATION ENVIRONMENT
6 *---------------------------------------------------------------
7 *
8 * You can load different configurations depending on your
joelcoxbf2b9122011-01-16 15:24:43 +01009 * current environment. Setting the environment also influences
Phil Sturgeond88b3152011-02-02 21:19:25 +000010 * things like logging and error reporting.
11 *
12 * This can be set to anything, but default usage is:
13 *
Derek Jones4b9c6292011-07-01 17:40:48 -050014 * development
15 * testing
16 * production
Phil Sturgeond88b3152011-02-02 21:19:25 +000017 *
18 * NOTE: If you change these, also change the error_reporting() code below
joelcoxcee80752011-01-15 23:09:47 +010019 *
20 */
21 define('ENVIRONMENT', 'development');
Phil Sturgeond88b3152011-02-02 21:19:25 +000022/*
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
Phil Sturgeon05fa6112011-04-06 22:57:43 +010031if (defined('ENVIRONMENT'))
32{
Phil Sturgeond88b3152011-02-02 21:19:25 +000033 switch (ENVIRONMENT)
34 {
35 case 'development':
Dan Horrigan0e95b8b2011-08-21 09:34:02 -040036 error_reporting(-1);
Phil Sturgeond88b3152011-02-02 21:19:25 +000037 break;
Derek Jones4b9c6292011-07-01 17:40:48 -050038
Phil Sturgeond88b3152011-02-02 21:19:25 +000039 case 'testing':
40 case 'production':
41 error_reporting(0);
42 break;
43
44 default:
45 exit('The application environment is not set correctly.');
46 }
Phil Sturgeon05fa6112011-04-06 22:57:43 +010047}
joelcoxcee80752011-01-15 23:09:47 +010048
49/*
50 *---------------------------------------------------------------
Derek Jones0c1e4052010-03-02 14:31:31 -060051 * SYSTEM FOLDER NAME
52 *---------------------------------------------------------------
53 *
54 * This variable must contain the name of your "system" folder.
Derek Jones4b9c6292011-07-01 17:40:48 -050055 * Include the path if the folder is not in the same directory
Derek Jones0c1e4052010-03-02 14:31:31 -060056 * as this file.
57 *
58 */
Phil Sturgeond88b3152011-02-02 21:19:25 +000059 $system_path = 'system';
Derek Allard2067d1a2008-11-13 22:59:24 +000060
61/*
Derek Jones0c1e4052010-03-02 14:31:31 -060062 *---------------------------------------------------------------
63 * APPLICATION FOLDER NAME
64 *---------------------------------------------------------------
65 *
66 * If you want this front controller to use a different "application"
Barry Mienydd671972010-10-04 16:33:58 +020067 * folder then the default one you can set its name here. The folder
Derek Jones4b9c6292011-07-01 17:40:48 -050068 * can also be renamed or relocated anywhere on your server. If
Derek Jones0c1e4052010-03-02 14:31:31 -060069 * 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 */
Phil Sturgeond88b3152011-02-02 21:19:25 +000075 $application_folder = 'application';
Joe Cianflone8eef9c72011-08-21 10:39:06 -040076
77/*
78 *---------------------------------------------------------------
79 * VIEW FOLDER NAME
80 *---------------------------------------------------------------
81 *
82 * If you want to move the view folder out of the application
83 * folder set the path to the folder here. The folder can be renamed
84 * and relocated anywhere on your server. If blank, it will default
85 * to the standard location inside your application folder. If you
86 * do move this, use the full server path to this folder
87 *
88 * NO TRAILING SLASH!
89 *
90 */
91 $view_folder = '';
92
Derek Allard2067d1a2008-11-13 22:59:24 +000093
94/*
Derek Jones0c1e4052010-03-02 14:31:31 -060095 * --------------------------------------------------------------------
96 * DEFAULT CONTROLLER
97 * --------------------------------------------------------------------
98 *
99 * Normally you will set your default controller in the routes.php file.
Barry Mienydd671972010-10-04 16:33:58 +0200100 * You can, however, force a custom routing by hard-coding a
Derek Jones4b9c6292011-07-01 17:40:48 -0500101 * specific controller class/function here. For most applications, you
Barry Mienydd671972010-10-04 16:33:58 +0200102 * WILL NOT set your routing here, but it's an option for those
Derek Jones0c1e4052010-03-02 14:31:31 -0600103 * special instances where you might want to override the standard
104 * routing in a specific front controller that shares a common CI installation.
105 *
Derek Jones4b9c6292011-07-01 17:40:48 -0500106 * IMPORTANT: If you set the routing here, NO OTHER controller will be
Derek Jones0c1e4052010-03-02 14:31:31 -0600107 * callable. In essence, this preference limits your application to ONE
Derek Jones4b9c6292011-07-01 17:40:48 -0500108 * specific controller. Leave the function name blank if you need
Derek Jones0c1e4052010-03-02 14:31:31 -0600109 * to call functions dynamically via the URI.
110 *
111 * Un-comment the $routing array below to use this feature
112 *
113 */
Derek Jones4b9c6292011-07-01 17:40:48 -0500114 // The directory name, relative to the "controllers" folder. Leave blank
Barry Mienydd671972010-10-04 16:33:58 +0200115 // if your controller is not in a sub-folder within the "controllers" folder
Derek Jones0c1e4052010-03-02 14:31:31 -0600116 // $routing['directory'] = '';
Barry Mienydd671972010-10-04 16:33:58 +0200117
Derek Jones4b9c6292011-07-01 17:40:48 -0500118 // The controller class file name. Example: Mycontroller
Derek Jones0c1e4052010-03-02 14:31:31 -0600119 // $routing['controller'] = '';
Barry Mienydd671972010-10-04 16:33:58 +0200120
121 // The controller function you wish to be called.
Derek Jones0c1e4052010-03-02 14:31:31 -0600122 // $routing['function'] = '';
Derek Allard2067d1a2008-11-13 22:59:24 +0000123
124
125/*
Derek Jones0c1e4052010-03-02 14:31:31 -0600126 * -------------------------------------------------------------------
Derek Jones4b9c6292011-07-01 17:40:48 -0500127 * CUSTOM CONFIG VALUES
Derek Jones0c1e4052010-03-02 14:31:31 -0600128 * -------------------------------------------------------------------
129 *
130 * The $assign_to_config array below will be passed dynamically to the
Barry Mienydd671972010-10-04 16:33:58 +0200131 * config class when initialized. This allows you to set custom config
132 * items or override any default config values found in the config.php file.
Derek Jones0c1e4052010-03-02 14:31:31 -0600133 * This can be handy as it permits you to share one application between
Barry Mienydd671972010-10-04 16:33:58 +0200134 * multiple front controller files, with each file containing different
Derek Jones0c1e4052010-03-02 14:31:31 -0600135 * config values.
136 *
137 * Un-comment the $assign_to_config array below to use this feature
138 *
139 */
140 // $assign_to_config['name_of_config_item'] = 'value of config item';
141
142
143
144// --------------------------------------------------------------------
Derek Jones4b9c6292011-07-01 17:40:48 -0500145// END OF USER CONFIGURABLE SETTINGS. DO NOT EDIT BELOW THIS LINE
Derek Jones0c1e4052010-03-02 14:31:31 -0600146// --------------------------------------------------------------------
147
joelcoxbf2b9122011-01-16 15:24:43 +0100148/*
149 * ---------------------------------------------------------------
Derek Jones4b9c6292011-07-01 17:40:48 -0500150 * Resolve the system path for increased reliability
Derek Jones0c1e4052010-03-02 14:31:31 -0600151 * ---------------------------------------------------------------
152 */
Phil Sturgeon01d1a5b2011-02-07 10:54:06 +0000153
154 // Set the current directory correctly for CLI requests
155 if (defined('STDIN'))
156 {
157 chdir(dirname(__FILE__));
158 }
159
Greg Aker0846d742010-04-08 11:47:33 -0500160 if (realpath($system_path) !== FALSE)
Derek Allard2067d1a2008-11-13 22:59:24 +0000161 {
Derek Jones0c1e4052010-03-02 14:31:31 -0600162 $system_path = realpath($system_path).'/';
Derek Allard2067d1a2008-11-13 22:59:24 +0000163 }
Barry Mienydd671972010-10-04 16:33:58 +0200164
Derek Jones0c1e4052010-03-02 14:31:31 -0600165 // ensure there's a trailing slash
166 $system_path = rtrim($system_path, '/').'/';
Derek Allard2067d1a2008-11-13 22:59:24 +0000167
Derek Joneseba35082010-03-22 10:43:56 -0500168 // Is the system path correct?
Derek Jones0c1e4052010-03-02 14:31:31 -0600169 if ( ! is_dir($system_path))
Derek Allard2067d1a2008-11-13 22:59:24 +0000170 {
Barry Mienydd671972010-10-04 16:33:58 +0200171 exit("Your system folder path does not appear to be set correctly. Please open the following file and correct this: ".pathinfo(__FILE__, PATHINFO_BASENAME));
Derek Allard2067d1a2008-11-13 22:59:24 +0000172 }
173
Derek Jones0c1e4052010-03-02 14:31:31 -0600174/*
175 * -------------------------------------------------------------------
Derek Jones4b9c6292011-07-01 17:40:48 -0500176 * Now that we know the path, set the main path constants
Derek Jones0c1e4052010-03-02 14:31:31 -0600177 * -------------------------------------------------------------------
Barry Mienydd671972010-10-04 16:33:58 +0200178 */
Derek Jones0c1e4052010-03-02 14:31:31 -0600179 // The name of THIS file
180 define('SELF', pathinfo(__FILE__, PATHINFO_BASENAME));
181
182 // The PHP file extension
Greg Aker3a746652011-04-19 10:59:47 -0500183 // this global constant is deprecated.
Derek Jones0c1e4052010-03-02 14:31:31 -0600184 define('EXT', '.php');
185
Barry Mienydd671972010-10-04 16:33:58 +0200186 // Path to the system folder
Derek Jones0c1e4052010-03-02 14:31:31 -0600187 define('BASEPATH', str_replace("\\", "/", $system_path));
Barry Mienydd671972010-10-04 16:33:58 +0200188
Derek Jones0c1e4052010-03-02 14:31:31 -0600189 // Path to the front controller (this file)
190 define('FCPATH', str_replace(SELF, '', __FILE__));
Barry Mienydd671972010-10-04 16:33:58 +0200191
Derek Jones0c1e4052010-03-02 14:31:31 -0600192 // Name of the "system folder"
Barry Mienydd671972010-10-04 16:33:58 +0200193 define('SYSDIR', trim(strrchr(trim(BASEPATH, '/'), '/'), '/'));
Derek Jones0c1e4052010-03-02 14:31:31 -0600194
195
196 // The path to the "application" folder
197 if (is_dir($application_folder))
198 {
199 define('APPPATH', $application_folder.'/');
200 }
201 else
Barry Mienydd671972010-10-04 16:33:58 +0200202 {
Derek Jones0c1e4052010-03-02 14:31:31 -0600203 if ( ! is_dir(BASEPATH.$application_folder.'/'))
204 {
Barry Mienydd671972010-10-04 16:33:58 +0200205 exit("Your application folder path does not appear to be set correctly. Please open the following file and correct this: ".SELF);
Derek Jones0c1e4052010-03-02 14:31:31 -0600206 }
Barry Mienydd671972010-10-04 16:33:58 +0200207
Derek Jones0c1e4052010-03-02 14:31:31 -0600208 define('APPPATH', BASEPATH.$application_folder.'/');
209 }
Joe Cianflone8eef9c72011-08-21 10:39:06 -0400210
211 // The path to the "views" folder
212 if (is_dir($view_folder))
213 {
214 define ('VIEWPATH', $view_folder .'/');
215 }
216 else
217 {
218 if ( ! is_dir(APPPATH.'views/'))
219 {
220 exit("Your view folder path does not appear to be set correctly. Please open the following file and correct this: ".SELF);
221 }
222
223 define ('VIEWPATH', APPPATH.'views/' );
224 }
225
Derek Allard2067d1a2008-11-13 22:59:24 +0000226
227/*
Derek Jones0c1e4052010-03-02 14:31:31 -0600228 * --------------------------------------------------------------------
229 * LOAD THE BOOTSTRAP FILE
230 * --------------------------------------------------------------------
231 *
232 * And away we go...
233 *
234 */
Greg Aker3a746652011-04-19 10:59:47 -0500235require_once BASEPATH.'core/CodeIgniter.php';
Derek Jones3b890ba2010-02-17 18:13:15 -0600236
Derek Allard2067d1a2008-11-13 22:59:24 +0000237/* End of file index.php */
Derek Jonesa3ffbbb2008-05-11 18:18:29 +0000238/* Location: ./index.php */