|
1 | 1 | <?php |
2 | 2 |
|
3 | | -declare(strict_types=1); |
4 | | - |
5 | 3 | use Cake\Cache\Engine\FileEngine; |
6 | 4 | use Cake\Database\Connection; |
7 | 5 | use Cake\Database\Driver\Mysql; |
8 | | -use Cake\Error\ExceptionRenderer; |
9 | 6 | use Cake\Log\Engine\FileLog; |
10 | 7 | use Cake\Mailer\Transport\MailTransport; |
11 | | - |
12 | 8 | use function Cake\Core\env; |
13 | 9 |
|
14 | 10 | return [ |
|
21 | 17 | * Development Mode: |
22 | 18 | * true: Errors and warnings shown. |
23 | 19 | */ |
24 | | - 'debug' => true, //filter_var(env('DEBUG', false), FILTER_VALIDATE_BOOLEAN), |
| 20 | + 'debug' => filter_var(env('DEBUG', false), FILTER_VALIDATE_BOOLEAN), |
25 | 21 |
|
26 | 22 | /* |
27 | 23 | * Configure basic information about the application. |
|
30 | 26 | * - defaultLocale - The default locale for translation, formatting currencies and numbers, date and time. |
31 | 27 | * - encoding - The encoding used for HTML + database connections. |
32 | 28 | * - base - The base directory the app resides in. If false this |
33 | | - * will be auto detected. |
| 29 | + * will be auto-detected. |
34 | 30 | * - dir - Name of app directory. |
35 | 31 | * - webroot - The webroot directory. |
36 | 32 | * - wwwRoot - The file path to webroot. |
|
44 | 40 | * CakePHP generates required value based on `HTTP_HOST` environment variable. |
45 | 41 | * However, you can define it manually to optimize performance or if you |
46 | 42 | * are concerned about people manipulating the `Host` header. |
47 | | - * - imageBaseUrl - Web path to the public images directory under webroot. |
48 | | - * - cssBaseUrl - Web path to the public css directory under webroot. |
49 | | - * - jsBaseUrl - Web path to the public js directory under webroot. |
50 | | - * - paths - Configure paths for non class based resources. Supports the |
| 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 |
51 | 47 | * `plugins`, `templates`, `locales` subkeys, which allow the definition of |
52 | 48 | * paths for plugins, view templates and locale files respectively. |
53 | 49 | */ |
|
112 | 108 | * Duration will be set to '+2 minutes' in bootstrap.php when debug = true |
113 | 109 | * If you set 'className' => 'Null' core cache will be disabled. |
114 | 110 | */ |
115 | | - '_cake_core_' => [ |
| 111 | + '_cake_translations_' => [ |
116 | 112 | 'className' => FileEngine::class, |
117 | | - 'prefix' => 'myapp_cake_core_', |
| 113 | + 'prefix' => 'myapp_cake_translations_', |
118 | 114 | 'path' => CACHE . 'persistent' . DS, |
119 | 115 | 'serialize' => true, |
120 | 116 | 'duration' => '+1 years', |
|
135 | 131 | 'duration' => '+1 years', |
136 | 132 | 'url' => env('CACHE_CAKEMODEL_URL', null), |
137 | 133 | ], |
138 | | - |
139 | | - /* |
140 | | - * Configure the cache for routes. The cached routes collection is built the |
141 | | - * first time the routes are processed through `config/routes.php`. |
142 | | - * Duration will be set to '+2 seconds' in bootstrap.php when debug = true |
143 | | - */ |
144 | | - '_cake_routes_' => [ |
145 | | - 'className' => FileEngine::class, |
146 | | - 'prefix' => 'myapp_cake_routes_', |
147 | | - 'path' => CACHE, |
148 | | - 'serialize' => true, |
149 | | - 'duration' => '+1 years', |
150 | | - 'url' => env('CACHE_CAKEROUTES_URL', null), |
151 | | - ], |
152 | 134 | ], |
153 | 135 |
|
154 | 136 | /* |
|
165 | 147 | * Options: |
166 | 148 | * |
167 | 149 | * - `errorLevel` - int - The level of errors you are interested in capturing. |
168 | | - * - `trace` - boolean - Whether or not backtraces should be included in |
| 150 | + * - `trace` - boolean - Whether backtraces should be included in |
169 | 151 | * logged errors/exceptions. |
170 | | - * - `log` - boolean - Whether or not you want exceptions logged. |
171 | | - * - `exceptionRenderer` - string - The class responsible for rendering |
172 | | - * uncaught exceptions. If you choose a custom class you should place |
173 | | - * the file for that class in src/Error. This class needs to implement a |
174 | | - * render method. |
| 152 | + * - `log` - boolean - Whether you want exceptions logged. |
| 153 | + * - `exceptionRenderer` - string - The class responsible for rendering uncaught exceptions. |
| 154 | + * The chosen class will be used for both CLI and web environments. If you want different |
| 155 | + * classes used in CLI and web environments you'll need to write that conditional logic as well. |
| 156 | + * The conventional location for custom renderers is in `src/Error`. Your exception renderer needs to |
| 157 | + * implement the `render()` method and return either a string or Http\Response. |
| 158 | + * `errorRenderer` - string - The class responsible for rendering PHP errors. The selected |
| 159 | + * class will be used for both web and CLI contexts. If you want different classes for each environment |
| 160 | + * you'll need to write that conditional logic as well. Error renderers need to |
| 161 | + * to implement the `Cake\Error\ErrorRendererInterface`. |
175 | 162 | * - `skipLog` - array - List of exceptions to skip for logging. Exceptions that |
176 | 163 | * extend one of the listed exceptions will also be skipped for logging. |
177 | 164 | * E.g.: |
178 | 165 | * `'skipLog' => ['Cake\Http\Exception\NotFoundException', 'Cake\Http\Exception\UnauthorizedException']` |
179 | | - * - `extraFatalErrorMemory` - int - The number of megabytes to increase |
180 | | - * the memory limit by when a fatal error is encountered. This allows |
| 166 | + * - `extraFatalErrorMemory` - int - The number of megabytes to increase the memory limit by |
| 167 | + * when a fatal error is encountered. This allows |
181 | 168 | * breathing room to complete logging or error handling. |
| 169 | + * - `ignoredDeprecationPaths` - array - A list of glob-compatible file paths that deprecations |
| 170 | + * should be ignored in. Use this to ignore deprecations for plugins or parts of |
| 171 | + * your application that still emit deprecations. |
182 | 172 | */ |
183 | 173 | 'Error' => [ |
184 | 174 | 'errorLevel' => E_ALL, |
185 | | - 'exceptionRenderer' => ExceptionRenderer::class, |
186 | | - 'skipLog' => [ |
187 | | - 'Cake\Http\Exception\NotFoundException', |
188 | | - ], |
| 175 | + 'skipLog' => [], |
189 | 176 | 'log' => true, |
190 | 177 | 'trace' => true, |
| 178 | + 'ignoredDeprecationPaths' => [], |
| 179 | + ], |
| 180 | + |
| 181 | + /* |
| 182 | + * Debugger configuration |
| 183 | + * |
| 184 | + * Define development error values for Cake\Error\Debugger |
| 185 | + * |
| 186 | + * - `editor` Set the editor URL format you want to use. |
| 187 | + * By default atom, emacs, macvim, phpstorm, sublime, textmate, and vscode are |
| 188 | + * available. You can add additional editor link formats using |
| 189 | + * `Debugger::addEditor()` during your application bootstrap. |
| 190 | + * - `outputMask` A mapping of `key` to `replacement` values that |
| 191 | + * `Debugger` should replace in dumped data and logs generated by `Debugger`. |
| 192 | + */ |
| 193 | + 'Debugger' => [ |
| 194 | + 'editor' => 'phpstorm', |
191 | 195 | ], |
192 | 196 |
|
193 | 197 | /* |
|
236 | 240 | * Delivery profiles allow you to predefine various properties about email |
237 | 241 | * messages from your application and give the settings a name. This saves |
238 | 242 | * duplication across your application and makes maintenance and development |
239 | | - * easier. Each profile accepts a number of keys. See `Cake\Mailer\Email` |
| 243 | + * easier. Each profile accepts a number of keys. See `Cake\Mailer\Mailer` |
240 | 244 | * for more information. |
241 | 245 | */ |
242 | 246 | 'Email' => [ |
|
257 | 261 | * |
258 | 262 | * ### Notes |
259 | 263 | * - Drivers include Mysql Postgres Sqlite Sqlserver |
260 | | - * See vendor\cakephp\cakephp\src\Database\Driver for complete list |
261 | | - * - Do not use periods in database name - it may lead to error. |
| 264 | + * See vendor\cakephp\cakephp\src\Database\Driver for the complete list |
| 265 | + * - Do not use periods in database name - it may lead to errors. |
262 | 266 | * See https://github.com/cakephp/cakephp/issues/6471 for details. |
263 | 267 | * - 'encoding' is recommended to be set to full UTF-8 4-Byte support. |
264 | 268 | * E.g set it to 'utf8mb4' in MariaDB and MySQL and 'utf8' for any |
265 | 269 | * other RDBMS. |
266 | 270 | */ |
267 | 271 | 'Datasources' => [ |
268 | | - /** |
| 272 | + /* |
269 | 273 | * These configurations should contain permanent settings used |
270 | 274 | * by all environments. |
271 | 275 | * |
272 | 276 | * The values in app_local.php will override any values set here |
273 | 277 | * and should be used for local and per-environment configurations. |
274 | 278 | * |
275 | | - * Environment variable based configurations can be loaded here or |
276 | | - * in app_local.php depending on the applications needs. |
| 279 | + * Environment variable-based configurations can be loaded here or |
| 280 | + * in app_local.php depending on the application's needs. |
277 | 281 | */ |
278 | 282 | 'default' => [ |
279 | 283 | 'className' => Connection::class, |
280 | 284 | 'driver' => Mysql::class, |
281 | 285 | 'persistent' => false, |
282 | 286 | 'timezone' => 'UTC', |
283 | 287 |
|
284 | | - /** |
285 | | - * For MariaDB/MySQL the internal default changed from utf8 to utf8mb4, aka full utf-8 support, in CakePHP 3.6 |
| 288 | + /* |
| 289 | + * For MariaDB/MySQL the internal default changed from utf8 to utf8mb4, aka full utf-8 support |
286 | 290 | */ |
287 | | - //'encoding' => 'utf8mb4', |
| 291 | + 'encoding' => 'utf8mb4', |
288 | 292 |
|
289 | | - /** |
| 293 | + /* |
290 | 294 | * If your MySQL server is configured with `skip-character-set-client-handshake` |
291 | 295 | * then you MUST use the `flags` config to set your charset encoding. |
292 | 296 | * For e.g. `'flags' => [\PDO::MYSQL_ATTR_INIT_COMMAND => 'SET NAMES utf8mb4']` |
|
323 | 327 | 'driver' => Mysql::class, |
324 | 328 | 'persistent' => false, |
325 | 329 | 'timezone' => 'UTC', |
326 | | - //'encoding' => 'utf8mb4', |
| 330 | + 'encoding' => 'utf8mb4', |
327 | 331 | 'flags' => [], |
328 | 332 | 'cacheMetadata' => true, |
329 | 333 | 'quoteIdentifiers' => false, |
|
352 | 356 | 'scopes' => null, |
353 | 357 | 'levels' => ['warning', 'error', 'critical', 'alert', 'emergency'], |
354 | 358 | ], |
355 | | - // To enable this dedicated query log, you need set your datasource's log flag to true |
| 359 | + // To enable this dedicated query log, you need to set your datasource's log flag to true |
356 | 360 | 'queries' => [ |
357 | 361 | 'className' => FileLog::class, |
358 | 362 | 'path' => LOGS, |
359 | 363 | 'file' => 'queries', |
360 | 364 | 'url' => env('LOG_QUERIES_URL', null), |
361 | | - 'scopes' => ['queriesLog'], |
| 365 | + 'scopes' => ['cake.database.queries'], |
362 | 366 | ], |
363 | 367 | ], |
364 | 368 |
|
|
375 | 379 | * Avoid using `.` in cookie names, as PHP will drop sessions from cookies with `.` in the name. |
376 | 380 | * - `cookiePath` - The url path for which session cookie is set. Maps to the |
377 | 381 | * `session.cookie_path` php.ini config. Defaults to base path of app. |
378 | | - * - `timeout` - The time in minutes the session should be valid for. |
379 | | - * Pass 0 to disable checking timeout. |
380 | | - * Please note that php.ini's session.gc_maxlifetime must be equal to or greater |
381 | | - * than the largest Session['timeout'] in all served websites for it to have the |
382 | | - * desired effect. |
| 382 | + * - `timeout` - The time in minutes a session can be 'idle'. If no request is received in |
| 383 | + * this duration, the session will be expired and rotated. Pass 0 to disable idle timeout checks. |
383 | 384 | * - `defaults` - The default configuration set to use as a basis for your session. |
384 | 385 | * There are four built-in options: php, cake, cache, database. |
385 | 386 | * - `handler` - Can be used to enable a custom session handler. Expects an |
386 | 387 | * array with at least the `engine` key, being the name of the Session engine |
387 | 388 | * class to use for managing the session. CakePHP bundles the `CacheSession` |
388 | 389 | * and `DatabaseSession` engines. |
389 | | - * - `ini` - An associative array of additional ini values to set. |
| 390 | + * - `ini` - An associative array of additional 'session.*` ini values to set. |
| 391 | + * |
| 392 | + * Within the `ini` key, you will likely want to define: |
| 393 | + * |
| 394 | + * - `session.cookie_lifetime` - The number of seconds that cookies are valid for. This |
| 395 | + * should be longer than `Session.timeout`. |
| 396 | + * - `session.gc_maxlifetime` - The number of seconds after which a session is considered 'garbage' |
| 397 | + * that can be deleted by PHP's session cleanup behavior. This value should be greater than both |
| 398 | + * `Sesssion.timeout` and `session.cookie_lifetime`. |
390 | 399 | * |
391 | 400 | * The built-in `defaults` options are: |
392 | 401 | * |
|
395 | 404 | * - 'database' - Uses CakePHP's database sessions. |
396 | 405 | * - 'cache' - Use the Cache class to save sessions. |
397 | 406 | * |
398 | | - * To define a custom session handler, save it at src/Network/Session/<name>.php. |
| 407 | + * To define a custom session handler, save it at src/Http/Session/<name>.php. |
399 | 408 | * Make sure the class implements PHP's `SessionHandlerInterface` and set |
400 | 409 | * Session.handler to <name> |
401 | 410 | * |
|
404 | 413 | 'Session' => [ |
405 | 414 | 'defaults' => 'php', |
406 | 415 | ], |
| 416 | + |
| 417 | + /** |
| 418 | + * DebugKit configuration. |
| 419 | + * |
| 420 | + * Contains an array of configurations to apply to the DebugKit plugin, if loaded. |
| 421 | + * Documentation: https://book.cakephp.org/debugkit/5/en/index.html#configuration |
| 422 | + * |
| 423 | + * ## Options |
| 424 | + * |
| 425 | + * - `panels` - Enable or disable panels. The key is the panel name, and the value is true to enable, |
| 426 | + * or false to disable. |
| 427 | + * - `includeSchemaReflection` - Set to true to enable logging of schema reflection queries. Disabled by default. |
| 428 | + * - `safeTld` - Set an array of whitelisted TLDs for local development. |
| 429 | + * - `forceEnable` - Force DebugKit to display. Careful with this, it is usually safer to simply whitelist |
| 430 | + * your local TLDs. |
| 431 | + * - `ignorePathsPattern` - Regex pattern (including delimiter) to ignore paths. |
| 432 | + * DebugKit won’t save data for request URLs that match this regex. |
| 433 | + * - `ignoreAuthorization` - Set to true to ignore Cake Authorization plugin for DebugKit requests. |
| 434 | + * Disabled by default. |
| 435 | + * - `maxDepth` - Defines how many levels of nested data should be shown in general for debug output. |
| 436 | + * Default is 5. WARNING: Increasing the max depth level can lead to an out of memory error. |
| 437 | + * - `variablesPanelMaxDepth` - Defines how many levels of nested data should be shown in the variables tab. |
| 438 | + * Default is 5. WARNING: Increasing the max depth level can lead to an out of memory error. |
| 439 | + */ |
| 440 | + 'DebugKit' => [ |
| 441 | + 'forceEnable' => filter_var(env('DEBUG_KIT_FORCE_ENABLE', false), FILTER_VALIDATE_BOOLEAN), |
| 442 | + 'safeTld' => env('DEBUG_KIT_SAFE_TLD', null), |
| 443 | + 'ignoreAuthorization' => env('DEBUG_KIT_IGNORE_AUTHORIZATION', false), |
| 444 | + ], |
| 445 | + |
| 446 | + /** |
| 447 | + * TestSuite configuration. |
| 448 | + * |
| 449 | + * ## Options |
| 450 | + * |
| 451 | + * - `errorLevel` - Defaults to `E_ALL`. Can be set to `false` to disable overwrite error level. |
| 452 | + * - `fixtureStrategy` - Defaults to TruncateStrategy. Can be set to any class implementing FixtureStrategyInterface. |
| 453 | + */ |
| 454 | + 'TestSuite' => [ |
| 455 | + 'errorLevel' => null, |
| 456 | + 'fixtureStrategy' => null, |
| 457 | + ], |
407 | 458 | ]; |
| 459 | + |
0 commit comments