Derek Allard | 2067d1a | 2008-11-13 22:59:24 +0000 | [diff] [blame] | 1 | <?php |
Derek Jones | f4a4bd8 | 2011-10-20 12:18:42 -0500 | [diff] [blame] | 2 | /** |
| 3 | * CodeIgniter |
| 4 | * |
Phil Sturgeon | 07c1ac8 | 2012-03-09 17:03:37 +0000 | [diff] [blame] | 5 | * An open source application development framework for PHP 5.2.4 or newer |
Derek Jones | f4a4bd8 | 2011-10-20 12:18:42 -0500 | [diff] [blame] | 6 | * |
| 7 | * NOTICE OF LICENSE |
Andrey Andreev | 282592c | 2012-01-08 01:01:55 +0200 | [diff] [blame] | 8 | * |
Derek Jones | f4a4bd8 | 2011-10-20 12:18:42 -0500 | [diff] [blame] | 9 | * Licensed under the Open Software License version 3.0 |
Andrey Andreev | 282592c | 2012-01-08 01:01:55 +0200 | [diff] [blame] | 10 | * |
Derek Jones | f4a4bd8 | 2011-10-20 12:18:42 -0500 | [diff] [blame] | 11 | * This source file is subject to the Open Software License (OSL 3.0) that is |
| 12 | * bundled with this package in the files license.txt / license.rst. It is |
| 13 | * also available through the world wide web at this URL: |
| 14 | * http://opensource.org/licenses/OSL-3.0 |
| 15 | * If you did not receive a copy of the license and are unable to obtain it |
| 16 | * through the world wide web, please send an email to |
| 17 | * licensing@ellislab.com so we can send you a copy immediately. |
| 18 | * |
| 19 | * @package CodeIgniter |
| 20 | * @author EllisLab Dev Team |
darwinel | 871754a | 2014-02-11 17:34:57 +0100 | [diff] [blame] | 21 | * @copyright Copyright (c) 2008 - 2014, EllisLab, Inc. (http://ellislab.com/) |
Derek Jones | f4a4bd8 | 2011-10-20 12:18:42 -0500 | [diff] [blame] | 22 | * @license http://opensource.org/licenses/OSL-3.0 Open Software License (OSL 3.0) |
| 23 | * @link http://codeigniter.com |
| 24 | * @since Version 1.0 |
| 25 | * @filesource |
| 26 | */ |
Derek Jones | 0c1e405 | 2010-03-02 14:31:31 -0600 | [diff] [blame] | 27 | |
Derek Allard | 2067d1a | 2008-11-13 22:59:24 +0000 | [diff] [blame] | 28 | /* |
Derek Jones | 0c1e405 | 2010-03-02 14:31:31 -0600 | [diff] [blame] | 29 | *--------------------------------------------------------------- |
joelcox | cee8075 | 2011-01-15 23:09:47 +0100 | [diff] [blame] | 30 | * APPLICATION ENVIRONMENT |
| 31 | *--------------------------------------------------------------- |
| 32 | * |
| 33 | * You can load different configurations depending on your |
joelcox | bf2b912 | 2011-01-16 15:24:43 +0100 | [diff] [blame] | 34 | * current environment. Setting the environment also influences |
Phil Sturgeon | d88b315 | 2011-02-02 21:19:25 +0000 | [diff] [blame] | 35 | * things like logging and error reporting. |
| 36 | * |
| 37 | * This can be set to anything, but default usage is: |
| 38 | * |
Derek Jones | 4b9c629 | 2011-07-01 17:40:48 -0500 | [diff] [blame] | 39 | * development |
| 40 | * testing |
| 41 | * production |
Phil Sturgeon | d88b315 | 2011-02-02 21:19:25 +0000 | [diff] [blame] | 42 | * |
| 43 | * NOTE: If you change these, also change the error_reporting() code below |
joelcox | cee8075 | 2011-01-15 23:09:47 +0100 | [diff] [blame] | 44 | */ |
Phil Sturgeon | dda21f6 | 2012-06-03 10:36:36 -0500 | [diff] [blame] | 45 | define('ENVIRONMENT', isset($_SERVER['CI_ENV']) ? $_SERVER['CI_ENV'] : 'development'); |
vlakoff | fe83249 | 2012-07-13 20:40:06 +0200 | [diff] [blame] | 46 | |
Phil Sturgeon | d88b315 | 2011-02-02 21:19:25 +0000 | [diff] [blame] | 47 | /* |
| 48 | *--------------------------------------------------------------- |
| 49 | * ERROR REPORTING |
| 50 | *--------------------------------------------------------------- |
| 51 | * |
| 52 | * Different environments will require different levels of error reporting. |
| 53 | * By default development will show errors but testing and live will hide them. |
| 54 | */ |
Root | 35ac46d | 2012-05-25 18:51:48 -0400 | [diff] [blame] | 55 | switch (ENVIRONMENT) |
Phil Sturgeon | 05fa611 | 2011-04-06 22:57:43 +0100 | [diff] [blame] | 56 | { |
Root | 35ac46d | 2012-05-25 18:51:48 -0400 | [diff] [blame] | 57 | case 'development': |
Gints Murans | 8d021e6 | 2012-05-30 21:15:08 +0300 | [diff] [blame] | 58 | error_reporting(-1); |
Root | 35ac46d | 2012-05-25 18:51:48 -0400 | [diff] [blame] | 59 | ini_set('display_errors', 1); |
| 60 | break; |
| 61 | |
| 62 | case 'testing': |
| 63 | case 'production': |
vlakoff | 1ff2c55 | 2013-07-21 00:27:08 +0200 | [diff] [blame] | 64 | error_reporting(E_ALL & ~E_NOTICE & ~E_DEPRECATED & ~E_STRICT); |
Root | 35ac46d | 2012-05-25 18:51:48 -0400 | [diff] [blame] | 65 | ini_set('display_errors', 0); |
| 66 | break; |
| 67 | |
| 68 | default: |
Andrey Andreev | cbb654d | 2012-07-10 11:36:32 +0300 | [diff] [blame] | 69 | header('HTTP/1.1 503 Service Unavailable.', TRUE, 503); |
Daniel Hunsaker | 3b5b7f4 | 2013-02-22 19:17:56 -0700 | [diff] [blame] | 70 | echo 'The application environment is not set correctly.'; |
Andrey Andreev | 7cf682a | 2014-03-13 14:55:45 +0200 | [diff] [blame^] | 71 | exit(1); // EXIT_ERROR |
Phil Sturgeon | 05fa611 | 2011-04-06 22:57:43 +0100 | [diff] [blame] | 72 | } |
joelcox | cee8075 | 2011-01-15 23:09:47 +0100 | [diff] [blame] | 73 | |
| 74 | /* |
| 75 | *--------------------------------------------------------------- |
Derek Jones | 0c1e405 | 2010-03-02 14:31:31 -0600 | [diff] [blame] | 76 | * SYSTEM FOLDER NAME |
| 77 | *--------------------------------------------------------------- |
| 78 | * |
| 79 | * This variable must contain the name of your "system" folder. |
vlakoff | c941d85 | 2013-08-06 14:44:40 +0200 | [diff] [blame] | 80 | * Include the path if the folder is not in the same directory |
Derek Jones | 0c1e405 | 2010-03-02 14:31:31 -0600 | [diff] [blame] | 81 | * as this file. |
Derek Jones | 0c1e405 | 2010-03-02 14:31:31 -0600 | [diff] [blame] | 82 | */ |
Phil Sturgeon | d88b315 | 2011-02-02 21:19:25 +0000 | [diff] [blame] | 83 | $system_path = 'system'; |
Derek Allard | 2067d1a | 2008-11-13 22:59:24 +0000 | [diff] [blame] | 84 | |
| 85 | /* |
Derek Jones | 0c1e405 | 2010-03-02 14:31:31 -0600 | [diff] [blame] | 86 | *--------------------------------------------------------------- |
| 87 | * APPLICATION FOLDER NAME |
| 88 | *--------------------------------------------------------------- |
| 89 | * |
| 90 | * If you want this front controller to use a different "application" |
Adam Carmichael | e90b830 | 2013-01-04 01:04:29 +1100 | [diff] [blame] | 91 | * folder than the default one you can set its name here. The folder |
Andrey Andreev | 282592c | 2012-01-08 01:01:55 +0200 | [diff] [blame] | 92 | * can also be renamed or relocated anywhere on your server. If |
Derek Jones | 0c1e405 | 2010-03-02 14:31:31 -0600 | [diff] [blame] | 93 | * you do, use a full server path. For more info please see the user guide: |
| 94 | * http://codeigniter.com/user_guide/general/managing_apps.html |
| 95 | * |
| 96 | * NO TRAILING SLASH! |
Derek Jones | 0c1e405 | 2010-03-02 14:31:31 -0600 | [diff] [blame] | 97 | */ |
Phil Sturgeon | d88b315 | 2011-02-02 21:19:25 +0000 | [diff] [blame] | 98 | $application_folder = 'application'; |
Andrey Andreev | 282592c | 2012-01-08 01:01:55 +0200 | [diff] [blame] | 99 | |
Joe Cianflone | 8eef9c7 | 2011-08-21 10:39:06 -0400 | [diff] [blame] | 100 | /* |
| 101 | *--------------------------------------------------------------- |
| 102 | * VIEW FOLDER NAME |
| 103 | *--------------------------------------------------------------- |
Andrey Andreev | 282592c | 2012-01-08 01:01:55 +0200 | [diff] [blame] | 104 | * |
| 105 | * If you want to move the view folder out of the application |
Joe Cianflone | 8eef9c7 | 2011-08-21 10:39:06 -0400 | [diff] [blame] | 106 | * folder set the path to the folder here. The folder can be renamed |
Andrey Andreev | 282592c | 2012-01-08 01:01:55 +0200 | [diff] [blame] | 107 | * and relocated anywhere on your server. If blank, it will default |
| 108 | * to the standard location inside your application folder. If you |
| 109 | * do move this, use the full server path to this folder. |
Joe Cianflone | 8eef9c7 | 2011-08-21 10:39:06 -0400 | [diff] [blame] | 110 | * |
| 111 | * NO TRAILING SLASH! |
Joe Cianflone | 8eef9c7 | 2011-08-21 10:39:06 -0400 | [diff] [blame] | 112 | */ |
Andrey Andreev | 282592c | 2012-01-08 01:01:55 +0200 | [diff] [blame] | 113 | $view_folder = ''; |
Joe Cianflone | 8eef9c7 | 2011-08-21 10:39:06 -0400 | [diff] [blame] | 114 | |
Derek Allard | 2067d1a | 2008-11-13 22:59:24 +0000 | [diff] [blame] | 115 | |
| 116 | /* |
Derek Jones | 0c1e405 | 2010-03-02 14:31:31 -0600 | [diff] [blame] | 117 | * -------------------------------------------------------------------- |
| 118 | * DEFAULT CONTROLLER |
| 119 | * -------------------------------------------------------------------- |
| 120 | * |
| 121 | * Normally you will set your default controller in the routes.php file. |
Barry Mieny | dd67197 | 2010-10-04 16:33:58 +0200 | [diff] [blame] | 122 | * You can, however, force a custom routing by hard-coding a |
Andrey Andreev | 282592c | 2012-01-08 01:01:55 +0200 | [diff] [blame] | 123 | * specific controller class/function here. For most applications, you |
Barry Mieny | dd67197 | 2010-10-04 16:33:58 +0200 | [diff] [blame] | 124 | * 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] | 125 | * special instances where you might want to override the standard |
| 126 | * routing in a specific front controller that shares a common CI installation. |
| 127 | * |
Andrey Andreev | 282592c | 2012-01-08 01:01:55 +0200 | [diff] [blame] | 128 | * IMPORTANT: If you set the routing here, NO OTHER controller will be |
Derek Jones | 0c1e405 | 2010-03-02 14:31:31 -0600 | [diff] [blame] | 129 | * callable. In essence, this preference limits your application to ONE |
Andrey Andreev | 282592c | 2012-01-08 01:01:55 +0200 | [diff] [blame] | 130 | * specific controller. Leave the function name blank if you need |
Derek Jones | 0c1e405 | 2010-03-02 14:31:31 -0600 | [diff] [blame] | 131 | * to call functions dynamically via the URI. |
| 132 | * |
| 133 | * Un-comment the $routing array below to use this feature |
Derek Jones | 0c1e405 | 2010-03-02 14:31:31 -0600 | [diff] [blame] | 134 | */ |
Derek Jones | 4b9c629 | 2011-07-01 17:40:48 -0500 | [diff] [blame] | 135 | // The directory name, relative to the "controllers" folder. Leave blank |
Barry Mieny | dd67197 | 2010-10-04 16:33:58 +0200 | [diff] [blame] | 136 | // 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] | 137 | // $routing['directory'] = ''; |
Barry Mieny | dd67197 | 2010-10-04 16:33:58 +0200 | [diff] [blame] | 138 | |
vlakoff | e40e56f | 2012-07-15 12:57:38 +0200 | [diff] [blame] | 139 | // The controller class file name. Example: mycontroller |
Derek Jones | 0c1e405 | 2010-03-02 14:31:31 -0600 | [diff] [blame] | 140 | // $routing['controller'] = ''; |
Barry Mieny | dd67197 | 2010-10-04 16:33:58 +0200 | [diff] [blame] | 141 | |
| 142 | // The controller function you wish to be called. |
Derek Jones | 0c1e405 | 2010-03-02 14:31:31 -0600 | [diff] [blame] | 143 | // $routing['function'] = ''; |
Derek Allard | 2067d1a | 2008-11-13 22:59:24 +0000 | [diff] [blame] | 144 | |
| 145 | |
| 146 | /* |
Derek Jones | 0c1e405 | 2010-03-02 14:31:31 -0600 | [diff] [blame] | 147 | * ------------------------------------------------------------------- |
Derek Jones | 4b9c629 | 2011-07-01 17:40:48 -0500 | [diff] [blame] | 148 | * CUSTOM CONFIG VALUES |
Derek Jones | 0c1e405 | 2010-03-02 14:31:31 -0600 | [diff] [blame] | 149 | * ------------------------------------------------------------------- |
| 150 | * |
| 151 | * The $assign_to_config array below will be passed dynamically to the |
Barry Mieny | dd67197 | 2010-10-04 16:33:58 +0200 | [diff] [blame] | 152 | * config class when initialized. This allows you to set custom config |
| 153 | * 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] | 154 | * 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] | 155 | * multiple front controller files, with each file containing different |
Derek Jones | 0c1e405 | 2010-03-02 14:31:31 -0600 | [diff] [blame] | 156 | * config values. |
| 157 | * |
| 158 | * Un-comment the $assign_to_config array below to use this feature |
Derek Jones | 0c1e405 | 2010-03-02 14:31:31 -0600 | [diff] [blame] | 159 | */ |
| 160 | // $assign_to_config['name_of_config_item'] = 'value of config item'; |
| 161 | |
| 162 | |
| 163 | |
| 164 | // -------------------------------------------------------------------- |
Derek Jones | 4b9c629 | 2011-07-01 17:40:48 -0500 | [diff] [blame] | 165 | // END OF USER CONFIGURABLE SETTINGS. DO NOT EDIT BELOW THIS LINE |
Derek Jones | 0c1e405 | 2010-03-02 14:31:31 -0600 | [diff] [blame] | 166 | // -------------------------------------------------------------------- |
| 167 | |
joelcox | bf2b912 | 2011-01-16 15:24:43 +0100 | [diff] [blame] | 168 | /* |
| 169 | * --------------------------------------------------------------- |
Derek Jones | 4b9c629 | 2011-07-01 17:40:48 -0500 | [diff] [blame] | 170 | * Resolve the system path for increased reliability |
Derek Jones | 0c1e405 | 2010-03-02 14:31:31 -0600 | [diff] [blame] | 171 | * --------------------------------------------------------------- |
| 172 | */ |
Phil Sturgeon | 01d1a5b | 2011-02-07 10:54:06 +0000 | [diff] [blame] | 173 | |
| 174 | // Set the current directory correctly for CLI requests |
| 175 | if (defined('STDIN')) |
| 176 | { |
| 177 | chdir(dirname(__FILE__)); |
| 178 | } |
| 179 | |
Andrey Andreev | 806ca60 | 2012-06-12 12:51:27 +0300 | [diff] [blame] | 180 | if (($_temp = realpath($system_path)) !== FALSE) |
Derek Allard | 2067d1a | 2008-11-13 22:59:24 +0000 | [diff] [blame] | 181 | { |
Andrey Andreev | 806ca60 | 2012-06-12 12:51:27 +0300 | [diff] [blame] | 182 | $system_path = $_temp.'/'; |
Derek Allard | 2067d1a | 2008-11-13 22:59:24 +0000 | [diff] [blame] | 183 | } |
Andrey Andreev | 079fbfc | 2012-06-12 02:26:58 +0300 | [diff] [blame] | 184 | else |
| 185 | { |
| 186 | // Ensure there's a trailing slash |
| 187 | $system_path = rtrim($system_path, '/').'/'; |
| 188 | } |
Derek Allard | 2067d1a | 2008-11-13 22:59:24 +0000 | [diff] [blame] | 189 | |
Derek Jones | eba3508 | 2010-03-22 10:43:56 -0500 | [diff] [blame] | 190 | // Is the system path correct? |
Derek Jones | 0c1e405 | 2010-03-02 14:31:31 -0600 | [diff] [blame] | 191 | if ( ! is_dir($system_path)) |
Derek Allard | 2067d1a | 2008-11-13 22:59:24 +0000 | [diff] [blame] | 192 | { |
Andrey Andreev | 806ca60 | 2012-06-12 12:51:27 +0300 | [diff] [blame] | 193 | header('HTTP/1.1 503 Service Unavailable.', TRUE, 503); |
Daniel Hunsaker | 3b5b7f4 | 2013-02-22 19:17:56 -0700 | [diff] [blame] | 194 | echo 'Your system folder path does not appear to be set correctly. Please open the following file and correct this: '.pathinfo(__FILE__, PATHINFO_BASENAME); |
Andrey Andreev | 7cf682a | 2014-03-13 14:55:45 +0200 | [diff] [blame^] | 195 | exit(3); // EXIT_CONFIG |
Derek Allard | 2067d1a | 2008-11-13 22:59:24 +0000 | [diff] [blame] | 196 | } |
| 197 | |
Derek Jones | 0c1e405 | 2010-03-02 14:31:31 -0600 | [diff] [blame] | 198 | /* |
| 199 | * ------------------------------------------------------------------- |
Derek Jones | 4b9c629 | 2011-07-01 17:40:48 -0500 | [diff] [blame] | 200 | * Now that we know the path, set the main path constants |
Derek Jones | 0c1e405 | 2010-03-02 14:31:31 -0600 | [diff] [blame] | 201 | * ------------------------------------------------------------------- |
Barry Mieny | dd67197 | 2010-10-04 16:33:58 +0200 | [diff] [blame] | 202 | */ |
Derek Jones | 0c1e405 | 2010-03-02 14:31:31 -0600 | [diff] [blame] | 203 | // The name of THIS file |
| 204 | define('SELF', pathinfo(__FILE__, PATHINFO_BASENAME)); |
| 205 | |
Barry Mieny | dd67197 | 2010-10-04 16:33:58 +0200 | [diff] [blame] | 206 | // Path to the system folder |
Andrey Andreev | 282592c | 2012-01-08 01:01:55 +0200 | [diff] [blame] | 207 | define('BASEPATH', str_replace('\\', '/', $system_path)); |
Barry Mieny | dd67197 | 2010-10-04 16:33:58 +0200 | [diff] [blame] | 208 | |
Derek Jones | 0c1e405 | 2010-03-02 14:31:31 -0600 | [diff] [blame] | 209 | // Path to the front controller (this file) |
| 210 | define('FCPATH', str_replace(SELF, '', __FILE__)); |
Barry Mieny | dd67197 | 2010-10-04 16:33:58 +0200 | [diff] [blame] | 211 | |
Derek Jones | 0c1e405 | 2010-03-02 14:31:31 -0600 | [diff] [blame] | 212 | // Name of the "system folder" |
Barry Mieny | dd67197 | 2010-10-04 16:33:58 +0200 | [diff] [blame] | 213 | define('SYSDIR', trim(strrchr(trim(BASEPATH, '/'), '/'), '/')); |
Derek Jones | 0c1e405 | 2010-03-02 14:31:31 -0600 | [diff] [blame] | 214 | |
Derek Jones | 0c1e405 | 2010-03-02 14:31:31 -0600 | [diff] [blame] | 215 | // The path to the "application" folder |
| 216 | if (is_dir($application_folder)) |
| 217 | { |
Andrey Andreev | cce9180 | 2012-06-12 13:25:31 +0300 | [diff] [blame] | 218 | if (($_temp = realpath($application_folder)) !== FALSE) |
Andrey Andreev | 079fbfc | 2012-06-12 02:26:58 +0300 | [diff] [blame] | 219 | { |
Andrey Andreev | 806ca60 | 2012-06-12 12:51:27 +0300 | [diff] [blame] | 220 | $application_folder = $_temp; |
Andrey Andreev | 079fbfc | 2012-06-12 02:26:58 +0300 | [diff] [blame] | 221 | } |
| 222 | |
Andrey Andreev | 9f417d0 | 2013-10-14 12:24:36 +0300 | [diff] [blame] | 223 | define('APPPATH', $application_folder.DIRECTORY_SEPARATOR); |
Derek Jones | 0c1e405 | 2010-03-02 14:31:31 -0600 | [diff] [blame] | 224 | } |
| 225 | else |
Barry Mieny | dd67197 | 2010-10-04 16:33:58 +0200 | [diff] [blame] | 226 | { |
Andrey Andreev | 9f417d0 | 2013-10-14 12:24:36 +0300 | [diff] [blame] | 227 | if ( ! is_dir(BASEPATH.$application_folder.DIRECTORY_SEPARATOR)) |
Derek Jones | 0c1e405 | 2010-03-02 14:31:31 -0600 | [diff] [blame] | 228 | { |
Andrey Andreev | 806ca60 | 2012-06-12 12:51:27 +0300 | [diff] [blame] | 229 | header('HTTP/1.1 503 Service Unavailable.', TRUE, 503); |
Daniel Hunsaker | 3b5b7f4 | 2013-02-22 19:17:56 -0700 | [diff] [blame] | 230 | echo 'Your application folder path does not appear to be set correctly. Please open the following file and correct this: '.SELF; |
Andrey Andreev | 7cf682a | 2014-03-13 14:55:45 +0200 | [diff] [blame^] | 231 | exit(3); // EXIT_CONFIG |
Derek Jones | 0c1e405 | 2010-03-02 14:31:31 -0600 | [diff] [blame] | 232 | } |
Barry Mieny | dd67197 | 2010-10-04 16:33:58 +0200 | [diff] [blame] | 233 | |
Andrey Andreev | 9f417d0 | 2013-10-14 12:24:36 +0300 | [diff] [blame] | 234 | define('APPPATH', BASEPATH.$application_folder.DIRECTORY_SEPARATOR); |
Derek Jones | 0c1e405 | 2010-03-02 14:31:31 -0600 | [diff] [blame] | 235 | } |
Andrey Andreev | 282592c | 2012-01-08 01:01:55 +0200 | [diff] [blame] | 236 | |
Joe Cianflone | 8eef9c7 | 2011-08-21 10:39:06 -0400 | [diff] [blame] | 237 | // The path to the "views" folder |
Andrey Andreev | 079fbfc | 2012-06-12 02:26:58 +0300 | [diff] [blame] | 238 | if ( ! is_dir($view_folder)) |
Joe Cianflone | 8eef9c7 | 2011-08-21 10:39:06 -0400 | [diff] [blame] | 239 | { |
Andrey Andreev | 9f417d0 | 2013-10-14 12:24:36 +0300 | [diff] [blame] | 240 | if ( ! empty($view_folder) && is_dir(APPPATH.$view_folder.DIRECTORY_SEPARATOR)) |
Andrey Andreev | 079fbfc | 2012-06-12 02:26:58 +0300 | [diff] [blame] | 241 | { |
| 242 | $view_folder = APPPATH.$view_folder; |
| 243 | } |
Andrey Andreev | 9f417d0 | 2013-10-14 12:24:36 +0300 | [diff] [blame] | 244 | elseif ( ! is_dir(APPPATH.'views'.DIRECTORY_SEPARATOR)) |
Joe Cianflone | 8eef9c7 | 2011-08-21 10:39:06 -0400 | [diff] [blame] | 245 | { |
Andrey Andreev | 806ca60 | 2012-06-12 12:51:27 +0300 | [diff] [blame] | 246 | header('HTTP/1.1 503 Service Unavailable.', TRUE, 503); |
Daniel Hunsaker | 3b5b7f4 | 2013-02-22 19:17:56 -0700 | [diff] [blame] | 247 | echo 'Your view folder path does not appear to be set correctly. Please open the following file and correct this: '.SELF; |
Andrey Andreev | 7cf682a | 2014-03-13 14:55:45 +0200 | [diff] [blame^] | 248 | exit(3); // EXIT_CONFIG |
Joe Cianflone | 8eef9c7 | 2011-08-21 10:39:06 -0400 | [diff] [blame] | 249 | } |
Andrey Andreev | 079fbfc | 2012-06-12 02:26:58 +0300 | [diff] [blame] | 250 | else |
| 251 | { |
| 252 | $view_folder = APPPATH.'views'; |
| 253 | } |
Joe Cianflone | 8eef9c7 | 2011-08-21 10:39:06 -0400 | [diff] [blame] | 254 | } |
Derek Allard | 2067d1a | 2008-11-13 22:59:24 +0000 | [diff] [blame] | 255 | |
Andrey Andreev | 806ca60 | 2012-06-12 12:51:27 +0300 | [diff] [blame] | 256 | if (($_temp = realpath($view_folder)) !== FALSE) |
Andrey Andreev | 079fbfc | 2012-06-12 02:26:58 +0300 | [diff] [blame] | 257 | { |
Andrey Andreev | 9f417d0 | 2013-10-14 12:24:36 +0300 | [diff] [blame] | 258 | $view_folder = $_temp.DIRECTORY_SEPARATOR; |
Andrey Andreev | 079fbfc | 2012-06-12 02:26:58 +0300 | [diff] [blame] | 259 | } |
| 260 | else |
| 261 | { |
Andrey Andreev | 9f417d0 | 2013-10-14 12:24:36 +0300 | [diff] [blame] | 262 | $view_folder = rtrim($view_folder, '/\\').DIRECTORY_SEPARATOR; |
Andrey Andreev | 079fbfc | 2012-06-12 02:26:58 +0300 | [diff] [blame] | 263 | } |
| 264 | |
Andrey Andreev | cce9180 | 2012-06-12 13:25:31 +0300 | [diff] [blame] | 265 | define('VIEWPATH', $view_folder); |
Andrey Andreev | 079fbfc | 2012-06-12 02:26:58 +0300 | [diff] [blame] | 266 | |
Derek Allard | 2067d1a | 2008-11-13 22:59:24 +0000 | [diff] [blame] | 267 | /* |
Derek Jones | 0c1e405 | 2010-03-02 14:31:31 -0600 | [diff] [blame] | 268 | * -------------------------------------------------------------------- |
| 269 | * LOAD THE BOOTSTRAP FILE |
| 270 | * -------------------------------------------------------------------- |
| 271 | * |
| 272 | * And away we go... |
Derek Jones | 0c1e405 | 2010-03-02 14:31:31 -0600 | [diff] [blame] | 273 | */ |
Greg Aker | 3a74665 | 2011-04-19 10:59:47 -0500 | [diff] [blame] | 274 | require_once BASEPATH.'core/CodeIgniter.php'; |
Derek Jones | 3b890ba | 2010-02-17 18:13:15 -0600 | [diff] [blame] | 275 | |
Derek Allard | 2067d1a | 2008-11-13 22:59:24 +0000 | [diff] [blame] | 276 | /* End of file index.php */ |
Andrey Andreev | 2029231 | 2013-07-22 14:29:10 +0300 | [diff] [blame] | 277 | /* Location: ./index.php */ |