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