blob: 7741d5cb822dc5f3835aab28d514168b38f3dd19 [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
10 * things like logging and error reporting. The enviroment
11 * variable can be set to "development" (default),
12 * "test" or "production".
joelcoxcee80752011-01-15 23:09:47 +010013 *
14 */
15 define('ENVIRONMENT', 'development');
16
17/*
18 *---------------------------------------------------------------
Derek Jones0c1e4052010-03-02 14:31:31 -060019 * SYSTEM FOLDER NAME
20 *---------------------------------------------------------------
21 *
22 * This variable must contain the name of your "system" folder.
23 * Include the path if the folder is not in the same directory
24 * as this file.
25 *
26 */
27 $system_path = "system";
Derek Allard2067d1a2008-11-13 22:59:24 +000028
29/*
Derek Jones0c1e4052010-03-02 14:31:31 -060030 *---------------------------------------------------------------
31 * APPLICATION FOLDER NAME
32 *---------------------------------------------------------------
33 *
34 * If you want this front controller to use a different "application"
Barry Mienydd671972010-10-04 16:33:58 +020035 * folder then the default one you can set its name here. The folder
Derek Jones0c1e4052010-03-02 14:31:31 -060036 * can also be renamed or relocated anywhere on your server. If
37 * you do, use a full server path. For more info please see the user guide:
38 * http://codeigniter.com/user_guide/general/managing_apps.html
39 *
40 * NO TRAILING SLASH!
41 *
42 */
Derek Allard2067d1a2008-11-13 22:59:24 +000043 $application_folder = "application";
44
45/*
Derek Jones0c1e4052010-03-02 14:31:31 -060046 * --------------------------------------------------------------------
47 * DEFAULT CONTROLLER
48 * --------------------------------------------------------------------
49 *
50 * Normally you will set your default controller in the routes.php file.
Barry Mienydd671972010-10-04 16:33:58 +020051 * You can, however, force a custom routing by hard-coding a
Derek Jones0c1e4052010-03-02 14:31:31 -060052 * specific controller class/function here. For most applications, you
Barry Mienydd671972010-10-04 16:33:58 +020053 * WILL NOT set your routing here, but it's an option for those
Derek Jones0c1e4052010-03-02 14:31:31 -060054 * special instances where you might want to override the standard
55 * routing in a specific front controller that shares a common CI installation.
56 *
57 * IMPORTANT: If you set the routing here, NO OTHER controller will be
58 * callable. In essence, this preference limits your application to ONE
59 * specific controller. Leave the function name blank if you need
60 * to call functions dynamically via the URI.
61 *
62 * Un-comment the $routing array below to use this feature
63 *
64 */
Barry Mienydd671972010-10-04 16:33:58 +020065 // The directory name, relative to the "controllers" folder. Leave blank
66 // if your controller is not in a sub-folder within the "controllers" folder
Derek Jones0c1e4052010-03-02 14:31:31 -060067 // $routing['directory'] = '';
Barry Mienydd671972010-10-04 16:33:58 +020068
Derek Jones0c1e4052010-03-02 14:31:31 -060069 // The controller class file name. Example: Mycontroller.php
70 // $routing['controller'] = '';
Barry Mienydd671972010-10-04 16:33:58 +020071
72 // The controller function you wish to be called.
Derek Jones0c1e4052010-03-02 14:31:31 -060073 // $routing['function'] = '';
Derek Allard2067d1a2008-11-13 22:59:24 +000074
75
76/*
Derek Jones0c1e4052010-03-02 14:31:31 -060077 * -------------------------------------------------------------------
78 * CUSTOM CONFIG VALUES
79 * -------------------------------------------------------------------
80 *
81 * The $assign_to_config array below will be passed dynamically to the
Barry Mienydd671972010-10-04 16:33:58 +020082 * config class when initialized. This allows you to set custom config
83 * items or override any default config values found in the config.php file.
Derek Jones0c1e4052010-03-02 14:31:31 -060084 * This can be handy as it permits you to share one application between
Barry Mienydd671972010-10-04 16:33:58 +020085 * multiple front controller files, with each file containing different
Derek Jones0c1e4052010-03-02 14:31:31 -060086 * config values.
87 *
88 * Un-comment the $assign_to_config array below to use this feature
89 *
90 */
91 // $assign_to_config['name_of_config_item'] = 'value of config item';
92
93
94
95// --------------------------------------------------------------------
96// END OF USER CONFIGURABLE SETTINGS. DO NOT EDIT BELOW THIS LINE
97// --------------------------------------------------------------------
98
joelcoxbf2b9122011-01-16 15:24:43 +010099/*
100 * ---------------------------------------------------------------
101 * Check if environment is set, and set error reporting appropriately
102 * ---------------------------------------------------------------
103 */
Derek Jones0c1e4052010-03-02 14:31:31 -0600104
joelcoxbf2b9122011-01-16 15:24:43 +0100105 if (ENVIRONMENT == 'development')
106 {
107 error_reporting(E_ALL);
108 }
109 elseif (ENVIRONMENT == 'production' OR ENVIRONMENT == 'test')
110 {
111 error_reporting(0);
112 }
113 else
114 {
joelcox1bfd9fa2011-01-16 18:49:39 +0100115 error_reporting(E_ALL);
joelcoxbf2b9122011-01-16 15:24:43 +0100116 exit("The application environment is not set correctly.");
117 }
118
Derek Jones0c1e4052010-03-02 14:31:31 -0600119/*
120 * ---------------------------------------------------------------
121 * Resolve the system path for increased reliability
122 * ---------------------------------------------------------------
123 */
Greg Aker0846d742010-04-08 11:47:33 -0500124 if (realpath($system_path) !== FALSE)
Derek Allard2067d1a2008-11-13 22:59:24 +0000125 {
Derek Jones0c1e4052010-03-02 14:31:31 -0600126 $system_path = realpath($system_path).'/';
Derek Allard2067d1a2008-11-13 22:59:24 +0000127 }
Barry Mienydd671972010-10-04 16:33:58 +0200128
Derek Jones0c1e4052010-03-02 14:31:31 -0600129 // ensure there's a trailing slash
130 $system_path = rtrim($system_path, '/').'/';
Derek Allard2067d1a2008-11-13 22:59:24 +0000131
Derek Joneseba35082010-03-22 10:43:56 -0500132 // Is the system path correct?
Derek Jones0c1e4052010-03-02 14:31:31 -0600133 if ( ! is_dir($system_path))
Derek Allard2067d1a2008-11-13 22:59:24 +0000134 {
Barry Mienydd671972010-10-04 16:33:58 +0200135 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 +0000136 }
137
Derek Jones0c1e4052010-03-02 14:31:31 -0600138/*
139 * -------------------------------------------------------------------
140 * Now that we know the path, set the main path constants
141 * -------------------------------------------------------------------
Barry Mienydd671972010-10-04 16:33:58 +0200142 */
Derek Jones0c1e4052010-03-02 14:31:31 -0600143 // The name of THIS file
144 define('SELF', pathinfo(__FILE__, PATHINFO_BASENAME));
145
146 // The PHP file extension
147 define('EXT', '.php');
148
Barry Mienydd671972010-10-04 16:33:58 +0200149 // Path to the system folder
Derek Jones0c1e4052010-03-02 14:31:31 -0600150 define('BASEPATH', str_replace("\\", "/", $system_path));
Barry Mienydd671972010-10-04 16:33:58 +0200151
Derek Jones0c1e4052010-03-02 14:31:31 -0600152 // Path to the front controller (this file)
153 define('FCPATH', str_replace(SELF, '', __FILE__));
Barry Mienydd671972010-10-04 16:33:58 +0200154
Derek Jones0c1e4052010-03-02 14:31:31 -0600155 // Name of the "system folder"
Barry Mienydd671972010-10-04 16:33:58 +0200156 define('SYSDIR', trim(strrchr(trim(BASEPATH, '/'), '/'), '/'));
Derek Jones0c1e4052010-03-02 14:31:31 -0600157
158
159 // The path to the "application" folder
160 if (is_dir($application_folder))
161 {
162 define('APPPATH', $application_folder.'/');
163 }
164 else
Barry Mienydd671972010-10-04 16:33:58 +0200165 {
Derek Jones0c1e4052010-03-02 14:31:31 -0600166 if ( ! is_dir(BASEPATH.$application_folder.'/'))
167 {
Barry Mienydd671972010-10-04 16:33:58 +0200168 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 -0600169 }
Barry Mienydd671972010-10-04 16:33:58 +0200170
Derek Jones0c1e4052010-03-02 14:31:31 -0600171 define('APPPATH', BASEPATH.$application_folder.'/');
172 }
Derek Allard2067d1a2008-11-13 22:59:24 +0000173
174/*
Derek Jones0c1e4052010-03-02 14:31:31 -0600175 * --------------------------------------------------------------------
176 * LOAD THE BOOTSTRAP FILE
177 * --------------------------------------------------------------------
178 *
179 * And away we go...
180 *
181 */
182require_once BASEPATH.'core/CodeIgniter'.EXT;
Derek Jones3b890ba2010-02-17 18:13:15 -0600183
Derek Allard2067d1a2008-11-13 22:59:24 +0000184/* End of file index.php */
Derek Jonesa3ffbbb2008-05-11 18:18:29 +0000185/* Location: ./index.php */