Derek Allard | 2067d1a | 2008-11-13 22:59:24 +0000 | [diff] [blame] | 1 | <?php |
Derek Jones | 0c1e405 | 2010-03-02 14:31:31 -0600 | [diff] [blame] | 2 | |
Derek Allard | 2067d1a | 2008-11-13 22:59:24 +0000 | [diff] [blame] | 3 | /* |
Derek Jones | 0c1e405 | 2010-03-02 14:31:31 -0600 | [diff] [blame] | 4 | *--------------------------------------------------------------- |
joelcox | cee8075 | 2011-01-15 23:09:47 +0100 | [diff] [blame^] | 5 | * APPLICATION ENVIRONMENT |
| 6 | *--------------------------------------------------------------- |
| 7 | * |
| 8 | * You can load different configurations depending on your |
| 9 | * current environment. The enviroment variable can be set |
| 10 | * to "development" (default), "test" or "production" |
| 11 | * |
| 12 | */ |
| 13 | define('ENVIRONMENT', 'development'); |
| 14 | |
| 15 | /* |
| 16 | *--------------------------------------------------------------- |
Derek Jones | 0c1e405 | 2010-03-02 14:31:31 -0600 | [diff] [blame] | 17 | * PHP ERROR REPORTING LEVEL |
| 18 | *--------------------------------------------------------------- |
| 19 | * |
| 20 | * By default CI runs with error reporting set to ALL. For security |
Derek Jones | 79bd036 | 2010-10-06 10:06:37 -0500 | [diff] [blame] | 21 | * reasons you are encouraged to change this to 0 when your site goes live. |
Derek Jones | 0c1e405 | 2010-03-02 14:31:31 -0600 | [diff] [blame] | 22 | * For more info visit: http://www.php.net/error_reporting |
| 23 | * |
| 24 | */ |
Derek Allard | 2067d1a | 2008-11-13 22:59:24 +0000 | [diff] [blame] | 25 | error_reporting(E_ALL); |
| 26 | |
| 27 | /* |
Derek Jones | 0c1e405 | 2010-03-02 14:31:31 -0600 | [diff] [blame] | 28 | *--------------------------------------------------------------- |
| 29 | * SYSTEM FOLDER NAME |
| 30 | *--------------------------------------------------------------- |
| 31 | * |
| 32 | * This variable must contain the name of your "system" folder. |
| 33 | * Include the path if the folder is not in the same directory |
| 34 | * as this file. |
| 35 | * |
| 36 | */ |
| 37 | $system_path = "system"; |
Derek Allard | 2067d1a | 2008-11-13 22:59:24 +0000 | [diff] [blame] | 38 | |
| 39 | /* |
Derek Jones | 0c1e405 | 2010-03-02 14:31:31 -0600 | [diff] [blame] | 40 | *--------------------------------------------------------------- |
| 41 | * APPLICATION FOLDER NAME |
| 42 | *--------------------------------------------------------------- |
| 43 | * |
| 44 | * If you want this front controller to use a different "application" |
Barry Mieny | dd67197 | 2010-10-04 16:33:58 +0200 | [diff] [blame] | 45 | * folder then the default one you can set its name here. The folder |
Derek Jones | 0c1e405 | 2010-03-02 14:31:31 -0600 | [diff] [blame] | 46 | * can also be renamed or relocated anywhere on your server. If |
| 47 | * you do, use a full server path. For more info please see the user guide: |
| 48 | * http://codeigniter.com/user_guide/general/managing_apps.html |
| 49 | * |
| 50 | * NO TRAILING SLASH! |
| 51 | * |
| 52 | */ |
Derek Allard | 2067d1a | 2008-11-13 22:59:24 +0000 | [diff] [blame] | 53 | $application_folder = "application"; |
| 54 | |
| 55 | /* |
Derek Jones | 0c1e405 | 2010-03-02 14:31:31 -0600 | [diff] [blame] | 56 | * -------------------------------------------------------------------- |
| 57 | * DEFAULT CONTROLLER |
| 58 | * -------------------------------------------------------------------- |
| 59 | * |
| 60 | * Normally you will set your default controller in the routes.php file. |
Barry Mieny | dd67197 | 2010-10-04 16:33:58 +0200 | [diff] [blame] | 61 | * You can, however, force a custom routing by hard-coding a |
Derek Jones | 0c1e405 | 2010-03-02 14:31:31 -0600 | [diff] [blame] | 62 | * specific controller class/function here. For most applications, you |
Barry Mieny | dd67197 | 2010-10-04 16:33:58 +0200 | [diff] [blame] | 63 | * WILL NOT set your routing here, but it's an option for those |
Derek Jones | 0c1e405 | 2010-03-02 14:31:31 -0600 | [diff] [blame] | 64 | * special instances where you might want to override the standard |
| 65 | * routing in a specific front controller that shares a common CI installation. |
| 66 | * |
| 67 | * IMPORTANT: If you set the routing here, NO OTHER controller will be |
| 68 | * callable. In essence, this preference limits your application to ONE |
| 69 | * specific controller. Leave the function name blank if you need |
| 70 | * to call functions dynamically via the URI. |
| 71 | * |
| 72 | * Un-comment the $routing array below to use this feature |
| 73 | * |
| 74 | */ |
Barry Mieny | dd67197 | 2010-10-04 16:33:58 +0200 | [diff] [blame] | 75 | // The directory name, relative to the "controllers" folder. Leave blank |
| 76 | // if your controller is not in a sub-folder within the "controllers" folder |
Derek Jones | 0c1e405 | 2010-03-02 14:31:31 -0600 | [diff] [blame] | 77 | // $routing['directory'] = ''; |
Barry Mieny | dd67197 | 2010-10-04 16:33:58 +0200 | [diff] [blame] | 78 | |
Derek Jones | 0c1e405 | 2010-03-02 14:31:31 -0600 | [diff] [blame] | 79 | // The controller class file name. Example: Mycontroller.php |
| 80 | // $routing['controller'] = ''; |
Barry Mieny | dd67197 | 2010-10-04 16:33:58 +0200 | [diff] [blame] | 81 | |
| 82 | // The controller function you wish to be called. |
Derek Jones | 0c1e405 | 2010-03-02 14:31:31 -0600 | [diff] [blame] | 83 | // $routing['function'] = ''; |
Derek Allard | 2067d1a | 2008-11-13 22:59:24 +0000 | [diff] [blame] | 84 | |
| 85 | |
| 86 | /* |
Derek Jones | 0c1e405 | 2010-03-02 14:31:31 -0600 | [diff] [blame] | 87 | * ------------------------------------------------------------------- |
| 88 | * CUSTOM CONFIG VALUES |
| 89 | * ------------------------------------------------------------------- |
| 90 | * |
| 91 | * The $assign_to_config array below will be passed dynamically to the |
Barry Mieny | dd67197 | 2010-10-04 16:33:58 +0200 | [diff] [blame] | 92 | * config class when initialized. This allows you to set custom config |
| 93 | * items or override any default config values found in the config.php file. |
Derek Jones | 0c1e405 | 2010-03-02 14:31:31 -0600 | [diff] [blame] | 94 | * This can be handy as it permits you to share one application between |
Barry Mieny | dd67197 | 2010-10-04 16:33:58 +0200 | [diff] [blame] | 95 | * multiple front controller files, with each file containing different |
Derek Jones | 0c1e405 | 2010-03-02 14:31:31 -0600 | [diff] [blame] | 96 | * config values. |
| 97 | * |
| 98 | * Un-comment the $assign_to_config array below to use this feature |
| 99 | * |
| 100 | */ |
| 101 | // $assign_to_config['name_of_config_item'] = 'value of config item'; |
| 102 | |
| 103 | |
| 104 | |
| 105 | // -------------------------------------------------------------------- |
| 106 | // END OF USER CONFIGURABLE SETTINGS. DO NOT EDIT BELOW THIS LINE |
| 107 | // -------------------------------------------------------------------- |
| 108 | |
| 109 | |
| 110 | |
| 111 | |
| 112 | /* |
| 113 | * --------------------------------------------------------------- |
| 114 | * Resolve the system path for increased reliability |
| 115 | * --------------------------------------------------------------- |
| 116 | */ |
Greg Aker | 0846d74 | 2010-04-08 11:47:33 -0500 | [diff] [blame] | 117 | if (realpath($system_path) !== FALSE) |
Derek Allard | 2067d1a | 2008-11-13 22:59:24 +0000 | [diff] [blame] | 118 | { |
Derek Jones | 0c1e405 | 2010-03-02 14:31:31 -0600 | [diff] [blame] | 119 | $system_path = realpath($system_path).'/'; |
Derek Allard | 2067d1a | 2008-11-13 22:59:24 +0000 | [diff] [blame] | 120 | } |
Barry Mieny | dd67197 | 2010-10-04 16:33:58 +0200 | [diff] [blame] | 121 | |
Derek Jones | 0c1e405 | 2010-03-02 14:31:31 -0600 | [diff] [blame] | 122 | // ensure there's a trailing slash |
| 123 | $system_path = rtrim($system_path, '/').'/'; |
Derek Allard | 2067d1a | 2008-11-13 22:59:24 +0000 | [diff] [blame] | 124 | |
Derek Jones | eba3508 | 2010-03-22 10:43:56 -0500 | [diff] [blame] | 125 | // Is the system path correct? |
Derek Jones | 0c1e405 | 2010-03-02 14:31:31 -0600 | [diff] [blame] | 126 | if ( ! is_dir($system_path)) |
Derek Allard | 2067d1a | 2008-11-13 22:59:24 +0000 | [diff] [blame] | 127 | { |
Barry Mieny | dd67197 | 2010-10-04 16:33:58 +0200 | [diff] [blame] | 128 | 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 Allard | 2067d1a | 2008-11-13 22:59:24 +0000 | [diff] [blame] | 129 | } |
| 130 | |
Derek Jones | 0c1e405 | 2010-03-02 14:31:31 -0600 | [diff] [blame] | 131 | /* |
| 132 | * ------------------------------------------------------------------- |
| 133 | * Now that we know the path, set the main path constants |
| 134 | * ------------------------------------------------------------------- |
Barry Mieny | dd67197 | 2010-10-04 16:33:58 +0200 | [diff] [blame] | 135 | */ |
Derek Jones | 0c1e405 | 2010-03-02 14:31:31 -0600 | [diff] [blame] | 136 | // The name of THIS file |
| 137 | define('SELF', pathinfo(__FILE__, PATHINFO_BASENAME)); |
| 138 | |
| 139 | // The PHP file extension |
| 140 | define('EXT', '.php'); |
| 141 | |
Barry Mieny | dd67197 | 2010-10-04 16:33:58 +0200 | [diff] [blame] | 142 | // Path to the system folder |
Derek Jones | 0c1e405 | 2010-03-02 14:31:31 -0600 | [diff] [blame] | 143 | define('BASEPATH', str_replace("\\", "/", $system_path)); |
Barry Mieny | dd67197 | 2010-10-04 16:33:58 +0200 | [diff] [blame] | 144 | |
Derek Jones | 0c1e405 | 2010-03-02 14:31:31 -0600 | [diff] [blame] | 145 | // Path to the front controller (this file) |
| 146 | define('FCPATH', str_replace(SELF, '', __FILE__)); |
Barry Mieny | dd67197 | 2010-10-04 16:33:58 +0200 | [diff] [blame] | 147 | |
Derek Jones | 0c1e405 | 2010-03-02 14:31:31 -0600 | [diff] [blame] | 148 | // Name of the "system folder" |
Barry Mieny | dd67197 | 2010-10-04 16:33:58 +0200 | [diff] [blame] | 149 | define('SYSDIR', trim(strrchr(trim(BASEPATH, '/'), '/'), '/')); |
Derek Jones | 0c1e405 | 2010-03-02 14:31:31 -0600 | [diff] [blame] | 150 | |
| 151 | |
| 152 | // The path to the "application" folder |
| 153 | if (is_dir($application_folder)) |
| 154 | { |
| 155 | define('APPPATH', $application_folder.'/'); |
| 156 | } |
| 157 | else |
Barry Mieny | dd67197 | 2010-10-04 16:33:58 +0200 | [diff] [blame] | 158 | { |
Derek Jones | 0c1e405 | 2010-03-02 14:31:31 -0600 | [diff] [blame] | 159 | if ( ! is_dir(BASEPATH.$application_folder.'/')) |
| 160 | { |
Barry Mieny | dd67197 | 2010-10-04 16:33:58 +0200 | [diff] [blame] | 161 | exit("Your application folder path does not appear to be set correctly. Please open the following file and correct this: ".SELF); |
Derek Jones | 0c1e405 | 2010-03-02 14:31:31 -0600 | [diff] [blame] | 162 | } |
Barry Mieny | dd67197 | 2010-10-04 16:33:58 +0200 | [diff] [blame] | 163 | |
Derek Jones | 0c1e405 | 2010-03-02 14:31:31 -0600 | [diff] [blame] | 164 | define('APPPATH', BASEPATH.$application_folder.'/'); |
| 165 | } |
Derek Allard | 2067d1a | 2008-11-13 22:59:24 +0000 | [diff] [blame] | 166 | |
| 167 | /* |
Derek Jones | 0c1e405 | 2010-03-02 14:31:31 -0600 | [diff] [blame] | 168 | * -------------------------------------------------------------------- |
| 169 | * LOAD THE BOOTSTRAP FILE |
| 170 | * -------------------------------------------------------------------- |
| 171 | * |
| 172 | * And away we go... |
| 173 | * |
| 174 | */ |
| 175 | require_once BASEPATH.'core/CodeIgniter'.EXT; |
Derek Jones | 3b890ba | 2010-02-17 18:13:15 -0600 | [diff] [blame] | 176 | |
Derek Allard | 2067d1a | 2008-11-13 22:59:24 +0000 | [diff] [blame] | 177 | /* End of file index.php */ |
Derek Jones | a3ffbbb | 2008-05-11 18:18:29 +0000 | [diff] [blame] | 178 | /* Location: ./index.php */ |