app.php 16 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412
  1. <?php
  2. return [
  3. /**
  4. * Debug Level:
  5. *
  6. * Production Mode:
  7. * false: No error messages, errors, or warnings shown.
  8. *
  9. * Development Mode:
  10. * true: Errors and warnings shown.
  11. */
  12. 'debug' => filter_var(env('DEBUG', false), FILTER_VALIDATE_BOOLEAN),
  13. /**
  14. * Configure basic information about the application.
  15. *
  16. * - namespace - The namespace to find app classes under.
  17. * - defaultLocale - The default locale for translation, formatting currencies and numbers, date and time.
  18. * - encoding - The encoding used for HTML + database connections.
  19. * - base - The base directory the app resides in. If false this
  20. * will be auto detected.
  21. * - dir - Name of app directory.
  22. * - webroot - The webroot directory.
  23. * - wwwRoot - The file path to webroot.
  24. * - baseUrl - To configure CakePHP to *not* use mod_rewrite and to
  25. * use CakePHP pretty URLs, remove these .htaccess
  26. * files:
  27. * /.htaccess
  28. * /webroot/.htaccess
  29. * And uncomment the baseUrl key below.
  30. * - fullBaseUrl - A base URL to use for absolute links. When set to false (default)
  31. * CakePHP generates required value based on `HTTP_HOST` environment variable.
  32. * However, you can define it manually to optimize performance or if you
  33. * are concerned about people manipulating the `Host` header.
  34. * - imageBaseUrl - Web path to the public images directory under webroot.
  35. * - cssBaseUrl - Web path to the public css directory under webroot.
  36. * - jsBaseUrl - Web path to the public js directory under webroot.
  37. * - paths - Configure paths for non class based resources. Supports the
  38. * `plugins`, `templates`, `locales` subkeys, which allow the definition of
  39. * paths for plugins, view templates and locale files respectively.
  40. */
  41. 'App' => [
  42. 'namespace' => 'App',
  43. 'encoding' => env('APP_ENCODING', 'UTF-8'),
  44. 'defaultLocale' => env('APP_DEFAULT_LOCALE', 'en_US'),
  45. 'defaultTimezone' => env('APP_DEFAULT_TIMEZONE', 'UTC'),
  46. 'base' => dirname(__DIR__),
  47. 'dir' => 'src',
  48. 'webroot' => 'webroot',
  49. 'wwwRoot' => WWW_ROOT,
  50. //'baseUrl' => env('SCRIPT_NAME'),
  51. 'fullBaseUrl' => false,
  52. 'imageBaseUrl' => 'img/',
  53. 'cssBaseUrl' => 'css/',
  54. 'jsBaseUrl' => 'js/',
  55. 'paths' => [
  56. 'plugins' => [ROOT . DS . 'plugins' . DS],
  57. 'templates' => [ROOT . DS . 'templates' . DS],
  58. 'locales' => [RESOURCES . 'locales' . DS],
  59. ],
  60. ],
  61. /**
  62. * Security and encryption configuration
  63. *
  64. * - salt - A random string used in security hashing methods.
  65. * The salt value is also used as the encryption key.
  66. * You should treat it as extremely sensitive data.
  67. */
  68. 'Security' => [
  69. 'salt' => env('SECURITY_SALT', '__SALT__'),
  70. ],
  71. /**
  72. * Apply timestamps with the last modified time to static assets (js, css, images).
  73. * Will append a querystring parameter containing the time the file was modified.
  74. * This is useful for busting browser caches.
  75. *
  76. * Set to true to apply timestamps when debug is true. Set to 'force' to always
  77. * enable timestamping regardless of debug value.
  78. */
  79. 'Asset' => [
  80. //'timestamp' => true,
  81. // 'cacheTime' => '+1 year'
  82. ],
  83. /**
  84. * Configure the cache adapters.
  85. */
  86. 'Cache' => [
  87. 'default' => [
  88. 'className' => 'Cake\Cache\Engine\FileEngine',
  89. 'path' => CACHE,
  90. 'url' => env('CACHE_DEFAULT_URL', null),
  91. ],
  92. /**
  93. * Configure the cache used for general framework caching.
  94. * Translation cache files are stored with this configuration.
  95. * Duration will be set to '+2 minutes' in bootstrap.php when debug = true
  96. * If you set 'className' => 'Null' core cache will be disabled.
  97. */
  98. '_cake_core_' => [
  99. 'className' => 'Cake\Cache\Engine\FileEngine',
  100. 'prefix' => 'myapp_cake_core_',
  101. 'path' => CACHE . 'persistent/',
  102. 'serialize' => true,
  103. 'duration' => '+1 years',
  104. 'url' => env('CACHE_CAKECORE_URL', null),
  105. ],
  106. /**
  107. * Configure the cache for model and datasource caches. This cache
  108. * configuration is used to store schema descriptions, and table listings
  109. * in connections.
  110. * Duration will be set to '+2 minutes' in bootstrap.php when debug = true
  111. */
  112. '_cake_model_' => [
  113. 'className' => 'Cake\Cache\Engine\FileEngine',
  114. 'prefix' => 'myapp_cake_model_',
  115. 'path' => CACHE . 'models/',
  116. 'serialize' => true,
  117. 'duration' => '+1 years',
  118. 'url' => env('CACHE_CAKEMODEL_URL', null),
  119. ],
  120. /**
  121. * Configure the cache for routes. The cached routes collection is built the
  122. * first time the routes are processed via `config/routes.php`.
  123. * Duration will be set to '+2 seconds' in bootstrap.php when debug = true
  124. */
  125. '_cake_routes_' => [
  126. 'className' => 'Cake\Cache\Engine\FileEngine',
  127. 'prefix' => 'myapp_cake_routes_',
  128. 'path' => CACHE,
  129. 'serialize' => true,
  130. 'duration' => '+1 years',
  131. 'url' => env('CACHE_CAKEROUTES_URL', null),
  132. ],
  133. ],
  134. /**
  135. * Configure the Error and Exception handlers used by your application.
  136. *
  137. * By default errors are displayed using Debugger, when debug is true and logged
  138. * by Cake\Log\Log when debug is false.
  139. *
  140. * In CLI environments exceptions will be printed to stderr with a backtrace.
  141. * In web environments an HTML page will be displayed for the exception.
  142. * With debug true, framework errors like Missing Controller will be displayed.
  143. * When debug is false, framework errors will be coerced into generic HTTP errors.
  144. *
  145. * Options:
  146. *
  147. * - `errorLevel` - int - The level of errors you are interested in capturing.
  148. * - `trace` - boolean - Whether or not backtraces should be included in
  149. * logged errors/exceptions.
  150. * - `log` - boolean - Whether or not you want exceptions logged.
  151. * - `exceptionRenderer` - string - The class responsible for rendering
  152. * uncaught exceptions. If you choose a custom class you should place
  153. * the file for that class in src/Error. This class needs to implement a
  154. * render method.
  155. * - `skipLog` - array - List of exceptions to skip for logging. Exceptions that
  156. * extend one of the listed exceptions will also be skipped for logging.
  157. * E.g.:
  158. * `'skipLog' => ['Cake\Http\Exception\NotFoundException', 'Cake\Http\Exception\UnauthorizedException']`
  159. * - `extraFatalErrorMemory` - int - The number of megabytes to increase
  160. * the memory limit by when a fatal error is encountered. This allows
  161. * breathing room to complete logging or error handling.
  162. */
  163. 'Error' => [
  164. 'errorLevel' => E_ALL,
  165. 'skipLog' => [],
  166. 'log' => true,
  167. 'trace' => true,
  168. ],
  169. /**
  170. * Email configuration.
  171. *
  172. * By defining transports separately from delivery profiles you can easily
  173. * re-use transport configuration across multiple profiles.
  174. *
  175. * You can specify multiple configurations for production, development and
  176. * testing.
  177. *
  178. * Each transport needs a `className`. Valid options are as follows:
  179. *
  180. * Mail - Send using PHP mail function
  181. * Smtp - Send using SMTP
  182. * Debug - Do not send the email, just return the result
  183. *
  184. * You can add custom transports (or override existing transports) by adding the
  185. * appropriate file to src/Mailer/Transport. Transports should be named
  186. * 'YourTransport.php', where 'Your' is the name of the transport.
  187. */
  188. 'EmailTransport' => [
  189. 'default' => [
  190. 'className' => 'Cake\Mailer\Transport\MailTransport',
  191. /*
  192. * The following keys are used in SMTP transports:
  193. */
  194. 'host' => 'localhost',
  195. 'port' => 25,
  196. 'timeout' => 30,
  197. 'username' => null,
  198. 'password' => null,
  199. 'client' => null,
  200. 'tls' => null,
  201. 'url' => env('EMAIL_TRANSPORT_DEFAULT_URL', null),
  202. ],
  203. ],
  204. /**
  205. * Email delivery profiles
  206. *
  207. * Delivery profiles allow you to predefine various properties about email
  208. * messages from your application and give the settings a name. This saves
  209. * duplication across your application and makes maintenance and development
  210. * easier. Each profile accepts a number of keys. See `Cake\Mailer\Email`
  211. * for more information.
  212. */
  213. 'Email' => [
  214. 'default' => [
  215. 'transport' => 'default',
  216. 'from' => 'you@localhost',
  217. //'charset' => 'utf-8',
  218. //'headerCharset' => 'utf-8',
  219. ],
  220. ],
  221. /**
  222. * Connection information used by the ORM to connect
  223. * to your application's datastores.
  224. *
  225. * ### Notes
  226. * - Drivers include Mysql Postgres Sqlite Sqlserver
  227. * See vendor\cakephp\cakephp\src\Database\Driver for complete list
  228. * - Do not use periods in database name - it may lead to error.
  229. * See https://github.com/cakephp/cakephp/issues/6471 for details.
  230. * - 'encoding' is recommended to be set to full UTF-8 4-Byte support.
  231. * E.g set it to 'utf8mb4' in MariaDB and MySQL and 'utf8' for any
  232. * other RDBMS.
  233. */
  234. 'Datasources' => [
  235. 'default' => [
  236. 'className' => 'Cake\Database\Connection',
  237. 'driver' => 'Cake\Database\Driver\Mysql',
  238. 'persistent' => true,
  239. 'host' => 'tfb-database',
  240. /*
  241. * CakePHP will use the default DB port based on the driver selected
  242. * MySQL on MAMP uses port 8889, MAMP users will want to uncomment
  243. * the following line and set the port accordingly
  244. */
  245. //'port' => '3306',
  246. 'username' => 'benchmarkdbuser',
  247. 'password' => 'benchmarkdbpass',
  248. 'database' => 'hello_world',
  249. /*
  250. * You do not need to set this flag to use full utf-8 encoding (internal default since CakePHP 3.6).
  251. */
  252. //'encoding' => 'utf8mb4',
  253. 'timezone' => 'UTC',
  254. 'flags' => [],
  255. 'cacheMetadata' => true,
  256. 'log' => false,
  257. /**
  258. * Set identifier quoting to true if you are using reserved words or
  259. * special characters in your table or column names. Enabling this
  260. * setting will result in queries built using the Query Builder having
  261. * identifiers quoted when creating SQL. It should be noted that this
  262. * decreases performance because each query needs to be traversed and
  263. * manipulated before being executed.
  264. */
  265. 'quoteIdentifiers' => false,
  266. /**
  267. * During development, if using MySQL < 5.6, uncommenting the
  268. * following line could boost the speed at which schema metadata is
  269. * fetched from the database. It can also be set directly with the
  270. * mysql configuration directive 'innodb_stats_on_metadata = 0'
  271. * which is the recommended value in production environments
  272. */
  273. //'init' => ['SET GLOBAL innodb_stats_on_metadata = 0'],
  274. 'url' => env('DATABASE_URL', null),
  275. ],
  276. /**
  277. * The test connection is used during the test suite.
  278. */
  279. 'test' => [
  280. 'className' => 'Cake\Database\Connection',
  281. 'driver' => 'Cake\Database\Driver\Mysql',
  282. 'persistent' => true,
  283. 'host' => 'tfb-database',
  284. /*
  285. * CakePHP will use the default DB port based on the driver selected
  286. * MySQL on MAMP uses port 8889, MAMP users will want to uncomment
  287. * the following line and set the port accordingly
  288. */
  289. //'port' => '3306',
  290. 'username' => 'benchmarkdbuser',
  291. 'password' => 'benchmarkdbpass',
  292. 'database' => 'hello_world',
  293. /*
  294. * You do not need to set this flag to use full utf-8 encoding (internal default since CakePHP 3.6).
  295. */
  296. //'encoding' => 'utf8mb4',
  297. 'timezone' => 'UTC',
  298. 'flags' => [],
  299. 'cacheMetadata' => true,
  300. 'log' => false,
  301. /**
  302. * Set identifier quoting to true if you are using reserved words or
  303. * special characters in your table or column names. Enabling this
  304. * setting will result in queries built using the Query Builder having
  305. * identifiers quoted when creating SQL. It should be noted that this
  306. * decreases performance because each query needs to be traversed and
  307. * manipulated before being executed.
  308. */
  309. 'quoteIdentifiers' => false,
  310. /**
  311. * During development, if using MySQL < 5.6, uncommenting the
  312. * following line could boost the speed at which schema metadata is
  313. * fetched from the database. It can also be set directly with the
  314. * mysql configuration directive 'innodb_stats_on_metadata = 0'
  315. * which is the recommended value in production environments
  316. */
  317. //'init' => ['SET GLOBAL innodb_stats_on_metadata = 0'],
  318. 'url' => env('DATABASE_URL', null),
  319. ],
  320. ],
  321. /**
  322. * Configures logging options
  323. */
  324. 'Log' => [
  325. 'debug' => [
  326. 'className' => 'Cake\Log\Engine\NullEngine',
  327. 'path' => LOGS,
  328. 'file' => 'debug',
  329. 'url' => env('LOG_DEBUG_URL', null),
  330. 'scopes' => false,
  331. 'levels' => ['emergency'],
  332. ],
  333. 'error' => [
  334. 'className' => 'Cake\Log\Engine\NullEngine',
  335. 'path' => LOGS,
  336. 'file' => 'error',
  337. 'url' => env('LOG_ERROR_URL', null),
  338. 'scopes' => false,
  339. 'levels' => ['emergency'],
  340. ],
  341. // To enable this dedicated query log, you need set your datasource's log flag to true
  342. 'queries' => [
  343. 'className' => 'Cake\Log\Engine\NullEngine',
  344. 'path' => LOGS,
  345. 'file' => 'queries',
  346. 'url' => env('LOG_QUERIES_URL', null),
  347. 'scopes' => ['queriesLog'],
  348. ],
  349. ],
  350. /**
  351. * Session configuration.
  352. *
  353. * Contains an array of settings to use for session configuration. The
  354. * `defaults` key is used to define a default preset to use for sessions, any
  355. * settings declared here will override the settings of the default config.
  356. *
  357. * ## Options
  358. *
  359. * - `cookie` - The name of the cookie to use. Defaults to 'CAKEPHP'. Avoid using `.` in cookie names,
  360. * as PHP will drop sessions from cookies with `.` in the name.
  361. * - `cookiePath` - The url path for which session cookie is set. Maps to the
  362. * `session.cookie_path` php.ini config. Defaults to base path of app.
  363. * - `timeout` - The time in minutes the session should be valid for.
  364. * Pass 0 to disable checking timeout.
  365. * Please note that php.ini's session.gc_maxlifetime must be equal to or greater
  366. * than the largest Session['timeout'] in all served websites for it to have the
  367. * desired effect.
  368. * - `defaults` - The default configuration set to use as a basis for your session.
  369. * There are four built-in options: php, cake, cache, database.
  370. * - `handler` - Can be used to enable a custom session handler. Expects an
  371. * array with at least the `engine` key, being the name of the Session engine
  372. * class to use for managing the session. CakePHP bundles the `CacheSession`
  373. * and `DatabaseSession` engines.
  374. * - `ini` - An associative array of additional ini values to set.
  375. *
  376. * The built-in `defaults` options are:
  377. *
  378. * - 'php' - Uses settings defined in your php.ini.
  379. * - 'cake' - Saves session files in CakePHP's /tmp directory.
  380. * - 'database' - Uses CakePHP's database sessions.
  381. * - 'cache' - Use the Cache class to save sessions.
  382. *
  383. * To define a custom session handler, save it at src/Network/Session/<name>.php.
  384. * Make sure the class implements PHP's `SessionHandlerInterface` and set
  385. * Session.handler to <name>
  386. *
  387. * To use database sessions, load the SQL file located at config/schema/sessions.sql
  388. */
  389. 'Session' => [
  390. 'defaults' => 'php',
  391. ],
  392. ];