App.php 6.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178
  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. public string $baseURL = 'http://localhost:8080/';
  17. /**
  18. * Allowed Hostnames in the Site URL other than the hostname in the baseURL.
  19. * If you want to accept multiple Hostnames, set this.
  20. *
  21. * E.g. When your site URL ($baseURL) is 'http://example.com/', and your site
  22. * also accepts 'http://media.example.com/' and
  23. * 'http://accounts.example.com/':
  24. * ['media.example.com', 'accounts.example.com']
  25. *
  26. * @var string[]
  27. * @phpstan-var list<string>
  28. */
  29. public array $allowedHostnames = [];
  30. /**
  31. * --------------------------------------------------------------------------
  32. * Index File
  33. * --------------------------------------------------------------------------
  34. *
  35. * Typically this will be your index.php file, unless you've renamed it to
  36. * something else. If you are using mod_rewrite to remove the page set this
  37. * variable so that it is blank.
  38. */
  39. public string $indexPage = 'index.php';
  40. /**
  41. * --------------------------------------------------------------------------
  42. * URI PROTOCOL
  43. * --------------------------------------------------------------------------
  44. *
  45. * This item determines which server global should be used to retrieve the
  46. * URI string. The default setting of 'REQUEST_URI' works for most servers.
  47. * If your links do not seem to work, try one of the other delicious flavors:
  48. *
  49. * 'REQUEST_URI' Uses $_SERVER['REQUEST_URI']
  50. * 'QUERY_STRING' Uses $_SERVER['QUERY_STRING']
  51. * 'PATH_INFO' Uses $_SERVER['PATH_INFO']
  52. *
  53. * WARNING: If you set this to 'PATH_INFO', URIs will always be URL-decoded!
  54. */
  55. public string $uriProtocol = 'REQUEST_URI';
  56. /**
  57. * --------------------------------------------------------------------------
  58. * Default Locale
  59. * --------------------------------------------------------------------------
  60. *
  61. * The Locale roughly represents the language and location that your visitor
  62. * is viewing the site from. It affects the language strings and other
  63. * strings (like currency markers, numbers, etc), that your program
  64. * should run under for this request.
  65. */
  66. public string $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. public bool $negotiateLocale = false;
  78. /**
  79. * --------------------------------------------------------------------------
  80. * Supported Locales
  81. * --------------------------------------------------------------------------
  82. *
  83. * If $negotiateLocale is true, this array lists the locales supported
  84. * by the application in descending order of priority. If no match is
  85. * found, the first locale will be used.
  86. *
  87. * IncomingRequest::setLocale() also uses this list.
  88. *
  89. * @var string[]
  90. */
  91. public array $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. * @see https://www.php.net/manual/en/timezones.php for list of timezones supported by PHP.
  101. */
  102. public string $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. public string $charset = 'UTF-8';
  114. /**
  115. * --------------------------------------------------------------------------
  116. * Force Global Secure Requests
  117. * --------------------------------------------------------------------------
  118. *
  119. * If true, this will force every request made to this application to be
  120. * made via a secure connection (HTTPS). If the incoming request is not
  121. * secure, the user will be redirected to a secure version of the page
  122. * and the HTTP Strict Transport Security header will be set.
  123. */
  124. public bool $forceGlobalSecureRequests = false;
  125. /**
  126. * --------------------------------------------------------------------------
  127. * Reverse Proxy IPs
  128. * --------------------------------------------------------------------------
  129. *
  130. * If your server is behind a reverse proxy, you must whitelist the proxy
  131. * IP addresses from which CodeIgniter should trust headers such as
  132. * X-Forwarded-For or Client-IP in order to properly identify
  133. * the visitor's IP address.
  134. *
  135. * You need to set a proxy IP address or IP address with subnets and
  136. * the HTTP header for the client IP address.
  137. *
  138. * Here are some examples:
  139. * [
  140. * '10.0.1.200' => 'X-Forwarded-For',
  141. * '192.168.5.0/24' => 'X-Real-IP',
  142. * ]
  143. *
  144. * @var array<string, string>
  145. */
  146. public array $proxyIPs = [];
  147. /**
  148. * --------------------------------------------------------------------------
  149. * Content Security Policy
  150. * --------------------------------------------------------------------------
  151. *
  152. * Enables the Response's Content Secure Policy to restrict the sources that
  153. * can be used for images, scripts, CSS files, audio, video, etc. If enabled,
  154. * the Response object will populate default values for the policy from the
  155. * `ContentSecurityPolicy.php` file. Controllers can always add to those
  156. * restrictions at run time.
  157. *
  158. * For a better understanding of CSP, see these documents:
  159. *
  160. * @see http://www.html5rocks.com/en/tutorials/security/content-security-policy/
  161. * @see http://www.w3.org/TR/CSP/
  162. */
  163. public bool $CSPEnabled = false;
  164. }