blob: 016ffc015d5f00506e4b110ef54f359b2573dd29 [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 {
115 exit("The application environment is not set correctly.");
116 }
117
Derek Jones0c1e4052010-03-02 14:31:31 -0600118/*
119 * ---------------------------------------------------------------
120 * Resolve the system path for increased reliability
121 * ---------------------------------------------------------------
122 */
Greg Aker0846d742010-04-08 11:47:33 -0500123 if (realpath($system_path) !== FALSE)
Derek Allard2067d1a2008-11-13 22:59:24 +0000124 {
Derek Jones0c1e4052010-03-02 14:31:31 -0600125 $system_path = realpath($system_path).'/';
Derek Allard2067d1a2008-11-13 22:59:24 +0000126 }
Barry Mienydd671972010-10-04 16:33:58 +0200127
Derek Jones0c1e4052010-03-02 14:31:31 -0600128 // ensure there's a trailing slash
129 $system_path = rtrim($system_path, '/').'/';
Derek Allard2067d1a2008-11-13 22:59:24 +0000130
Derek Joneseba35082010-03-22 10:43:56 -0500131 // Is the system path correct?
Derek Jones0c1e4052010-03-02 14:31:31 -0600132 if ( ! is_dir($system_path))
Derek Allard2067d1a2008-11-13 22:59:24 +0000133 {
Barry Mienydd671972010-10-04 16:33:58 +0200134 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 +0000135 }
136
Derek Jones0c1e4052010-03-02 14:31:31 -0600137/*
138 * -------------------------------------------------------------------
139 * Now that we know the path, set the main path constants
140 * -------------------------------------------------------------------
Barry Mienydd671972010-10-04 16:33:58 +0200141 */
Derek Jones0c1e4052010-03-02 14:31:31 -0600142 // The name of THIS file
143 define('SELF', pathinfo(__FILE__, PATHINFO_BASENAME));
144
145 // The PHP file extension
146 define('EXT', '.php');
147
Barry Mienydd671972010-10-04 16:33:58 +0200148 // Path to the system folder
Derek Jones0c1e4052010-03-02 14:31:31 -0600149 define('BASEPATH', str_replace("\\", "/", $system_path));
Barry Mienydd671972010-10-04 16:33:58 +0200150
Derek Jones0c1e4052010-03-02 14:31:31 -0600151 // Path to the front controller (this file)
152 define('FCPATH', str_replace(SELF, '', __FILE__));
Barry Mienydd671972010-10-04 16:33:58 +0200153
Derek Jones0c1e4052010-03-02 14:31:31 -0600154 // Name of the "system folder"
Barry Mienydd671972010-10-04 16:33:58 +0200155 define('SYSDIR', trim(strrchr(trim(BASEPATH, '/'), '/'), '/'));
Derek Jones0c1e4052010-03-02 14:31:31 -0600156
157
158 // The path to the "application" folder
159 if (is_dir($application_folder))
160 {
161 define('APPPATH', $application_folder.'/');
162 }
163 else
Barry Mienydd671972010-10-04 16:33:58 +0200164 {
Derek Jones0c1e4052010-03-02 14:31:31 -0600165 if ( ! is_dir(BASEPATH.$application_folder.'/'))
166 {
Barry Mienydd671972010-10-04 16:33:58 +0200167 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 -0600168 }
Barry Mienydd671972010-10-04 16:33:58 +0200169
Derek Jones0c1e4052010-03-02 14:31:31 -0600170 define('APPPATH', BASEPATH.$application_folder.'/');
171 }
Derek Allard2067d1a2008-11-13 22:59:24 +0000172
173/*
Derek Jones0c1e4052010-03-02 14:31:31 -0600174 * --------------------------------------------------------------------
175 * LOAD THE BOOTSTRAP FILE
176 * --------------------------------------------------------------------
177 *
178 * And away we go...
179 *
180 */
181require_once BASEPATH.'core/CodeIgniter'.EXT;
Derek Jones3b890ba2010-02-17 18:13:15 -0600182
Derek Allard2067d1a2008-11-13 22:59:24 +0000183/* End of file index.php */
Derek Jonesa3ffbbb2008-05-11 18:18:29 +0000184/* Location: ./index.php */