Nie możesz wybrać więcej, niż 25 tematów Tematy muszą się zaczynać od litery lub cyfry, mogą zawierać myślniki ('-') i mogą mieć do 35 znaków.

514 wiersze
21KB

  1. <?php
  2. use Cake\Cache\Engine\FileEngine;
  3. use Cake\Database\Connection;
  4. use Cake\Database\Driver\Mysql;
  5. use Cake\Log\Engine\FileLog;
  6. use Cake\Mailer\Transport\MailTransport;
  7. use Geo\Geocoder\Geocoder;
  8. use function Cake\Core\env;
  9. return [
  10. /*
  11. * Debug Level:
  12. *
  13. * Production Mode:
  14. * false: No error messages, errors, or warnings shown.
  15. *
  16. * Development Mode:
  17. * true: Errors and warnings shown.
  18. */
  19. 'debug' => filter_var(env('DEBUG', false), FILTER_VALIDATE_BOOLEAN),
  20. /*
  21. * Configure basic information about the application.
  22. *
  23. * - namespace - The namespace to find app classes under.
  24. * - defaultLocale - The default locale for translation, formatting currencies and numbers, date and time.
  25. * - encoding - The encoding used for HTML + database connections.
  26. * - base - The base directory the app resides in. If false this
  27. * will be auto-detected.
  28. * - dir - Name of app directory.
  29. * - webroot - The webroot directory.
  30. * - wwwRoot - The file path to webroot.
  31. * - baseUrl - To configure CakePHP to *not* use mod_rewrite and to
  32. * use CakePHP pretty URLs, remove these .htaccess
  33. * files:
  34. * /.htaccess
  35. * /webroot/.htaccess
  36. * And uncomment the baseUrl key below.
  37. * - fullBaseUrl - SECURITY: A base URL to use for absolute links.
  38. * IMPORTANT: This MUST be set in production to prevent Host Header Injection attacks
  39. * that can compromise password reset and other security-critical features.
  40. * Set this via APP_FULL_BASE_URL environment variable or directly in config.
  41. * Example: 'https://example.com'
  42. * When not set, the application will throw an exception in production mode.
  43. * - imageBaseUrl - Web path to the public images/ directory under webroot.
  44. * - cssBaseUrl - Web path to the public css/ directory under webroot.
  45. * - jsBaseUrl - Web path to the public js/ directory under webroot.
  46. * - paths - Configure paths for non class-based resources. Supports the
  47. * `plugins`, `templates`, `locales` subkeys, which allow the definition of
  48. * paths for plugins, view templates and locale files respectively.
  49. */
  50. 'App' => [
  51. 'namespace' => 'App',
  52. 'encoding' => env('APP_ENCODING', 'UTF-8'),
  53. 'defaultLocale' => env('APP_DEFAULT_LOCALE', 'en_US'),
  54. 'defaultTimezone' => env('APP_DEFAULT_TIMEZONE', 'UTC'),
  55. 'base' => false,
  56. 'dir' => 'src',
  57. 'webroot' => 'webroot',
  58. 'wwwRoot' => WWW_ROOT,
  59. //'baseUrl' => env('SCRIPT_NAME'),
  60. 'fullBaseUrl' => env('APP_FULL_BASE_URL', false),
  61. 'imageBaseUrl' => 'img/',
  62. 'cssBaseUrl' => 'css/',
  63. 'jsBaseUrl' => 'js/',
  64. 'paths' => [
  65. 'plugins' => [ROOT . DS . 'plugins' . DS],
  66. 'templates' => [ROOT . DS . 'templates' . DS],
  67. 'locales' => [RESOURCES . 'locales' . DS],
  68. ],
  69. ],
  70. /*
  71. * Security and encryption configuration
  72. *
  73. * - salt - A random string used in security hashing methods.
  74. * The salt value is also used as the encryption key.
  75. * You should treat it as extremely sensitive data.
  76. */
  77. 'Security' => [
  78. 'salt' => env('SECURITY_SALT'),
  79. ],
  80. /*
  81. * Apply timestamps with the last modified time to static assets (js, css, images).
  82. * Will append a querystring parameter containing the time the file was modified.
  83. * This is useful for busting browser caches.
  84. *
  85. * Set to true to apply timestamps when debug is true. Set to 'force' to always
  86. * enable timestamping regardless of debug value.
  87. */
  88. 'Asset' => [
  89. //'timestamp' => true,
  90. // 'cacheTime' => '+1 year'
  91. ],
  92. /*
  93. * Configure the cache adapters.
  94. */
  95. 'Cache' => [
  96. 'default' => [
  97. 'className' => FileEngine::class,
  98. 'path' => CACHE,
  99. 'url' => env('CACHE_DEFAULT_URL', null),
  100. ],
  101. /*
  102. * Configure the cache used for general framework caching.
  103. * Translation cache files are stored with this configuration.
  104. * Duration will be set to '+2 minutes' in bootstrap.php when debug = true
  105. * If you set 'className' => 'Null' core cache will be disabled.
  106. */
  107. '_cake_translations_' => [
  108. 'className' => FileEngine::class,
  109. 'prefix' => 'myapp_cake_translations_',
  110. 'path' => CACHE . 'persistent' . DS,
  111. 'serialize' => true,
  112. 'duration' => '+1 years',
  113. 'url' => env('CACHE_CAKECORE_URL', null),
  114. ],
  115. /*
  116. * Configure the cache for model and datasource caches. This cache
  117. * configuration is used to store schema descriptions, and table listings
  118. * in connections.
  119. * Duration will be set to '+2 minutes' in bootstrap.php when debug = true
  120. */
  121. '_cake_model_' => [
  122. 'className' => FileEngine::class,
  123. 'prefix' => 'myapp_cake_model_',
  124. 'path' => CACHE . 'models' . DS,
  125. 'serialize' => true,
  126. 'duration' => '+1 years',
  127. 'url' => env('CACHE_CAKEMODEL_URL', null),
  128. ],
  129. ],
  130. /*
  131. * Configure the Error and Exception handlers used by your application.
  132. *
  133. * By default errors are displayed using Debugger, when debug is true and logged
  134. * by Cake\Log\Log when debug is false.
  135. *
  136. * In CLI environments exceptions will be printed to stderr with a backtrace.
  137. * In web environments an HTML page will be displayed for the exception.
  138. * With debug true, framework errors like Missing Controller will be displayed.
  139. * When debug is false, framework errors will be coerced into generic HTTP errors.
  140. *
  141. * Options:
  142. *
  143. * - `errorLevel` - int - The level of errors you are interested in capturing.
  144. * - `trace` - boolean - Whether backtraces should be included in
  145. * logged errors/exceptions.
  146. * - `log` - boolean - Whether you want exceptions logged.
  147. * - `exceptionRenderer` - string - The class responsible for rendering uncaught exceptions.
  148. * The chosen class will be used for both CLI and web environments. If you want different
  149. * classes used in CLI and web environments you'll need to write that conditional logic as well.
  150. * The conventional location for custom renderers is in `src/Error`. Your exception renderer needs to
  151. * implement the `render()` method and return either a string or Http\Response.
  152. * `errorRenderer` - string - The class responsible for rendering PHP errors. The selected
  153. * class will be used for both web and CLI contexts. If you want different classes for each environment
  154. * you'll need to write that conditional logic as well. Error renderers need to
  155. * to implement the `Cake\Error\ErrorRendererInterface`.
  156. * - `skipLog` - array - List of exceptions to skip for logging. Exceptions that
  157. * extend one of the listed exceptions will also be skipped for logging.
  158. * E.g.:
  159. * `'skipLog' => ['Cake\Http\Exception\NotFoundException', 'Cake\Http\Exception\UnauthorizedException']`
  160. * - `extraFatalErrorMemory` - int - The number of megabytes to increase the memory limit by
  161. * when a fatal error is encountered. This allows
  162. * breathing room to complete logging or error handling.
  163. * - `ignoredDeprecationPaths` - array - A list of glob-compatible file paths that deprecations
  164. * should be ignored in. Use this to ignore deprecations for plugins or parts of
  165. * your application that still emits deprecations.
  166. * - `traceFormat` - when logging errors, List of `'array'`, `'points'`, `'shortPoints'`, defaults to `shortPoints`.
  167. */
  168. 'Error' => [
  169. 'errorLevel' => E_ALL,
  170. 'skipLog' => [],
  171. 'log' => true,
  172. 'trace' => true,
  173. 'ignoredDeprecationPaths' => [],
  174. 'traceFormat' => null,
  175. ],
  176. /*
  177. * Debugger configuration
  178. *
  179. * Define development error values for Cake\Error\Debugger
  180. *
  181. * - `editor` Set the editor URL format you want to use.
  182. * By default atom, emacs, macvim, phpstorm, sublime, textmate, and vscode are
  183. * available. You can add additional editor link formats using
  184. * `Debugger::addEditor()` during your application bootstrap.
  185. * - `editorBasePath` - The base path to your project for editor integration.
  186. * Used to generate file links in stack traces.
  187. * - `outputMask` A mapping of `key` to `replacement` values that
  188. * `Debugger` should replace in dumped data and logs generated by `Debugger`.
  189. */
  190. 'Debugger' => [
  191. 'editor' => 'phpstorm',
  192. ],
  193. /*
  194. * Email configuration.
  195. *
  196. * By defining transports separately from delivery profiles you can easily
  197. * re-use transport configuration across multiple profiles.
  198. *
  199. * You can specify multiple configurations for production, development and
  200. * testing.
  201. *
  202. * Each transport needs a `className`. Valid options are as follows:
  203. *
  204. * Mail - Send using PHP mail function
  205. * Smtp - Send using SMTP
  206. * Debug - Do not send the email, just return the result
  207. *
  208. * You can add custom transports (or override existing transports) by adding the
  209. * appropriate file to src/Mailer/Transport. Transports should be named
  210. * 'YourTransport.php', where 'Your' is the name of the transport.
  211. */
  212. 'EmailTransport' => [
  213. 'default' => [
  214. 'className' => MailTransport::class,
  215. /*
  216. * The keys host, port, timeout, username, password, client and tls
  217. * are used in SMTP transports
  218. */
  219. 'host' => 'localhost',
  220. 'port' => 25,
  221. 'timeout' => 30,
  222. /*
  223. * It is recommended to set these options through your environment or app_local.php
  224. */
  225. //'username' => null,
  226. //'password' => null,
  227. 'client' => null,
  228. 'tls' => false,
  229. 'url' => env('EMAIL_TRANSPORT_DEFAULT_URL', null),
  230. ],
  231. ],
  232. /*
  233. * Email delivery profiles
  234. *
  235. * Delivery profiles allow you to predefine various properties about email
  236. * messages from your application and give the settings a name. This saves
  237. * duplication across your application and makes maintenance and development
  238. * easier. Each profile accepts a number of keys. See `Cake\Mailer\Mailer`
  239. * for more information.
  240. */
  241. 'Email' => [
  242. 'default' => [
  243. 'transport' => 'default',
  244. 'from' => 'you@localhost',
  245. /*
  246. * Will by default be set to config value of App.encoding, if that exists otherwise to UTF-8.
  247. */
  248. //'charset' => 'utf-8',
  249. //'headerCharset' => 'utf-8',
  250. ],
  251. ],
  252. /*
  253. * Connection information used by the ORM to connect
  254. * to your application's datastores.
  255. *
  256. * ### Notes
  257. * - Drivers include Mysql Postgres Sqlite Sqlserver
  258. * See vendor\cakephp\cakephp\src\Database\Driver for the complete list
  259. * - Do not use periods in database name - it may lead to errors.
  260. * See https://github.com/cakephp/cakephp/issues/6471 for details.
  261. * - 'encoding' is recommended to be set to full UTF-8 4-Byte support.
  262. * E.g set it to 'utf8mb4' in MariaDB and MySQL and 'utf8' for any
  263. * other RDBMS.
  264. */
  265. 'Datasources' => [
  266. /*
  267. * These configurations should contain permanent settings used
  268. * by all environments.
  269. *
  270. * The values in app_local.php will override any values set here
  271. * and should be used for local and per-environment configurations.
  272. *
  273. * Environment variable-based configurations can be loaded here or
  274. * in app_local.php depending on the application's needs.
  275. */
  276. 'default' => [
  277. 'className' => Connection::class,
  278. 'driver' => Mysql::class,
  279. 'persistent' => false,
  280. 'timezone' => 'UTC',
  281. /*
  282. * For MariaDB/MySQL the internal default changed from utf8 to utf8mb4, aka full utf-8 support
  283. */
  284. 'encoding' => 'utf8mb4',
  285. /*
  286. * If your MySQL server is configured with `skip-character-set-client-handshake`
  287. * then you MUST use the `flags` config to set your charset encoding.
  288. * For e.g. `'flags' => [\PDO::MYSQL_ATTR_INIT_COMMAND => 'SET NAMES utf8mb4']`
  289. */
  290. 'flags' => [],
  291. 'cacheMetadata' => true,
  292. 'log' => false,
  293. /*
  294. * Set identifier quoting to true if you are using reserved words or
  295. * special characters in your table or column names. Enabling this
  296. * setting will result in queries built using the Query Builder having
  297. * identifiers quoted when creating SQL. It should be noted that this
  298. * decreases performance because each query needs to be traversed and
  299. * manipulated before being executed.
  300. */
  301. 'quoteIdentifiers' => false,
  302. /*
  303. * During development, if using MySQL < 5.6, uncommenting the
  304. * following line could boost the speed at which schema metadata is
  305. * fetched from the database. It can also be set directly with the
  306. * mysql configuration directive 'innodb_stats_on_metadata = 0'
  307. * which is the recommended value in production environments
  308. */
  309. //'init' => ['SET GLOBAL innodb_stats_on_metadata = 0'],
  310. ],
  311. /*
  312. * The test connection is used during the test suite.
  313. */
  314. 'test' => [
  315. 'className' => Connection::class,
  316. 'driver' => Mysql::class,
  317. 'persistent' => false,
  318. 'timezone' => 'UTC',
  319. 'encoding' => 'utf8mb4',
  320. 'flags' => [],
  321. 'cacheMetadata' => true,
  322. 'quoteIdentifiers' => false,
  323. 'log' => false,
  324. //'init' => ['SET GLOBAL innodb_stats_on_metadata = 0'],
  325. ],
  326. ],
  327. /*
  328. * Configures logging options
  329. */
  330. 'Log' => [
  331. 'debug' => [
  332. 'className' => FileLog::class,
  333. 'path' => LOGS,
  334. 'file' => 'debug',
  335. 'url' => env('LOG_DEBUG_URL', null),
  336. 'scopes' => null,
  337. 'levels' => ['notice', 'info', 'debug'],
  338. ],
  339. 'error' => [
  340. 'className' => FileLog::class,
  341. 'path' => LOGS,
  342. 'file' => 'error',
  343. 'url' => env('LOG_ERROR_URL', null),
  344. 'scopes' => null,
  345. 'levels' => ['warning', 'error', 'critical', 'alert', 'emergency'],
  346. ],
  347. // To enable this dedicated query log, you need to set your datasource's log flag to true
  348. 'queries' => [
  349. 'className' => FileLog::class,
  350. 'path' => LOGS,
  351. 'file' => 'queries',
  352. 'url' => env('LOG_QUERIES_URL', null),
  353. 'scopes' => ['cake.database.queries'],
  354. ],
  355. ],
  356. /*
  357. * Session configuration.
  358. *
  359. * Contains an array of settings to use for session configuration. The
  360. * `defaults` key is used to define a default preset to use for sessions, any
  361. * settings declared here will override the settings of the default config.
  362. *
  363. * ## Options
  364. *
  365. * - `cookie` - The name of the cookie to use. Defaults to value set for `session.name` php.ini config.
  366. * Avoid using `.` in cookie names, as PHP will drop sessions from cookies with `.` in the name.
  367. * - `cookiePath` - The url path for which session cookie is set. Maps to the
  368. * `session.cookie_path` php.ini config. Defaults to base path of app.
  369. * - `timeout` - The time in minutes a session can be 'idle'. If no request is received in
  370. * this duration, the session will be expired and rotated. Pass 0 to disable idle timeout checks.
  371. * - `defaults` - The default configuration set to use as a basis for your session.
  372. * There are four built-in options: php, cake, cache, database.
  373. * - `handler` - Can be used to enable a custom session handler. Expects an
  374. * array with at least the `engine` key, being the name of the Session engine
  375. * class to use for managing the session. CakePHP bundles the `CacheSession`
  376. * and `DatabaseSession` engines.
  377. * - `ini` - An associative array of additional 'session.*` ini values to set.
  378. *
  379. * Within the `ini` key, you will likely want to define:
  380. *
  381. * - `session.cookie_lifetime` - The number of seconds that cookies are valid for. This
  382. * should be longer than `Session.timeout`.
  383. * - `session.gc_maxlifetime` - The number of seconds after which a session is considered 'garbage'
  384. * that can be deleted by PHP's session cleanup behavior. This value should be greater than both
  385. * `Sesssion.timeout` and `session.cookie_lifetime`.
  386. *
  387. * The built-in `defaults` options are:
  388. *
  389. * - 'php' - Uses settings defined in your php.ini.
  390. * - 'cake' - Saves session files in CakePHP's /tmp directory.
  391. * - 'database' - Uses CakePHP's database sessions.
  392. * - 'cache' - Use the Cache class to save sessions.
  393. *
  394. * To define a custom session handler, save it at src/Http/Session/<name>.php.
  395. * Make sure the class implements PHP's `SessionHandlerInterface` and set
  396. * Session.handler to <name>
  397. *
  398. * To use database sessions, load the SQL file located at config/schema/sessions.sql
  399. */
  400. 'Session' => [
  401. 'defaults' => 'php',
  402. ],
  403. /**
  404. * DebugKit configuration.
  405. *
  406. * Contains an array of configurations to apply to the DebugKit plugin, if loaded.
  407. * Documentation: https://book.cakephp.org/debugkit/5/en/index.html#configuration
  408. *
  409. * ## Options
  410. *
  411. * - `panels` - Enable or disable panels. The key is the panel name, and the value is true to enable,
  412. * or false to disable.
  413. * - `includeSchemaReflection` - Set to true to enable logging of schema reflection queries. Disabled by default.
  414. * - `safeTld` - Set an array of whitelisted TLDs for local development.
  415. * - `forceEnable` - Force DebugKit to display. Careful with this, it is usually safer to simply whitelist
  416. * your local TLDs.
  417. * - `ignorePathsPattern` - Regex pattern (including delimiter) to ignore paths.
  418. * DebugKit won’t save data for request URLs that match this regex.
  419. * - `ignoreAuthorization` - Set to true to ignore Cake Authorization plugin for DebugKit requests.
  420. * Disabled by default.
  421. * - `maxDepth` - Defines how many levels of nested data should be shown in general for debug output.
  422. * Default is 5. WARNING: Increasing the max depth level can lead to an out of memory error.
  423. * - `variablesPanelMaxDepth` - Defines how many levels of nested data should be shown in the variables tab.
  424. * Default is 5. WARNING: Increasing the max depth level can lead to an out of memory error.
  425. */
  426. 'DebugKit' => [
  427. 'forceEnable' => filter_var(env('DEBUG_KIT_FORCE_ENABLE', false), FILTER_VALIDATE_BOOLEAN),
  428. 'safeTld' => env('DEBUG_KIT_SAFE_TLD', null),
  429. 'ignoreAuthorization' => env('DEBUG_KIT_IGNORE_AUTHORIZATION', false),
  430. ],
  431. /**
  432. * TestSuite configuration.
  433. *
  434. * ## Options
  435. *
  436. * - `errorLevel` - Defaults to `E_ALL`. Can be set to `false` to disable overwrite error level.
  437. * - `fixtureStrategy` - Defaults to TruncateStrategy. Can be set to any class implementing FixtureStrategyInterface.
  438. */
  439. 'TestSuite' => [
  440. 'errorLevel' => null,
  441. 'fixtureStrategy' => null,
  442. ],
  443. /*
  444. * Sub-applications listed in the site header's app switcher.
  445. * Each entry needs a `label` and a `url` (anything Html->link()'s `url` accepts).
  446. */
  447. 'Apps' => [
  448. ['label' => 'Home', 'url' => '/'],
  449. ],
  450. /*
  451. * CakePHP Geo plugin: geocoder configuration.
  452. * Address <-> lat/lng geocoding goes through Google Maps.
  453. * Requires a Google Cloud API key with the Geocoding API enabled,
  454. * set via the GOOGLE_MAPS_API_KEY environment variable.
  455. */
  456. 'Geocoder' => [
  457. 'provider' => Geocoder::PROVIDER_GOOGLE,
  458. 'google' => [
  459. 'apiKey' => env('GOOGLE_MAPS_API_KEY', ''),
  460. 'locale' => 'en',
  461. ],
  462. ],
  463. /*
  464. * LeafletHelper configuration: map tiles are served by MapTiler.
  465. * Requires an API key, set via the MAPTILER_API_KEY environment variable.
  466. * See https://cloud.maptiler.com/maps/ for available style/map IDs.
  467. */
  468. 'Leaflet' => [
  469. // Default center: Grand Rapids, MI
  470. 'lat' => 42.9634,
  471. 'lng' => -85.6681,
  472. 'zoom' => 12,
  473. 'map' => [
  474. 'defaultLat' => 42.9634,
  475. 'defaultLng' => -85.6681,
  476. 'defaultZoom' => 12,
  477. ],
  478. 'tileLayer' => [
  479. 'url' => 'https://api.maptiler.com/maps/streets-v2/{z}/{x}/{y}.png?key=' . env('MAPTILER_API_KEY', ''),
  480. 'options' => [
  481. 'attribution' => '<a href="https://www.maptiler.com/copyright/" target="_blank">&copy; MapTiler</a> '
  482. . '<a href="https://www.openstreetmap.org/copyright" target="_blank">&copy; OpenStreetMap contributors</a>',
  483. 'maxZoom' => 20,
  484. ],
  485. ],
  486. 'autoScript' => true,
  487. ],
  488. ];

Powered by TurnKey Linux.