|
| 1 | +<?php namespace Config; |
| 2 | + |
| 3 | +use CodeIgniter\Config\BaseConfig; |
| 4 | + |
| 5 | +class App extends BaseConfig |
| 6 | +{ |
| 7 | + |
| 8 | + /* |
| 9 | + |-------------------------------------------------------------------------- |
| 10 | + | Base Site URL |
| 11 | + |-------------------------------------------------------------------------- |
| 12 | + | |
| 13 | + | URL to your CodeIgniter root. Typically this will be your base URL, |
| 14 | + | WITH a trailing slash: |
| 15 | + | |
| 16 | + | http://example.com/ |
| 17 | + | |
| 18 | + | If this is not set then CodeIgniter will try guess the protocol, domain |
| 19 | + | and path to your installation. However, you should always configure this |
| 20 | + | explicitly and never rely on auto-guessing, especially in production |
| 21 | + | environments. |
| 22 | + | |
| 23 | + */ |
| 24 | + public $baseURL = ''; |
| 25 | + |
| 26 | + /* |
| 27 | + |-------------------------------------------------------------------------- |
| 28 | + | Index File |
| 29 | + |-------------------------------------------------------------------------- |
| 30 | + | |
| 31 | + | Typically this will be your index.php file, unless you've renamed it to |
| 32 | + | something else. If you are using mod_rewrite to remove the page set this |
| 33 | + | variable so that it is blank. |
| 34 | + | |
| 35 | + */ |
| 36 | + public $indexPage = 'index.php'; |
| 37 | + |
| 38 | + /* |
| 39 | + |-------------------------------------------------------------------------- |
| 40 | + | URI PROTOCOL |
| 41 | + |-------------------------------------------------------------------------- |
| 42 | + | |
| 43 | + | This item determines which getServer global should be used to retrieve the |
| 44 | + | URI string. The default setting of 'REQUEST_URI' works for most servers. |
| 45 | + | If your links do not seem to work, try one of the other delicious flavors: |
| 46 | + | |
| 47 | + | 'REQUEST_URI' Uses $_SERVER['REQUEST_URI'] |
| 48 | + | 'QUERY_STRING' Uses $_SERVER['QUERY_STRING'] |
| 49 | + | 'PATH_INFO' Uses $_SERVER['PATH_INFO'] |
| 50 | + | |
| 51 | + | WARNING: If you set this to 'PATH_INFO', URIs will always be URL-decoded! |
| 52 | + */ |
| 53 | + public $uriProtocol = 'REQUEST_URI'; |
| 54 | + |
| 55 | + /* |
| 56 | + |-------------------------------------------------------------------------- |
| 57 | + | Default Locale |
| 58 | + |-------------------------------------------------------------------------- |
| 59 | + | |
| 60 | + | The Locale roughly represents the language and location that your visitor |
| 61 | + | is viewing the site from. It affects the language strings and other |
| 62 | + | strings (like currency markers, numbers, etc), that your program |
| 63 | + | should run under for this request. |
| 64 | + | |
| 65 | + */ |
| 66 | + public $defaultLocale = 'en'; |
| 67 | + |
| 68 | + /* |
| 69 | + |-------------------------------------------------------------------------- |
| 70 | + | Negotiate Locale |
| 71 | + |-------------------------------------------------------------------------- |
| 72 | + | |
| 73 | + | If true, the current Request object will automatically determine the |
| 74 | + | language to use based on the value of the Accept-Language header. |
| 75 | + | |
| 76 | + | If false, no automatic detection will be performed. |
| 77 | + | |
| 78 | + */ |
| 79 | + public $negotiateLocale = false; |
| 80 | + |
| 81 | + /* |
| 82 | + |-------------------------------------------------------------------------- |
| 83 | + | Supported Locales |
| 84 | + |-------------------------------------------------------------------------- |
| 85 | + | |
| 86 | + | If $negotiateLocale is true, this array lists the locales supported |
| 87 | + | by the application in descending order of priority. If no match is |
| 88 | + | found, the first locale will be used. |
| 89 | + | |
| 90 | + */ |
| 91 | + public $supportedLocales = ['en']; |
| 92 | + |
| 93 | + /* |
| 94 | + |-------------------------------------------------------------------------- |
| 95 | + | Application Timezone |
| 96 | + |-------------------------------------------------------------------------- |
| 97 | + | |
| 98 | + | The default timezone that will be used in your application to display |
| 99 | + | dates with the date helper, and can be retrieved through app_timezone() |
| 100 | + | |
| 101 | + */ |
| 102 | + public $appTimezone = 'America/Chicago'; |
| 103 | + |
| 104 | + /* |
| 105 | + |-------------------------------------------------------------------------- |
| 106 | + | Default Character Set |
| 107 | + |-------------------------------------------------------------------------- |
| 108 | + | |
| 109 | + | This determines which character set is used by default in various methods |
| 110 | + | that require a character set to be provided. |
| 111 | + | |
| 112 | + | See http://php.net/htmlspecialchars for a list of supported charsets. |
| 113 | + | |
| 114 | + */ |
| 115 | + public $charset = 'UTF-8'; |
| 116 | + |
| 117 | + /* |
| 118 | + |-------------------------------------------------------------------------- |
| 119 | + | URI PROTOCOL |
| 120 | + |-------------------------------------------------------------------------- |
| 121 | + | |
| 122 | + | If true, this will force every request made to this application to be |
| 123 | + | made via a secure connection (HTTPS). If the incoming request is not |
| 124 | + | secure, the user will be redirected to a secure version of the page |
| 125 | + | and the HTTP Strict Transport Security header will be set. |
| 126 | + */ |
| 127 | + public $forceGlobalSecureRequests = false; |
| 128 | + |
| 129 | + /* |
| 130 | + |-------------------------------------------------------------------------- |
| 131 | + | Session Variables |
| 132 | + |-------------------------------------------------------------------------- |
| 133 | + | |
| 134 | + | 'sessionDriver' |
| 135 | + | |
| 136 | + | The storage driver to use: files, database, redis, memcached |
| 137 | + | - CodeIgniter\Session\Handlers\FileHandler |
| 138 | + | - CodeIgniter\Session\Handlers\DatabaseHandler |
| 139 | + | - CodeIgniter\Session\Handlers\MemcachedHandler |
| 140 | + | - CodeIgniter\Session\Handlers\RedisHandler |
| 141 | + | |
| 142 | + | 'sessionCookieName' |
| 143 | + | |
| 144 | + | The session cookie name, must contain only [0-9a-z_-] characters |
| 145 | + | |
| 146 | + | 'sessionExpiration' |
| 147 | + | |
| 148 | + | The number of SECONDS you want the session to last. |
| 149 | + | Setting to 0 (zero) means expire when the browser is closed. |
| 150 | + | |
| 151 | + | 'sessionSavePath' |
| 152 | + | |
| 153 | + | The location to save sessions to, driver dependent. |
| 154 | + | |
| 155 | + | For the 'files' driver, it's a path to a writable directory. |
| 156 | + | WARNING: Only absolute paths are supported! |
| 157 | + | |
| 158 | + | For the 'database' driver, it's a table name. |
| 159 | + | Please read up the manual for the format with other session drivers. |
| 160 | + | |
| 161 | + | IMPORTANT: You are REQUIRED to set a valid save path! |
| 162 | + | |
| 163 | + | 'sessionMatchIP' |
| 164 | + | |
| 165 | + | Whether to match the user's IP address when reading the session data. |
| 166 | + | |
| 167 | + | WARNING: If you're using the database driver, don't forget to update |
| 168 | + | your session table's PRIMARY KEY when changing this setting. |
| 169 | + | |
| 170 | + | 'sessionTimeToUpdate' |
| 171 | + | |
| 172 | + | How many seconds between CI regenerating the session ID. |
| 173 | + | |
| 174 | + | 'sessionRegenerateDestroy' |
| 175 | + | |
| 176 | + | Whether to destroy session data associated with the old session ID |
| 177 | + | when auto-regenerating the session ID. When set to FALSE, the data |
| 178 | + | will be later deleted by the garbage collector. |
| 179 | + | |
| 180 | + | Other session cookie settings are shared with the rest of the application, |
| 181 | + | except for 'cookie_prefix' and 'cookie_httponly', which are ignored here. |
| 182 | + | |
| 183 | + */ |
| 184 | + public $sessionDriver = 'CodeIgniter\Session\Handlers\FileHandler'; |
| 185 | + public $sessionCookieName = 'ci_session'; |
| 186 | + public $sessionExpiration = 7200; |
| 187 | + public $sessionSavePath = WRITEPATH . 'session'; |
| 188 | + public $sessionMatchIP = false; |
| 189 | + public $sessionTimeToUpdate = 300; |
| 190 | + public $sessionRegenerateDestroy = false; |
| 191 | + |
| 192 | + /* |
| 193 | + |-------------------------------------------------------------------------- |
| 194 | + | Cookie Related Variables |
| 195 | + |-------------------------------------------------------------------------- |
| 196 | + | |
| 197 | + | 'cookiePrefix' = Set a cookie name prefix if you need to avoid collisions |
| 198 | + | 'cookieDomain' = Set to .your-domain.com for site-wide cookies |
| 199 | + | 'cookiePath' = Typically will be a forward slash |
| 200 | + | 'cookieSecure' = Cookie will only be set if a secure HTTPS connection exists. |
| 201 | + | 'cookieHTTPOnly' = Cookie will only be accessible via HTTP(S) (no javascript) |
| 202 | + | |
| 203 | + | Note: These settings (with the exception of 'cookie_prefix' and |
| 204 | + | 'cookie_httponly') will also affect sessions. |
| 205 | + | |
| 206 | + */ |
| 207 | + public $cookiePrefix = ''; |
| 208 | + public $cookieDomain = ''; |
| 209 | + public $cookiePath = '/'; |
| 210 | + public $cookieSecure = false; |
| 211 | + public $cookieHTTPOnly = false; |
| 212 | + |
| 213 | + /* |
| 214 | + |-------------------------------------------------------------------------- |
| 215 | + | Reverse Proxy IPs |
| 216 | + |-------------------------------------------------------------------------- |
| 217 | + | |
| 218 | + | If your server is behind a reverse proxy, you must whitelist the proxy |
| 219 | + | IP addresses from which CodeIgniter should trust headers such as |
| 220 | + | HTTP_X_FORWARDED_FOR and HTTP_CLIENT_IP in order to properly identify |
| 221 | + | the visitor's IP address. |
| 222 | + | |
| 223 | + | You can use both an array or a comma-separated list of proxy addresses, |
| 224 | + | as well as specifying whole subnets. Here are a few examples: |
| 225 | + | |
| 226 | + | Comma-separated: '10.0.1.200,192.168.5.0/24' |
| 227 | + | Array: array('10.0.1.200', '192.168.5.0/24') |
| 228 | + */ |
| 229 | + public $proxyIPs = ''; |
| 230 | + |
| 231 | + /* |
| 232 | + |-------------------------------------------------------------------------- |
| 233 | + | Cross Site Request Forgery |
| 234 | + |-------------------------------------------------------------------------- |
| 235 | + | Enables a CSRF cookie token to be set. When set to TRUE, token will be |
| 236 | + | checked on a submitted form. If you are accepting user data, it is strongly |
| 237 | + | recommended CSRF protection be enabled. |
| 238 | + | |
| 239 | + | CSRFTokenName = The token name |
| 240 | + | CSRFCookieName = The cookie name |
| 241 | + | CSRFExpire = The number in seconds the token should expire. |
| 242 | + | CSRFRegenerate = Regenerate token on every submission |
| 243 | + | CSRFRedirect = Redirect to previous page with error on failure |
| 244 | + */ |
| 245 | + public $CSRFTokenName = 'csrf_test_name'; |
| 246 | + public $CSRFCookieName = 'csrf_cookie_name'; |
| 247 | + public $CSRFExpire = 7200; |
| 248 | + public $CSRFRegenerate = true; |
| 249 | + public $CSRFRedirect = true; |
| 250 | + |
| 251 | + /* |
| 252 | + |-------------------------------------------------------------------------- |
| 253 | + | Content Security Policy |
| 254 | + |-------------------------------------------------------------------------- |
| 255 | + | Enables the Response's Content Secure Policy to restrict the sources that |
| 256 | + | can be used for images, scripts, CSS files, audio, video, etc. If enabled, |
| 257 | + | the Response object will populate default values for the policy from the |
| 258 | + | ContentSecurityPolicy.php file. Controllers can always add to those |
| 259 | + | restrictions at run time. |
| 260 | + | |
| 261 | + | For a better understanding of CSP, see these documents: |
| 262 | + | - http://www.html5rocks.com/en/tutorials/security/content-security-policy/ |
| 263 | + | - http://www.w3.org/TR/CSP/ |
| 264 | + */ |
| 265 | + public $CSPEnabled = false; |
| 266 | + |
| 267 | + /* |
| 268 | + |-------------------------------------------------------------------------- |
| 269 | + | Debug Toolbar |
| 270 | + |-------------------------------------------------------------------------- |
| 271 | + | The Debug Toolbar provides a way to see information about the performance |
| 272 | + | and state of your application during that page display. By default it will |
| 273 | + | NOT be displayed under production environments, and will only display if |
| 274 | + | CI_DEBUG is true, since if it's not, there's not much to display anyway. |
| 275 | + | |
| 276 | + | toolbarMaxHistory = Number of history files, 0 for none or -1 for unlimited |
| 277 | + | |
| 278 | + */ |
| 279 | + public $toolbarCollectors = [ |
| 280 | + 'CodeIgniter\Debug\Toolbar\Collectors\Timers', |
| 281 | + 'CodeIgniter\Debug\Toolbar\Collectors\Database', |
| 282 | + 'CodeIgniter\Debug\Toolbar\Collectors\Logs', |
| 283 | + 'CodeIgniter\Debug\Toolbar\Collectors\Views', |
| 284 | + // 'CodeIgniter\Debug\Toolbar\Collectors\Cache', |
| 285 | + 'CodeIgniter\Debug\Toolbar\Collectors\Files', |
| 286 | + 'CodeIgniter\Debug\Toolbar\Collectors\Routes', |
| 287 | + 'CodeIgniter\Debug\Toolbar\Collectors\Events', |
| 288 | + ]; |
| 289 | + public $toolbarMaxHistory = 20; |
| 290 | + |
| 291 | + /* |
| 292 | + |-------------------------------------------------------------------------- |
| 293 | + | Application Salt |
| 294 | + |-------------------------------------------------------------------------- |
| 295 | + | |
| 296 | + | The $salt can be used anywhere within the application that you need |
| 297 | + | to provide secure data. It should be different for every application |
| 298 | + | and can be of any length, though the more random the characters |
| 299 | + | the better. |
| 300 | + | |
| 301 | + */ |
| 302 | + public $salt = ''; |
| 303 | + |
| 304 | + //-------------------------------------------------------------------- |
| 305 | + |
| 306 | +} |
0 commit comments