admin | b0dd10f | 2006-08-25 17:25:49 +0000 | [diff] [blame] | 1 | <?php |
| 2 | |
admin | 1af5549 | 2006-09-22 21:43:38 +0000 | [diff] [blame] | 3 | /* |
| 4 | |--------------------------------------------------------------- |
| 5 | | PHP ERROR REPORTING LEVEL |
| 6 | |--------------------------------------------------------------- |
| 7 | | |
admin | 8f0a8f6 | 2006-10-07 01:17:25 +0000 | [diff] [blame] | 8 | | By default CI runs with error reporting set to ALL. For security |
admin | 1af5549 | 2006-09-22 21:43:38 +0000 | [diff] [blame] | 9 | | reasons you are encouraged to change this when your site goes live. |
admin | 784add7 | 2006-10-30 20:24:26 +0000 | [diff] [blame] | 10 | | For more info visit: http://www.php.net/error_reporting |
admin | 1af5549 | 2006-09-22 21:43:38 +0000 | [diff] [blame] | 11 | | |
| 12 | */ |
admin | 784add7 | 2006-10-30 20:24:26 +0000 | [diff] [blame] | 13 | error_reporting(E_ALL); |
admin | b0dd10f | 2006-08-25 17:25:49 +0000 | [diff] [blame] | 14 | |
| 15 | /* |
admin | 1af5549 | 2006-09-22 21:43:38 +0000 | [diff] [blame] | 16 | |--------------------------------------------------------------- |
admin | b0dd10f | 2006-08-25 17:25:49 +0000 | [diff] [blame] | 17 | | SYSTEM FOLDER NAME |
admin | 1af5549 | 2006-09-22 21:43:38 +0000 | [diff] [blame] | 18 | |--------------------------------------------------------------- |
admin | b0dd10f | 2006-08-25 17:25:49 +0000 | [diff] [blame] | 19 | | |
admin | 1af5549 | 2006-09-22 21:43:38 +0000 | [diff] [blame] | 20 | | This variable must contain the name of your "system" folder. |
admin | e334c47 | 2006-10-21 19:44:22 +0000 | [diff] [blame] | 21 | | Include the path if the folder is not in the same directory |
admin | 1af5549 | 2006-09-22 21:43:38 +0000 | [diff] [blame] | 22 | | as this file. |
| 23 | | |
| 24 | | NO TRAILING SLASH! |
| 25 | | |
admin | b0dd10f | 2006-08-25 17:25:49 +0000 | [diff] [blame] | 26 | */ |
admin | b0dd10f | 2006-08-25 17:25:49 +0000 | [diff] [blame] | 27 | $system_folder = "system"; |
| 28 | |
| 29 | /* |
admin | 1af5549 | 2006-09-22 21:43:38 +0000 | [diff] [blame] | 30 | |--------------------------------------------------------------- |
admin | b0dd10f | 2006-08-25 17:25:49 +0000 | [diff] [blame] | 31 | | APPLICATION FOLDER NAME |
admin | 1af5549 | 2006-09-22 21:43:38 +0000 | [diff] [blame] | 32 | |--------------------------------------------------------------- |
admin | b0dd10f | 2006-08-25 17:25:49 +0000 | [diff] [blame] | 33 | | |
admin | e334c47 | 2006-10-21 19:44:22 +0000 | [diff] [blame] | 34 | | If you want this front controller to use a different "application" |
admin | 784add7 | 2006-10-30 20:24:26 +0000 | [diff] [blame] | 35 | | folder then the default one you can set its name here. The folder |
| 36 | | can also be renamed or relocated anywhere on your server. |
| 37 | | For more info please see the user guide: |
admin | cef2106 | 2006-10-30 17:13:13 +0000 | [diff] [blame] | 38 | | http://www.codeigniter.com/user_guide/general/managing_apps.html |
| 39 | | |
admin | b0dd10f | 2006-08-25 17:25:49 +0000 | [diff] [blame] | 40 | | |
admin | 1af5549 | 2006-09-22 21:43:38 +0000 | [diff] [blame] | 41 | | NO TRAILING SLASH! |
admin | b0dd10f | 2006-08-25 17:25:49 +0000 | [diff] [blame] | 42 | | |
| 43 | */ |
admin | 1af5549 | 2006-09-22 21:43:38 +0000 | [diff] [blame] | 44 | $application_folder = "application"; |
admin | b0dd10f | 2006-08-25 17:25:49 +0000 | [diff] [blame] | 45 | |
admin | 784add7 | 2006-10-30 20:24:26 +0000 | [diff] [blame] | 46 | |
admin | b0dd10f | 2006-08-25 17:25:49 +0000 | [diff] [blame] | 47 | /* |
admin | 1af5549 | 2006-09-22 21:43:38 +0000 | [diff] [blame] | 48 | |=============================================================== |
admin | 784add7 | 2006-10-30 20:24:26 +0000 | [diff] [blame] | 49 | | END OF USER CONFIGURABLE SETTINGS |
admin | 1af5549 | 2006-09-22 21:43:38 +0000 | [diff] [blame] | 50 | |=============================================================== |
admin | b0dd10f | 2006-08-25 17:25:49 +0000 | [diff] [blame] | 51 | */ |
| 52 | |
admin | 784add7 | 2006-10-30 20:24:26 +0000 | [diff] [blame] | 53 | |
| 54 | /* |
| 55 | |--------------------------------------------------------------- |
| 56 | | SET THE SERVER PATH |
| 57 | |--------------------------------------------------------------- |
| 58 | | |
| 59 | | Let's attempt to determine the full-server path to the "system" |
| 60 | | folder in order to reduce the possibility of path problems. |
Rick Ellis | 09066a4 | 2007-06-09 01:00:06 +0000 | [diff] [blame] | 61 | | Note: We only attempt this if the user hasn't specified a |
| 62 | | full server path. |
admin | 784add7 | 2006-10-30 20:24:26 +0000 | [diff] [blame] | 63 | | |
| 64 | */ |
Rick Ellis | 09066a4 | 2007-06-09 01:00:06 +0000 | [diff] [blame] | 65 | if (strpos($system_folder, '/') === FALSE) |
admin | b0dd10f | 2006-08-25 17:25:49 +0000 | [diff] [blame] | 66 | { |
Rick Ellis | 09066a4 | 2007-06-09 01:00:06 +0000 | [diff] [blame] | 67 | if (function_exists('realpath') AND @realpath(dirname(__FILE__)) !== FALSE) |
| 68 | { |
| 69 | $system_folder = realpath(dirname(__FILE__)).'/'.$system_folder; |
| 70 | } |
| 71 | } |
| 72 | else |
| 73 | { |
| 74 | // Swap directory separators to Unix style for consistency |
| 75 | $system_folder = str_replace("\\", "/", $system_folder); |
admin | b0dd10f | 2006-08-25 17:25:49 +0000 | [diff] [blame] | 76 | } |
| 77 | |
admin | 784add7 | 2006-10-30 20:24:26 +0000 | [diff] [blame] | 78 | /* |
| 79 | |--------------------------------------------------------------- |
| 80 | | DEFINE APPLICATION CONSTANTS |
| 81 | |--------------------------------------------------------------- |
| 82 | | |
| 83 | | EXT - The file extension. Typically ".php" |
| 84 | | FCPATH - The full server path to THIS file |
| 85 | | SELF - The name of THIS file (typically "index.php) |
| 86 | | BASEPATH - The full server path to the "system" folder |
| 87 | | APPPATH - The full server path to the "application" folder |
| 88 | | |
| 89 | */ |
admin | b0dd10f | 2006-08-25 17:25:49 +0000 | [diff] [blame] | 90 | define('EXT', '.'.pathinfo(__FILE__, PATHINFO_EXTENSION)); |
admin | 1af5549 | 2006-09-22 21:43:38 +0000 | [diff] [blame] | 91 | define('FCPATH', __FILE__); |
admin | b0dd10f | 2006-08-25 17:25:49 +0000 | [diff] [blame] | 92 | define('SELF', pathinfo(__FILE__, PATHINFO_BASENAME)); |
| 93 | define('BASEPATH', $system_folder.'/'); |
admin | cef2106 | 2006-10-30 17:13:13 +0000 | [diff] [blame] | 94 | |
admin | 784add7 | 2006-10-30 20:24:26 +0000 | [diff] [blame] | 95 | if (is_dir($application_folder)) |
admin | cef2106 | 2006-10-30 17:13:13 +0000 | [diff] [blame] | 96 | { |
admin | 784add7 | 2006-10-30 20:24:26 +0000 | [diff] [blame] | 97 | define('APPPATH', $application_folder.'/'); |
admin | cef2106 | 2006-10-30 17:13:13 +0000 | [diff] [blame] | 98 | } |
| 99 | else |
| 100 | { |
admin | 784add7 | 2006-10-30 20:24:26 +0000 | [diff] [blame] | 101 | if ($application_folder == '') |
| 102 | { |
| 103 | $application_folder = 'application'; |
| 104 | } |
| 105 | |
admin | cef2106 | 2006-10-30 17:13:13 +0000 | [diff] [blame] | 106 | define('APPPATH', BASEPATH.$application_folder.'/'); |
| 107 | } |
admin | b0dd10f | 2006-08-25 17:25:49 +0000 | [diff] [blame] | 108 | |
admin | 784add7 | 2006-10-30 20:24:26 +0000 | [diff] [blame] | 109 | /* |
| 110 | |--------------------------------------------------------------- |
| 111 | | DEFINE E_STRICT |
| 112 | |--------------------------------------------------------------- |
| 113 | | |
| 114 | | Some older versions of PHP don't support the E_STRICT constant |
| 115 | | so we need to explicitly define it otherwise the Exception class |
| 116 | | will generate errors. |
| 117 | | |
| 118 | */ |
| 119 | if ( ! defined('E_STRICT')) |
| 120 | { |
| 121 | define('E_STRICT', 2048); |
| 122 | } |
| 123 | |
| 124 | /* |
| 125 | |--------------------------------------------------------------- |
| 126 | | LOAD THE FRONT CONTROLLER |
| 127 | |--------------------------------------------------------------- |
| 128 | | |
| 129 | | And away we go... |
| 130 | | |
| 131 | */ |
admin | b0dd10f | 2006-08-25 17:25:49 +0000 | [diff] [blame] | 132 | require_once BASEPATH.'codeigniter/CodeIgniter'.EXT; |
| 133 | ?> |