blob: 918c802591ff5992a60c307421cfe5840cb9384d [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
31 switch (ENVIRONMENT)
32 {
33 case 'development':
34 error_reporting(E_ALL);
35 break;
36
37 case 'testing':
38 case 'production':
39 error_reporting(0);
40 break;
41
42 default:
43 exit('The application environment is not set correctly.');
44 }
joelcoxcee80752011-01-15 23:09:47 +010045
46/*
47 *---------------------------------------------------------------
Derek Jones0c1e4052010-03-02 14:31:31 -060048 * SYSTEM FOLDER NAME
49 *---------------------------------------------------------------
50 *
51 * This variable must contain the name of your "system" folder.
52 * Include the path if the folder is not in the same directory
53 * as this file.
54 *
55 */
Phil Sturgeond88b3152011-02-02 21:19:25 +000056 $system_path = 'system';
Derek Allard2067d1a2008-11-13 22:59:24 +000057
58/*
Derek Jones0c1e4052010-03-02 14:31:31 -060059 *---------------------------------------------------------------
60 * APPLICATION FOLDER NAME
61 *---------------------------------------------------------------
62 *
63 * If you want this front controller to use a different "application"
Barry Mienydd671972010-10-04 16:33:58 +020064 * folder then the default one you can set its name here. The folder
Derek Jones0c1e4052010-03-02 14:31:31 -060065 * can also be renamed or relocated anywhere on your server. If
66 * you do, use a full server path. For more info please see the user guide:
67 * http://codeigniter.com/user_guide/general/managing_apps.html
68 *
69 * NO TRAILING SLASH!
70 *
71 */
Phil Sturgeond88b3152011-02-02 21:19:25 +000072 $application_folder = 'application';
Derek Allard2067d1a2008-11-13 22:59:24 +000073
74/*
Derek Jones0c1e4052010-03-02 14:31:31 -060075 * --------------------------------------------------------------------
76 * DEFAULT CONTROLLER
77 * --------------------------------------------------------------------
78 *
79 * Normally you will set your default controller in the routes.php file.
Barry Mienydd671972010-10-04 16:33:58 +020080 * You can, however, force a custom routing by hard-coding a
Derek Jones0c1e4052010-03-02 14:31:31 -060081 * specific controller class/function here. For most applications, you
Barry Mienydd671972010-10-04 16:33:58 +020082 * WILL NOT set your routing here, but it's an option for those
Derek Jones0c1e4052010-03-02 14:31:31 -060083 * special instances where you might want to override the standard
84 * routing in a specific front controller that shares a common CI installation.
85 *
86 * IMPORTANT: If you set the routing here, NO OTHER controller will be
87 * callable. In essence, this preference limits your application to ONE
88 * specific controller. Leave the function name blank if you need
89 * to call functions dynamically via the URI.
90 *
91 * Un-comment the $routing array below to use this feature
92 *
93 */
Barry Mienydd671972010-10-04 16:33:58 +020094 // The directory name, relative to the "controllers" folder. Leave blank
95 // if your controller is not in a sub-folder within the "controllers" folder
Derek Jones0c1e4052010-03-02 14:31:31 -060096 // $routing['directory'] = '';
Barry Mienydd671972010-10-04 16:33:58 +020097
Derek Jones0c1e4052010-03-02 14:31:31 -060098 // The controller class file name. Example: Mycontroller.php
99 // $routing['controller'] = '';
Barry Mienydd671972010-10-04 16:33:58 +0200100
101 // The controller function you wish to be called.
Derek Jones0c1e4052010-03-02 14:31:31 -0600102 // $routing['function'] = '';
Derek Allard2067d1a2008-11-13 22:59:24 +0000103
104
105/*
Derek Jones0c1e4052010-03-02 14:31:31 -0600106 * -------------------------------------------------------------------
107 * CUSTOM CONFIG VALUES
108 * -------------------------------------------------------------------
109 *
110 * The $assign_to_config array below will be passed dynamically to the
Barry Mienydd671972010-10-04 16:33:58 +0200111 * config class when initialized. This allows you to set custom config
112 * items or override any default config values found in the config.php file.
Derek Jones0c1e4052010-03-02 14:31:31 -0600113 * This can be handy as it permits you to share one application between
Barry Mienydd671972010-10-04 16:33:58 +0200114 * multiple front controller files, with each file containing different
Derek Jones0c1e4052010-03-02 14:31:31 -0600115 * config values.
116 *
117 * Un-comment the $assign_to_config array below to use this feature
118 *
119 */
120 // $assign_to_config['name_of_config_item'] = 'value of config item';
121
122
123
124// --------------------------------------------------------------------
125// END OF USER CONFIGURABLE SETTINGS. DO NOT EDIT BELOW THIS LINE
126// --------------------------------------------------------------------
127
joelcoxbf2b9122011-01-16 15:24:43 +0100128/*
129 * ---------------------------------------------------------------
Derek Jones0c1e4052010-03-02 14:31:31 -0600130 * Resolve the system path for increased reliability
131 * ---------------------------------------------------------------
132 */
Greg Aker0846d742010-04-08 11:47:33 -0500133 if (realpath($system_path) !== FALSE)
Derek Allard2067d1a2008-11-13 22:59:24 +0000134 {
Derek Jones0c1e4052010-03-02 14:31:31 -0600135 $system_path = realpath($system_path).'/';
Derek Allard2067d1a2008-11-13 22:59:24 +0000136 }
Barry Mienydd671972010-10-04 16:33:58 +0200137
Derek Jones0c1e4052010-03-02 14:31:31 -0600138 // ensure there's a trailing slash
139 $system_path = rtrim($system_path, '/').'/';
Derek Allard2067d1a2008-11-13 22:59:24 +0000140
Derek Joneseba35082010-03-22 10:43:56 -0500141 // Is the system path correct?
Derek Jones0c1e4052010-03-02 14:31:31 -0600142 if ( ! is_dir($system_path))
Derek Allard2067d1a2008-11-13 22:59:24 +0000143 {
Barry Mienydd671972010-10-04 16:33:58 +0200144 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 +0000145 }
146
Derek Jones0c1e4052010-03-02 14:31:31 -0600147/*
148 * -------------------------------------------------------------------
149 * Now that we know the path, set the main path constants
150 * -------------------------------------------------------------------
Barry Mienydd671972010-10-04 16:33:58 +0200151 */
Derek Jones0c1e4052010-03-02 14:31:31 -0600152 // The name of THIS file
153 define('SELF', pathinfo(__FILE__, PATHINFO_BASENAME));
154
155 // The PHP file extension
156 define('EXT', '.php');
157
Barry Mienydd671972010-10-04 16:33:58 +0200158 // Path to the system folder
Derek Jones0c1e4052010-03-02 14:31:31 -0600159 define('BASEPATH', str_replace("\\", "/", $system_path));
Barry Mienydd671972010-10-04 16:33:58 +0200160
Derek Jones0c1e4052010-03-02 14:31:31 -0600161 // Path to the front controller (this file)
162 define('FCPATH', str_replace(SELF, '', __FILE__));
Barry Mienydd671972010-10-04 16:33:58 +0200163
Derek Jones0c1e4052010-03-02 14:31:31 -0600164 // Name of the "system folder"
Barry Mienydd671972010-10-04 16:33:58 +0200165 define('SYSDIR', trim(strrchr(trim(BASEPATH, '/'), '/'), '/'));
Derek Jones0c1e4052010-03-02 14:31:31 -0600166
167
168 // The path to the "application" folder
169 if (is_dir($application_folder))
170 {
171 define('APPPATH', $application_folder.'/');
172 }
173 else
Barry Mienydd671972010-10-04 16:33:58 +0200174 {
Derek Jones0c1e4052010-03-02 14:31:31 -0600175 if ( ! is_dir(BASEPATH.$application_folder.'/'))
176 {
Barry Mienydd671972010-10-04 16:33:58 +0200177 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 -0600178 }
Barry Mienydd671972010-10-04 16:33:58 +0200179
Derek Jones0c1e4052010-03-02 14:31:31 -0600180 define('APPPATH', BASEPATH.$application_folder.'/');
181 }
Derek Allard2067d1a2008-11-13 22:59:24 +0000182
183/*
Derek Jones0c1e4052010-03-02 14:31:31 -0600184 * --------------------------------------------------------------------
185 * LOAD THE BOOTSTRAP FILE
186 * --------------------------------------------------------------------
187 *
188 * And away we go...
189 *
190 */
191require_once BASEPATH.'core/CodeIgniter'.EXT;
Derek Jones3b890ba2010-02-17 18:13:15 -0600192
Derek Allard2067d1a2008-11-13 22:59:24 +0000193/* End of file index.php */
Derek Jonesa3ffbbb2008-05-11 18:18:29 +0000194/* Location: ./index.php */