PageRenderTime 55ms CodeModel.GetById 24ms RepoModel.GetById 0ms app.codeStats 1ms

/app/Config/App.php

https://gitlab.com/sejator/posci4
PHP | 448 lines | 37 code | 33 blank | 378 comment | 0 complexity | fd1ebb3cb0cdd0a4751b28d71d794d98 MD5 | raw file
  1. <?php
  2. namespace Config;
  3. use CodeIgniter\Config\BaseConfig;
  4. class App extends BaseConfig
  5. {
  6. /**
  7. * --------------------------------------------------------------------------
  8. * Base Site URL
  9. * --------------------------------------------------------------------------
  10. *
  11. * URL to your CodeIgniter root. Typically this will be your base URL,
  12. * WITH a trailing slash:
  13. *
  14. * http://example.com/
  15. *
  16. * If this is not set then CodeIgniter will try guess the protocol, domain
  17. * and path to your installation. However, you should always configure this
  18. * explicitly and never rely on auto-guessing, especially in production
  19. * environments.
  20. *
  21. * @var string
  22. */
  23. public $baseURL = 'http://localhost:8080/';
  24. /**
  25. * --------------------------------------------------------------------------
  26. * Index File
  27. * --------------------------------------------------------------------------
  28. *
  29. * Typically this will be your index.php file, unless you've renamed it to
  30. * something else. If you are using mod_rewrite to remove the page set this
  31. * variable so that it is blank.
  32. *
  33. * @var string
  34. */
  35. public $indexPage = 'index.php';
  36. /**
  37. * --------------------------------------------------------------------------
  38. * URI PROTOCOL
  39. * --------------------------------------------------------------------------
  40. *
  41. * This item determines which getServer global should be used to retrieve the
  42. * URI string. The default setting of 'REQUEST_URI' works for most servers.
  43. * If your links do not seem to work, try one of the other delicious flavors:
  44. *
  45. * 'REQUEST_URI' Uses $_SERVER['REQUEST_URI']
  46. * 'QUERY_STRING' Uses $_SERVER['QUERY_STRING']
  47. * 'PATH_INFO' Uses $_SERVER['PATH_INFO']
  48. *
  49. * WARNING: If you set this to 'PATH_INFO', URIs will always be URL-decoded!
  50. *
  51. * @var string
  52. */
  53. public $uriProtocol = 'REQUEST_URI';
  54. /**
  55. * --------------------------------------------------------------------------
  56. * Default Locale
  57. * --------------------------------------------------------------------------
  58. *
  59. * The Locale roughly represents the language and location that your visitor
  60. * is viewing the site from. It affects the language strings and other
  61. * strings (like currency markers, numbers, etc), that your program
  62. * should run under for this request.
  63. *
  64. * @var string
  65. */
  66. public $defaultLocale = 'en';
  67. /**
  68. * --------------------------------------------------------------------------
  69. * Negotiate Locale
  70. * --------------------------------------------------------------------------
  71. *
  72. * If true, the current Request object will automatically determine the
  73. * language to use based on the value of the Accept-Language header.
  74. *
  75. * If false, no automatic detection will be performed.
  76. *
  77. * @var boolean
  78. */
  79. public $negotiateLocale = false;
  80. /**
  81. * --------------------------------------------------------------------------
  82. * Supported Locales
  83. * --------------------------------------------------------------------------
  84. *
  85. * If $negotiateLocale is true, this array lists the locales supported
  86. * by the application in descending order of priority. If no match is
  87. * found, the first locale will be used.
  88. *
  89. * @var string[]
  90. */
  91. public $supportedLocales = ['en'];
  92. /**
  93. * --------------------------------------------------------------------------
  94. * Application Timezone
  95. * --------------------------------------------------------------------------
  96. *
  97. * The default timezone that will be used in your application to display
  98. * dates with the date helper, and can be retrieved through app_timezone()
  99. *
  100. * @var string
  101. */
  102. public $appTimezone = 'America/Chicago';
  103. /**
  104. * --------------------------------------------------------------------------
  105. * Default Character Set
  106. * --------------------------------------------------------------------------
  107. *
  108. * This determines which character set is used by default in various methods
  109. * that require a character set to be provided.
  110. *
  111. * @see http://php.net/htmlspecialchars for a list of supported charsets.
  112. *
  113. * @var string
  114. */
  115. public $charset = 'UTF-8';
  116. /**
  117. * --------------------------------------------------------------------------
  118. * URI PROTOCOL
  119. * --------------------------------------------------------------------------
  120. *
  121. * If true, this will force every request made to this application to be
  122. * made via a secure connection (HTTPS). If the incoming request is not
  123. * secure, the user will be redirected to a secure version of the page
  124. * and the HTTP Strict Transport Security header will be set.
  125. *
  126. * @var boolean
  127. */
  128. public $forceGlobalSecureRequests = false;
  129. /**
  130. * --------------------------------------------------------------------------
  131. * Session Driver
  132. * --------------------------------------------------------------------------
  133. *
  134. * The session storage driver to use:
  135. * - `CodeIgniter\Session\Handlers\FileHandler`
  136. * - `CodeIgniter\Session\Handlers\DatabaseHandler`
  137. * - `CodeIgniter\Session\Handlers\MemcachedHandler`
  138. * - `CodeIgniter\Session\Handlers\RedisHandler`
  139. *
  140. * @var string
  141. */
  142. public $sessionDriver = 'CodeIgniter\Session\Handlers\FileHandler';
  143. /**
  144. * --------------------------------------------------------------------------
  145. * Session Cookie Name
  146. * --------------------------------------------------------------------------
  147. *
  148. * The session cookie name, must contain only [0-9a-z_-] characters
  149. *
  150. * @var string
  151. */
  152. public $sessionCookieName = 'ci_session';
  153. /**
  154. * --------------------------------------------------------------------------
  155. * Session Expiration
  156. * --------------------------------------------------------------------------
  157. *
  158. * The number of SECONDS you want the session to last.
  159. * Setting to 0 (zero) means expire when the browser is closed.
  160. *
  161. * @var integer
  162. */
  163. public $sessionExpiration = 7200;
  164. /**
  165. * --------------------------------------------------------------------------
  166. * Session Save Path
  167. * --------------------------------------------------------------------------
  168. *
  169. * The location to save sessions to and is driver dependent.
  170. *
  171. * For the 'files' driver, it's a path to a writable directory.
  172. * WARNING: Only absolute paths are supported!
  173. *
  174. * For the 'database' driver, it's a table name.
  175. * Please read up the manual for the format with other session drivers.
  176. *
  177. * IMPORTANT: You are REQUIRED to set a valid save path!
  178. *
  179. * @var string
  180. */
  181. public $sessionSavePath = WRITEPATH . 'session';
  182. /**
  183. * --------------------------------------------------------------------------
  184. * Session Match IP
  185. * --------------------------------------------------------------------------
  186. *
  187. * Whether to match the user's IP address when reading the session data.
  188. *
  189. * WARNING: If you're using the database driver, don't forget to update
  190. * your session table's PRIMARY KEY when changing this setting.
  191. *
  192. * @var boolean
  193. */
  194. public $sessionMatchIP = false;
  195. /**
  196. * --------------------------------------------------------------------------
  197. * Session Time to Update
  198. * --------------------------------------------------------------------------
  199. *
  200. * How many seconds between CI regenerating the session ID.
  201. *
  202. * @var integer
  203. */
  204. public $sessionTimeToUpdate = 300;
  205. /**
  206. * --------------------------------------------------------------------------
  207. * Session Regenerate Destroy
  208. * --------------------------------------------------------------------------
  209. *
  210. * Whether to destroy session data associated with the old session ID
  211. * when auto-regenerating the session ID. When set to FALSE, the data
  212. * will be later deleted by the garbage collector.
  213. *
  214. * @var boolean
  215. */
  216. public $sessionRegenerateDestroy = false;
  217. /**
  218. * --------------------------------------------------------------------------
  219. * Cookie Prefix
  220. * --------------------------------------------------------------------------
  221. *
  222. * Set a cookie name prefix if you need to avoid collisions.
  223. *
  224. * @var string
  225. */
  226. public $cookiePrefix = '';
  227. /**
  228. * --------------------------------------------------------------------------
  229. * Cookie Domain
  230. * --------------------------------------------------------------------------
  231. *
  232. * Set to `.your-domain.com` for site-wide cookies.
  233. *
  234. * @var string
  235. */
  236. public $cookieDomain = '';
  237. /**
  238. * --------------------------------------------------------------------------
  239. * Cookie Path
  240. * --------------------------------------------------------------------------
  241. *
  242. * Typically will be a forward slash.
  243. *
  244. * @var string
  245. */
  246. public $cookiePath = '/';
  247. /**
  248. * --------------------------------------------------------------------------
  249. * Cookie Secure
  250. * --------------------------------------------------------------------------
  251. *
  252. * Cookie will only be set if a secure HTTPS connection exists.
  253. *
  254. * @var boolean
  255. */
  256. public $cookieSecure = false;
  257. /**
  258. * --------------------------------------------------------------------------
  259. * Cookie HTTP Only
  260. * --------------------------------------------------------------------------
  261. *
  262. * Cookie will only be accessible via HTTP(S) (no JavaScript).
  263. *
  264. * @var boolean
  265. */
  266. public $cookieHTTPOnly = false;
  267. /**
  268. * --------------------------------------------------------------------------
  269. * Cookie SameSite
  270. * --------------------------------------------------------------------------
  271. *
  272. * Configure cookie SameSite setting. Allowed values are:
  273. * - None
  274. * - Lax
  275. * - Strict
  276. * - ''
  277. *
  278. * Defaults to `Lax` for compatibility with modern browsers. Setting `''`
  279. * (empty string) means no SameSite attribute will be set on cookies. If
  280. * set to `None`, `$cookieSecure` must also be set.
  281. *
  282. * @var string 'Lax'|'None'|'Strict'
  283. */
  284. public $cookieSameSite = 'Lax';
  285. /**
  286. * --------------------------------------------------------------------------
  287. * Reverse Proxy IPs
  288. * --------------------------------------------------------------------------
  289. *
  290. * If your server is behind a reverse proxy, you must whitelist the proxy
  291. * IP addresses from which CodeIgniter should trust headers such as
  292. * HTTP_X_FORWARDED_FOR and HTTP_CLIENT_IP in order to properly identify
  293. * the visitor's IP address.
  294. *
  295. * You can use both an array or a comma-separated list of proxy addresses,
  296. * as well as specifying whole subnets. Here are a few examples:
  297. *
  298. * Comma-separated: '10.0.1.200,192.168.5.0/24'
  299. * Array: ['10.0.1.200', '192.168.5.0/24']
  300. *
  301. * @var string|string[]
  302. */
  303. public $proxyIPs = '';
  304. /**
  305. * --------------------------------------------------------------------------
  306. * CSRF Token Name
  307. * --------------------------------------------------------------------------
  308. *
  309. * The token name.
  310. *
  311. * @deprecated Use `Config\Security` $tokenName property instead of using this property.
  312. *
  313. * @var string
  314. */
  315. public $CSRFTokenName = 'csrf_test_name';
  316. /**
  317. * --------------------------------------------------------------------------
  318. * CSRF Header Name
  319. * --------------------------------------------------------------------------
  320. *
  321. * The header name.
  322. *
  323. * @deprecated Use `Config\Security` $headerName property instead of using this property.
  324. *
  325. * @var string
  326. */
  327. public $CSRFHeaderName = 'X-CSRF-TOKEN';
  328. /**
  329. * --------------------------------------------------------------------------
  330. * CSRF Cookie Name
  331. * --------------------------------------------------------------------------
  332. *
  333. * The cookie name.
  334. *
  335. * @deprecated Use `Config\Security` $cookieName property instead of using this property.
  336. *
  337. * @var string
  338. */
  339. public $CSRFCookieName = 'csrf_cookie_name';
  340. /**
  341. * --------------------------------------------------------------------------
  342. * CSRF Expire
  343. * --------------------------------------------------------------------------
  344. *
  345. * The number in seconds the token should expire.
  346. *
  347. * @deprecated Use `Config\Security` $expire property instead of using this property.
  348. *
  349. * @var integer
  350. */
  351. public $CSRFExpire = 7200;
  352. /**
  353. * --------------------------------------------------------------------------
  354. * CSRF Regenerate
  355. * --------------------------------------------------------------------------
  356. *
  357. * Regenerate token on every submission?
  358. *
  359. * @deprecated Use `Config\Security` $regenerate property instead of using this property.
  360. *
  361. * @var boolean
  362. */
  363. public $CSRFRegenerate = true;
  364. /**
  365. * --------------------------------------------------------------------------
  366. * CSRF Redirect
  367. * --------------------------------------------------------------------------
  368. *
  369. * Redirect to previous page with error on failure?
  370. *
  371. * @deprecated Use `Config\Security` $redirect property instead of using this property.
  372. *
  373. * @var boolean
  374. */
  375. public $CSRFRedirect = true;
  376. /**
  377. * --------------------------------------------------------------------------
  378. * CSRF SameSite
  379. * --------------------------------------------------------------------------
  380. *
  381. * Setting for CSRF SameSite cookie token. Allowed values are:
  382. * - None
  383. * - Lax
  384. * - Strict
  385. * - ''
  386. *
  387. * Defaults to `Lax` as recommended in this link:
  388. *
  389. * @see https://portswigger.net/web-security/csrf/samesite-cookies
  390. *
  391. * @deprecated Use `Config\Security` $samesite property instead of using this property.
  392. *
  393. * @var string
  394. */
  395. public $CSRFSameSite = 'Lax';
  396. /**
  397. * --------------------------------------------------------------------------
  398. * Content Security Policy
  399. * --------------------------------------------------------------------------
  400. *
  401. * Enables the Response's Content Secure Policy to restrict the sources that
  402. * can be used for images, scripts, CSS files, audio, video, etc. If enabled,
  403. * the Response object will populate default values for the policy from the
  404. * `ContentSecurityPolicy.php` file. Controllers can always add to those
  405. * restrictions at run time.
  406. *
  407. * For a better understanding of CSP, see these documents:
  408. *
  409. * @see http://www.html5rocks.com/en/tutorials/security/content-security-policy/
  410. * @see http://www.w3.org/TR/CSP/
  411. *
  412. * @var boolean
  413. */
  414. public $CSPEnabled = false;
  415. }