blob: a8d58b2d9e96de6913dacd8b49ad30f97da7655e [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 *
14 * development
15 * testing
16 * production
17 *
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':
36 error_reporting(E_ALL);
37 break;
38
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 }
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.
55 * Include the path if the folder is not in the same directory
56 * 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 Jones0c1e4052010-03-02 14:31:31 -060068 * can also be renamed or relocated anywhere on your server. If
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 */
Phil Sturgeond88b3152011-02-02 21:19:25 +000075 $application_folder = 'application';
Derek Allard2067d1a2008-11-13 22:59:24 +000076
77/*
Derek Jones0c1e4052010-03-02 14:31:31 -060078 * --------------------------------------------------------------------
79 * DEFAULT CONTROLLER
80 * --------------------------------------------------------------------
81 *
82 * Normally you will set your default controller in the routes.php file.
Barry Mienydd671972010-10-04 16:33:58 +020083 * You can, however, force a custom routing by hard-coding a
Derek Jones0c1e4052010-03-02 14:31:31 -060084 * specific controller class/function here. For most applications, you
Barry Mienydd671972010-10-04 16:33:58 +020085 * WILL NOT set your routing here, but it's an option for those
Derek Jones0c1e4052010-03-02 14:31:31 -060086 * special instances where you might want to override the standard
87 * routing in a specific front controller that shares a common CI installation.
88 *
89 * IMPORTANT: If you set the routing here, NO OTHER controller will be
90 * callable. In essence, this preference limits your application to ONE
91 * specific controller. Leave the function name blank if you need
92 * to call functions dynamically via the URI.
93 *
94 * Un-comment the $routing array below to use this feature
95 *
96 */
Barry Mienydd671972010-10-04 16:33:58 +020097 // The directory name, relative to the "controllers" folder. Leave blank
98 // if your controller is not in a sub-folder within the "controllers" folder
Derek Jones0c1e4052010-03-02 14:31:31 -060099 // $routing['directory'] = '';
Barry Mienydd671972010-10-04 16:33:58 +0200100
Derek Jones0c1e4052010-03-02 14:31:31 -0600101 // The controller class file name. Example: Mycontroller.php
102 // $routing['controller'] = '';
Barry Mienydd671972010-10-04 16:33:58 +0200103
104 // The controller function you wish to be called.
Derek Jones0c1e4052010-03-02 14:31:31 -0600105 // $routing['function'] = '';
Derek Allard2067d1a2008-11-13 22:59:24 +0000106
107
108/*
Derek Jones0c1e4052010-03-02 14:31:31 -0600109 * -------------------------------------------------------------------
110 * CUSTOM CONFIG VALUES
111 * -------------------------------------------------------------------
112 *
113 * The $assign_to_config array below will be passed dynamically to the
Barry Mienydd671972010-10-04 16:33:58 +0200114 * 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.
Derek Jones0c1e4052010-03-02 14:31:31 -0600116 * This can be handy as it permits you to share one application between
Barry Mienydd671972010-10-04 16:33:58 +0200117 * multiple front controller files, with each file containing different
Derek Jones0c1e4052010-03-02 14:31:31 -0600118 * 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// --------------------------------------------------------------------
128// END OF USER CONFIGURABLE SETTINGS. DO NOT EDIT BELOW THIS LINE
129// --------------------------------------------------------------------
130
joelcoxbf2b9122011-01-16 15:24:43 +0100131/*
132 * ---------------------------------------------------------------
Derek Jones0c1e4052010-03-02 14:31:31 -0600133 * Resolve the system path for increased reliability
134 * ---------------------------------------------------------------
135 */
Phil Sturgeon01d1a5b2011-02-07 10:54:06 +0000136
137 // Set the current directory correctly for CLI requests
138 if (defined('STDIN'))
139 {
140 chdir(dirname(__FILE__));
141 }
142
Greg Aker0846d742010-04-08 11:47:33 -0500143 if (realpath($system_path) !== FALSE)
Derek Allard2067d1a2008-11-13 22:59:24 +0000144 {
Derek Jones0c1e4052010-03-02 14:31:31 -0600145 $system_path = realpath($system_path).'/';
Derek Allard2067d1a2008-11-13 22:59:24 +0000146 }
Barry Mienydd671972010-10-04 16:33:58 +0200147
Derek Jones0c1e4052010-03-02 14:31:31 -0600148 // ensure there's a trailing slash
149 $system_path = rtrim($system_path, '/').'/';
Derek Allard2067d1a2008-11-13 22:59:24 +0000150
Derek Joneseba35082010-03-22 10:43:56 -0500151 // Is the system path correct?
Derek Jones0c1e4052010-03-02 14:31:31 -0600152 if ( ! is_dir($system_path))
Derek Allard2067d1a2008-11-13 22:59:24 +0000153 {
Barry Mienydd671972010-10-04 16:33:58 +0200154 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 +0000155 }
156
Derek Jones0c1e4052010-03-02 14:31:31 -0600157/*
158 * -------------------------------------------------------------------
159 * Now that we know the path, set the main path constants
160 * -------------------------------------------------------------------
Barry Mienydd671972010-10-04 16:33:58 +0200161 */
Derek Jones0c1e4052010-03-02 14:31:31 -0600162 // The name of THIS file
163 define('SELF', pathinfo(__FILE__, PATHINFO_BASENAME));
164
165 // The PHP file extension
Greg Aker3a746652011-04-19 10:59:47 -0500166 // this global constant is deprecated.
Derek Jones0c1e4052010-03-02 14:31:31 -0600167 define('EXT', '.php');
168
Barry Mienydd671972010-10-04 16:33:58 +0200169 // Path to the system folder
Derek Jones0c1e4052010-03-02 14:31:31 -0600170 define('BASEPATH', str_replace("\\", "/", $system_path));
Barry Mienydd671972010-10-04 16:33:58 +0200171
Derek Jones0c1e4052010-03-02 14:31:31 -0600172 // Path to the front controller (this file)
173 define('FCPATH', str_replace(SELF, '', __FILE__));
Barry Mienydd671972010-10-04 16:33:58 +0200174
Derek Jones0c1e4052010-03-02 14:31:31 -0600175 // Name of the "system folder"
Barry Mienydd671972010-10-04 16:33:58 +0200176 define('SYSDIR', trim(strrchr(trim(BASEPATH, '/'), '/'), '/'));
Derek Jones0c1e4052010-03-02 14:31:31 -0600177
178
179 // The path to the "application" folder
180 if (is_dir($application_folder))
181 {
182 define('APPPATH', $application_folder.'/');
183 }
184 else
Barry Mienydd671972010-10-04 16:33:58 +0200185 {
Derek Jones0c1e4052010-03-02 14:31:31 -0600186 if ( ! is_dir(BASEPATH.$application_folder.'/'))
187 {
Barry Mienydd671972010-10-04 16:33:58 +0200188 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 -0600189 }
Barry Mienydd671972010-10-04 16:33:58 +0200190
Derek Jones0c1e4052010-03-02 14:31:31 -0600191 define('APPPATH', BASEPATH.$application_folder.'/');
192 }
Derek Allard2067d1a2008-11-13 22:59:24 +0000193
194/*
Derek Jones0c1e4052010-03-02 14:31:31 -0600195 * --------------------------------------------------------------------
196 * LOAD THE BOOTSTRAP FILE
197 * --------------------------------------------------------------------
198 *
199 * And away we go...
200 *
201 */
Greg Aker3a746652011-04-19 10:59:47 -0500202require_once BASEPATH.'core/CodeIgniter.php';
Derek Jones3b890ba2010-02-17 18:13:15 -0600203
Derek Allard2067d1a2008-11-13 22:59:24 +0000204/* End of file index.php */
Derek Jonesa3ffbbb2008-05-11 18:18:29 +0000205/* Location: ./index.php */