App.php 9.5 KB

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