blob: 312fbfb1d96cf26199383820eb7cc773a61e4a43 [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);
Timothy Warren233b6712011-10-13 11:56:44 -030037 define('SHOW_ERROR_BACKTRACE', TRUE);
Phil Sturgeond88b3152011-02-02 21:19:25 +000038 break;
Derek Jones4b9c6292011-07-01 17:40:48 -050039
Phil Sturgeond88b3152011-02-02 21:19:25 +000040 case 'testing':
41 case 'production':
42 error_reporting(0);
43 break;
44
45 default:
46 exit('The application environment is not set correctly.');
47 }
Phil Sturgeon05fa6112011-04-06 22:57:43 +010048}
joelcoxcee80752011-01-15 23:09:47 +010049
50/*
51 *---------------------------------------------------------------
Derek Jones0c1e4052010-03-02 14:31:31 -060052 * SYSTEM FOLDER NAME
53 *---------------------------------------------------------------
54 *
55 * This variable must contain the name of your "system" folder.
Derek Jones4b9c6292011-07-01 17:40:48 -050056 * Include the path if the folder is not in the same directory
Derek Jones0c1e4052010-03-02 14:31:31 -060057 * as this file.
58 *
59 */
Phil Sturgeond88b3152011-02-02 21:19:25 +000060 $system_path = 'system';
Derek Allard2067d1a2008-11-13 22:59:24 +000061
62/*
Derek Jones0c1e4052010-03-02 14:31:31 -060063 *---------------------------------------------------------------
64 * APPLICATION FOLDER NAME
65 *---------------------------------------------------------------
66 *
67 * If you want this front controller to use a different "application"
Barry Mienydd671972010-10-04 16:33:58 +020068 * folder then the default one you can set its name here. The folder
Derek Jones4b9c6292011-07-01 17:40:48 -050069 * can also be renamed or relocated anywhere on your server. If
Derek Jones0c1e4052010-03-02 14:31:31 -060070 * 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 */
Phil Sturgeond88b3152011-02-02 21:19:25 +000076 $application_folder = 'application';
Joe Cianflone8eef9c72011-08-21 10:39:06 -040077
78/*
79 *---------------------------------------------------------------
80 * VIEW FOLDER NAME
81 *---------------------------------------------------------------
82 *
83 * If you want to move the view folder out of the application
84 * folder set the path to the folder here. The folder can be renamed
85 * and relocated anywhere on your server. If blank, it will default
86 * to the standard location inside your application folder. If you
87 * do move this, use the full server path to this folder
88 *
89 * NO TRAILING SLASH!
90 *
91 */
92 $view_folder = '';
93
Derek Allard2067d1a2008-11-13 22:59:24 +000094
95/*
Derek Jones0c1e4052010-03-02 14:31:31 -060096 * --------------------------------------------------------------------
97 * DEFAULT CONTROLLER
98 * --------------------------------------------------------------------
99 *
100 * Normally you will set your default controller in the routes.php file.
Barry Mienydd671972010-10-04 16:33:58 +0200101 * You can, however, force a custom routing by hard-coding a
Derek Jones4b9c6292011-07-01 17:40:48 -0500102 * specific controller class/function here. For most applications, you
Barry Mienydd671972010-10-04 16:33:58 +0200103 * WILL NOT set your routing here, but it's an option for those
Derek Jones0c1e4052010-03-02 14:31:31 -0600104 * special instances where you might want to override the standard
105 * routing in a specific front controller that shares a common CI installation.
106 *
Derek Jones4b9c6292011-07-01 17:40:48 -0500107 * IMPORTANT: If you set the routing here, NO OTHER controller will be
Derek Jones0c1e4052010-03-02 14:31:31 -0600108 * callable. In essence, this preference limits your application to ONE
Derek Jones4b9c6292011-07-01 17:40:48 -0500109 * specific controller. Leave the function name blank if you need
Derek Jones0c1e4052010-03-02 14:31:31 -0600110 * to call functions dynamically via the URI.
111 *
112 * Un-comment the $routing array below to use this feature
113 *
114 */
Derek Jones4b9c6292011-07-01 17:40:48 -0500115 // The directory name, relative to the "controllers" folder. Leave blank
Barry Mienydd671972010-10-04 16:33:58 +0200116 // if your controller is not in a sub-folder within the "controllers" folder
Derek Jones0c1e4052010-03-02 14:31:31 -0600117 // $routing['directory'] = '';
Barry Mienydd671972010-10-04 16:33:58 +0200118
Derek Jones4b9c6292011-07-01 17:40:48 -0500119 // The controller class file name. Example: Mycontroller
Derek Jones0c1e4052010-03-02 14:31:31 -0600120 // $routing['controller'] = '';
Barry Mienydd671972010-10-04 16:33:58 +0200121
122 // The controller function you wish to be called.
Derek Jones0c1e4052010-03-02 14:31:31 -0600123 // $routing['function'] = '';
Derek Allard2067d1a2008-11-13 22:59:24 +0000124
125
126/*
Derek Jones0c1e4052010-03-02 14:31:31 -0600127 * -------------------------------------------------------------------
Derek Jones4b9c6292011-07-01 17:40:48 -0500128 * CUSTOM CONFIG VALUES
Derek Jones0c1e4052010-03-02 14:31:31 -0600129 * -------------------------------------------------------------------
130 *
131 * The $assign_to_config array below will be passed dynamically to the
Barry Mienydd671972010-10-04 16:33:58 +0200132 * config class when initialized. This allows you to set custom config
133 * items or override any default config values found in the config.php file.
Derek Jones0c1e4052010-03-02 14:31:31 -0600134 * This can be handy as it permits you to share one application between
Barry Mienydd671972010-10-04 16:33:58 +0200135 * multiple front controller files, with each file containing different
Derek Jones0c1e4052010-03-02 14:31:31 -0600136 * config values.
137 *
138 * Un-comment the $assign_to_config array below to use this feature
139 *
140 */
141 // $assign_to_config['name_of_config_item'] = 'value of config item';
142
143
144
145// --------------------------------------------------------------------
Derek Jones4b9c6292011-07-01 17:40:48 -0500146// END OF USER CONFIGURABLE SETTINGS. DO NOT EDIT BELOW THIS LINE
Derek Jones0c1e4052010-03-02 14:31:31 -0600147// --------------------------------------------------------------------
148
joelcoxbf2b9122011-01-16 15:24:43 +0100149/*
150 * ---------------------------------------------------------------
Derek Jones4b9c6292011-07-01 17:40:48 -0500151 * Resolve the system path for increased reliability
Derek Jones0c1e4052010-03-02 14:31:31 -0600152 * ---------------------------------------------------------------
153 */
Phil Sturgeon01d1a5b2011-02-07 10:54:06 +0000154
155 // Set the current directory correctly for CLI requests
156 if (defined('STDIN'))
157 {
158 chdir(dirname(__FILE__));
159 }
160
Greg Aker0846d742010-04-08 11:47:33 -0500161 if (realpath($system_path) !== FALSE)
Derek Allard2067d1a2008-11-13 22:59:24 +0000162 {
Derek Jones0c1e4052010-03-02 14:31:31 -0600163 $system_path = realpath($system_path).'/';
Derek Allard2067d1a2008-11-13 22:59:24 +0000164 }
Barry Mienydd671972010-10-04 16:33:58 +0200165
Derek Jones0c1e4052010-03-02 14:31:31 -0600166 // ensure there's a trailing slash
167 $system_path = rtrim($system_path, '/').'/';
Derek Allard2067d1a2008-11-13 22:59:24 +0000168
Derek Joneseba35082010-03-22 10:43:56 -0500169 // Is the system path correct?
Derek Jones0c1e4052010-03-02 14:31:31 -0600170 if ( ! is_dir($system_path))
Derek Allard2067d1a2008-11-13 22:59:24 +0000171 {
Barry Mienydd671972010-10-04 16:33:58 +0200172 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 +0000173 }
174
Derek Jones0c1e4052010-03-02 14:31:31 -0600175/*
176 * -------------------------------------------------------------------
Derek Jones4b9c6292011-07-01 17:40:48 -0500177 * Now that we know the path, set the main path constants
Derek Jones0c1e4052010-03-02 14:31:31 -0600178 * -------------------------------------------------------------------
Barry Mienydd671972010-10-04 16:33:58 +0200179 */
Derek Jones0c1e4052010-03-02 14:31:31 -0600180 // The name of THIS file
181 define('SELF', pathinfo(__FILE__, PATHINFO_BASENAME));
182
183 // The PHP file extension
Greg Aker3a746652011-04-19 10:59:47 -0500184 // this global constant is deprecated.
Derek Jones0c1e4052010-03-02 14:31:31 -0600185 define('EXT', '.php');
186
Barry Mienydd671972010-10-04 16:33:58 +0200187 // Path to the system folder
Derek Jones0c1e4052010-03-02 14:31:31 -0600188 define('BASEPATH', str_replace("\\", "/", $system_path));
Barry Mienydd671972010-10-04 16:33:58 +0200189
Derek Jones0c1e4052010-03-02 14:31:31 -0600190 // Path to the front controller (this file)
191 define('FCPATH', str_replace(SELF, '', __FILE__));
Barry Mienydd671972010-10-04 16:33:58 +0200192
Derek Jones0c1e4052010-03-02 14:31:31 -0600193 // Name of the "system folder"
Barry Mienydd671972010-10-04 16:33:58 +0200194 define('SYSDIR', trim(strrchr(trim(BASEPATH, '/'), '/'), '/'));
Derek Jones0c1e4052010-03-02 14:31:31 -0600195
196
197 // The path to the "application" folder
198 if (is_dir($application_folder))
199 {
200 define('APPPATH', $application_folder.'/');
201 }
202 else
Barry Mienydd671972010-10-04 16:33:58 +0200203 {
Derek Jones0c1e4052010-03-02 14:31:31 -0600204 if ( ! is_dir(BASEPATH.$application_folder.'/'))
205 {
Barry Mienydd671972010-10-04 16:33:58 +0200206 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 -0600207 }
Barry Mienydd671972010-10-04 16:33:58 +0200208
Derek Jones0c1e4052010-03-02 14:31:31 -0600209 define('APPPATH', BASEPATH.$application_folder.'/');
210 }
Joe Cianflone8eef9c72011-08-21 10:39:06 -0400211
212 // The path to the "views" folder
213 if (is_dir($view_folder))
214 {
215 define ('VIEWPATH', $view_folder .'/');
216 }
217 else
218 {
219 if ( ! is_dir(APPPATH.'views/'))
220 {
221 exit("Your view folder path does not appear to be set correctly. Please open the following file and correct this: ".SELF);
222 }
223
224 define ('VIEWPATH', APPPATH.'views/' );
225 }
226
Derek Allard2067d1a2008-11-13 22:59:24 +0000227
228/*
Derek Jones0c1e4052010-03-02 14:31:31 -0600229 * --------------------------------------------------------------------
230 * LOAD THE BOOTSTRAP FILE
231 * --------------------------------------------------------------------
232 *
233 * And away we go...
234 *
235 */
Greg Aker3a746652011-04-19 10:59:47 -0500236require_once BASEPATH.'core/CodeIgniter.php';
Derek Jones3b890ba2010-02-17 18:13:15 -0600237
Derek Allard2067d1a2008-11-13 22:59:24 +0000238/* End of file index.php */
Derek Jonesa3ffbbb2008-05-11 18:18:29 +0000239/* Location: ./index.php */