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. |
| 10 | | |
| 11 | */ |
admin | b0dd10f | 2006-08-25 17:25:49 +0000 | [diff] [blame] | 12 | error_reporting(E_ALL); |
| 13 | |
| 14 | /* |
admin | 1af5549 | 2006-09-22 21:43:38 +0000 | [diff] [blame] | 15 | |--------------------------------------------------------------- |
admin | b0dd10f | 2006-08-25 17:25:49 +0000 | [diff] [blame] | 16 | | SYSTEM FOLDER NAME |
admin | 1af5549 | 2006-09-22 21:43:38 +0000 | [diff] [blame] | 17 | |--------------------------------------------------------------- |
admin | b0dd10f | 2006-08-25 17:25:49 +0000 | [diff] [blame] | 18 | | |
admin | 1af5549 | 2006-09-22 21:43:38 +0000 | [diff] [blame] | 19 | | This variable must contain the name of your "system" folder. |
admin | e334c47 | 2006-10-21 19:44:22 +0000 | [diff] [blame] | 20 | | Include the path if the folder is not in the same directory |
admin | 1af5549 | 2006-09-22 21:43:38 +0000 | [diff] [blame] | 21 | | as this file. |
| 22 | | |
| 23 | | NO TRAILING SLASH! |
| 24 | | |
admin | b0dd10f | 2006-08-25 17:25:49 +0000 | [diff] [blame] | 25 | */ |
| 26 | |
| 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 | cef2106 | 2006-10-30 17:13:13 +0000 | [diff] [blame^] | 35 | | folder then the default one you can set its name here. |
| 36 | | The folder can also be relocated anywhere on your server. For |
| 37 | | more info please see the user guide: |
| 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 | */ |
| 44 | |
admin | 1af5549 | 2006-09-22 21:43:38 +0000 | [diff] [blame] | 45 | $application_folder = "application"; |
admin | b0dd10f | 2006-08-25 17:25:49 +0000 | [diff] [blame] | 46 | |
| 47 | /* |
admin | 1af5549 | 2006-09-22 21:43:38 +0000 | [diff] [blame] | 48 | |=============================================================== |
| 49 | | END OF USER CONFIGURABLE SETTINGS |
| 50 | |=============================================================== |
admin | b0dd10f | 2006-08-25 17:25:49 +0000 | [diff] [blame] | 51 | */ |
| 52 | |
admin | 1af5549 | 2006-09-22 21:43:38 +0000 | [diff] [blame] | 53 | // Let's attempt to determine the full-server path to the "system" |
| 54 | // folder in order to reduce the possibility of path problems. |
admin | b0dd10f | 2006-08-25 17:25:49 +0000 | [diff] [blame] | 55 | if (function_exists('realpath') AND @realpath(dirname(__FILE__)) !== FALSE) |
| 56 | { |
| 57 | $system_folder = str_replace("\\", "/", realpath(dirname(__FILE__))).'/'.$system_folder; |
| 58 | } |
| 59 | |
admin | 83b05a8 | 2006-09-25 21:06:46 +0000 | [diff] [blame] | 60 | // Is the $aplication variable blank? If so, we'll assume the folder is called "application" |
admin | 1af5549 | 2006-09-22 21:43:38 +0000 | [diff] [blame] | 61 | if ($application_folder == '') |
admin | b0dd10f | 2006-08-25 17:25:49 +0000 | [diff] [blame] | 62 | { |
admin | 1af5549 | 2006-09-22 21:43:38 +0000 | [diff] [blame] | 63 | $application_folder = 'application'; |
admin | b0dd10f | 2006-08-25 17:25:49 +0000 | [diff] [blame] | 64 | } |
| 65 | |
admin | e334c47 | 2006-10-21 19:44:22 +0000 | [diff] [blame] | 66 | // Some versions of PHP don't support the E_STRICT constant so we'll |
admin | 1af5549 | 2006-09-22 21:43:38 +0000 | [diff] [blame] | 67 | // explicitly define it so that it will be available to the Exception class |
admin | b0dd10f | 2006-08-25 17:25:49 +0000 | [diff] [blame] | 68 | if ( ! defined('E_STRICT')) |
| 69 | { |
| 70 | define('E_STRICT', 2048); |
| 71 | } |
| 72 | |
admin | 1af5549 | 2006-09-22 21:43:38 +0000 | [diff] [blame] | 73 | // Define a few constants that we use througout the framework. |
| 74 | // EXT - contains the file extension. Typically ".php" |
| 75 | // FCPATH - contains the full server path to THIS file. |
admin | e334c47 | 2006-10-21 19:44:22 +0000 | [diff] [blame] | 76 | // SELF - contains the name of THIS file. |
admin | 1af5549 | 2006-09-22 21:43:38 +0000 | [diff] [blame] | 77 | // BASEPATH - contains the full server path to the "system" folder |
| 78 | // APPPATH - contains the full server path to the "application" folder |
| 79 | |
admin | b0dd10f | 2006-08-25 17:25:49 +0000 | [diff] [blame] | 80 | define('EXT', '.'.pathinfo(__FILE__, PATHINFO_EXTENSION)); |
admin | 1af5549 | 2006-09-22 21:43:38 +0000 | [diff] [blame] | 81 | define('FCPATH', __FILE__); |
admin | b0dd10f | 2006-08-25 17:25:49 +0000 | [diff] [blame] | 82 | define('SELF', pathinfo(__FILE__, PATHINFO_BASENAME)); |
| 83 | define('BASEPATH', $system_folder.'/'); |
admin | cef2106 | 2006-10-30 17:13:13 +0000 | [diff] [blame^] | 84 | |
| 85 | if ( ! is_dir($application_folder)) |
| 86 | { |
| 87 | define($application_folder.'/'); |
| 88 | } |
| 89 | else |
| 90 | { |
| 91 | define('APPPATH', BASEPATH.$application_folder.'/'); |
| 92 | } |
admin | b0dd10f | 2006-08-25 17:25:49 +0000 | [diff] [blame] | 93 | |
admin | 1af5549 | 2006-09-22 21:43:38 +0000 | [diff] [blame] | 94 | // Load the front controller and away we go!.... |
admin | b0dd10f | 2006-08-25 17:25:49 +0000 | [diff] [blame] | 95 | require_once BASEPATH.'codeigniter/CodeIgniter'.EXT; |
| 96 | ?> |