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