application.php 7.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237
  1. <?php
  2. return
  3. [
  4. /*
  5. * ---------------------------------------------------------
  6. * Base URL.
  7. * ---------------------------------------------------------
  8. *
  9. * Base URL of your application.
  10. *
  11. * It will be auto-detected in a web environment if set to null
  12. * but should be configured if you plan to build URLs in the
  13. * command line.
  14. */
  15. 'base_url' => null,
  16. /*
  17. * ---------------------------------------------------------
  18. * Clean URLs
  19. * ---------------------------------------------------------
  20. *
  21. * Set to true to hide "index.php" from your urls.
  22. */
  23. 'clean_urls' => true,
  24. /*
  25. * ---------------------------------------------------------
  26. * Timezone
  27. * ---------------------------------------------------------
  28. *
  29. * Set the default timezone used by various PHP date functions.
  30. */
  31. 'timezone' => 'UTC',
  32. /*
  33. * ---------------------------------------------------------
  34. * Charset
  35. * ---------------------------------------------------------
  36. *
  37. * Default character set used internally in the framework.
  38. */
  39. 'charset' => 'UTF-8',
  40. /*
  41. * ---------------------------------------------------------
  42. * Language
  43. * ---------------------------------------------------------
  44. *
  45. * Default application language and locale.
  46. */
  47. 'default_language' => ['strings' => 'en_US', 'locale' => [LC_ALL => ['en_US.UTF-8', 'en_US.utf8', 'C.UTF-8', 'C'], LC_NUMERIC => 'C']],
  48. /*
  49. * ---------------------------------------------------------
  50. * Languages
  51. * ---------------------------------------------------------
  52. *
  53. * If the first segment of the request path matches the language (array key)
  54. * then the default language will be set to the mapped language (array value).
  55. */
  56. 'languages' =>
  57. [
  58. //'no' => ['strings' => 'nb_NO', 'locale' => [LC_ALL => ['nb_NO.UTF-8', 'nb_NO.utf8', 'C.UTF-8', 'C'], LC_NUMERIC => 'C']],
  59. ],
  60. /*
  61. * ---------------------------------------------------------
  62. * Commands
  63. * ---------------------------------------------------------
  64. *
  65. * This is where you register your reactor commands.
  66. * You can either let the framework auto-detect and register the commands
  67. * for you or register them manually using the 'commands' array.
  68. *
  69. * To disable auto-detection just comment out the 'commands_directory' key.
  70. *
  71. * When using the 'commands' array the key is the command name and the array value
  72. * is the command class.
  73. */
  74. 'commands_directory' => MAKO_APPLICATION_PATH . '/console/commands',
  75. /*
  76. * ---------------------------------------------------------
  77. * Services
  78. * ---------------------------------------------------------
  79. *
  80. * Services to register in the dependecy injection container.
  81. * They will be registered in the order that they are defined.
  82. *
  83. * core: Services that are required for both the web an the command line interface
  84. * web : Services that are only required for the web
  85. * cli : Services that are only required for the command line interface
  86. */
  87. 'services' =>
  88. [
  89. 'core' =>
  90. [
  91. mako\application\services\SignerService::class,
  92. mako\application\services\HTTPService::class,
  93. //mako\application\services\LoggerService::class,
  94. mako\application\services\ViewFactoryService::class,
  95. //mako\application\services\SessionService::class,
  96. mako\application\services\DatabaseService::class,
  97. //mako\application\services\RedisService::class,
  98. //mako\application\services\I18nService::class,
  99. //mako\application\services\HumanizerService::class,
  100. //mako\application\services\CacheService::class,
  101. //mako\application\services\CryptoService::class,
  102. //mako\application\services\ValidatorFactoryService::class,
  103. //mako\application\services\PaginationFactoryService::class,
  104. //mako\application\services\GatekeeperService::class,
  105. //mako\application\services\EventService::class,
  106. //mako\application\services\CommandBusService::class,
  107. ],
  108. 'web' =>
  109. [
  110. mako\application\services\web\ErrorHandlerService::class,
  111. ],
  112. 'cli' =>
  113. [
  114. mako\application\services\cli\ErrorHandlerService::class,
  115. ],
  116. ],
  117. /*
  118. * ---------------------------------------------------------
  119. * Packages
  120. * ---------------------------------------------------------
  121. *
  122. * Packages to boot during the application boot sequence.
  123. * They will be booted in the order that they are defined.
  124. *
  125. * core: Packages that are required for both the web an the command line interface
  126. * web : Packages that are only required for the web
  127. * cli : Packages that are only required for the command line interface
  128. */
  129. 'packages' =>
  130. [
  131. 'core' =>
  132. [
  133. ],
  134. 'web' =>
  135. [
  136. ],
  137. 'cli' =>
  138. [
  139. ],
  140. ],
  141. /*
  142. * ---------------------------------------------------------
  143. * Storage path
  144. * ---------------------------------------------------------
  145. *
  146. * Application storage base path.
  147. */
  148. 'storage_path' => MAKO_APPLICATION_PATH . '/storage',
  149. /*
  150. * ---------------------------------------------------------
  151. * Secret
  152. * ---------------------------------------------------------
  153. *
  154. * The secret is used to provide cryptographic signing, and should be set to a unique, unpredictable value.
  155. * You should NOT use the secret included with the framework in a production environment!
  156. */
  157. 'secret' => 'hex:fef26e19745fb4d4f6183466fcde2288cc9a85a889babf437b0dfb1ef1b5364c',
  158. /*
  159. * ---------------------------------------------------------
  160. * Trusted proxies
  161. * ---------------------------------------------------------
  162. *
  163. * If your application isn't behind a proxy you trust then you can (and should) leave this empty.
  164. * If it is behind a proxy then you can help the framework return the correct client IP (using the X-Forwarded-For header)
  165. * by listing your proxy IP address(es) here.
  166. */
  167. 'trusted_proxies' =>
  168. [
  169. ],
  170. /*
  171. * ---------------------------------------------------------
  172. * Serialization whitelist.
  173. * ---------------------------------------------------------
  174. *
  175. * Array of classes that you'll allow the framework to deserialize.
  176. * Set to FALSE for none and TRUE for all.
  177. */
  178. 'deserialization_whitelist' => false,
  179. /*
  180. * ---------------------------------------------------------
  181. * Logger
  182. * ---------------------------------------------------------
  183. *
  184. * channel: Log channel name
  185. * handler: Log handler(s) to use. The avaiable options out of the box are 'ErrorLog', 'Stream' and 'Syslog'.
  186. * syslog : Syslog specific options (https://linux.die.net/man/3/syslog).
  187. */
  188. 'logger' =>
  189. [
  190. 'channel' => 'mako',
  191. 'handler' => ['Stream'],
  192. 'syslog' =>
  193. [
  194. 'identifier' => 'Mako',
  195. 'facility' => LOG_USER,
  196. ],
  197. ],
  198. /*
  199. * ---------------------------------------------------------
  200. * Error handling
  201. * ---------------------------------------------------------
  202. *
  203. * log_errors : Set to true if you want to log errors caught by the Mako errors handler.
  204. * display_errors : Set to true to display detailed information about errors caught by the mako error handlers.
  205. * keep : Specify a list of cookies or headers to keep when an exception has been handled.
  206. * dont_log : Array of exception types to ignore when logging errors.
  207. */
  208. 'error_handler' =>
  209. [
  210. 'log_errors' => true,
  211. 'display_errors' => true,
  212. 'keep' => [], // E.g. ['headers' => ['Access-Control-.*']]
  213. 'dont_log' =>
  214. [
  215. mako\http\exceptions\HttpStatusException::class,
  216. ],
  217. ],
  218. ];