Skip to content

Commit

Permalink
migrated app.php to cakephp 5.0
Browse files Browse the repository at this point in the history
  • Loading branch information
patrickakk committed Aug 29, 2024
1 parent 1192a19 commit 8c72747
Showing 1 changed file with 42 additions and 20 deletions.
62 changes: 42 additions & 20 deletions config/app.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,11 @@
<?php

use Cake\Cache\Engine\FileEngine;
use Cake\Database\Connection;
use Cake\Database\Driver\Mysql;
use Cake\Log\Engine\FileLog;
use Cake\Mailer\Transport\MailTransport;

return [
// custom variables
'dhcr' => [
Expand Down Expand Up @@ -102,7 +109,7 @@
*/
'Cache' => [
'default' => [
'className' => 'Cake\Cache\Engine\FileEngine',
'className' => FileEngine::class,
'path' => CACHE,
'url' => env('CACHE_DEFAULT_URL', null),
],
Expand All @@ -114,9 +121,9 @@
* If you set 'className' => 'Null' core cache will be disabled.
*/
'_cake_core_' => [
'className' => 'Cake\Cache\Engine\FileEngine',
'className' => FileEngine::class,
'prefix' => 'myapp_cake_core_',
'path' => CACHE . 'persistent/',
'path' => CACHE . 'persistent' . DS,
'serialize' => true,
'duration' => '+1 second',
'url' => env('CACHE_CAKECORE_URL', null),
Expand All @@ -129,9 +136,9 @@
* Duration will be set to '+2 minutes' in bootstrap.php when debug = true
*/
'_cake_model_' => [
'className' => 'Cake\Cache\Engine\FileEngine',
'className' => FileEngine::class,
'prefix' => 'myapp_cake_model_',
'path' => CACHE . 'models/',
'path' => CACHE . 'models' . DS,
'serialize' => true,
'duration' => '+1 second',
'url' => env('CACHE_CAKEMODEL_URL', null),
Expand All @@ -143,7 +150,7 @@
* Duration will be set to '+2 seconds' in bootstrap.php when debug = true
*/
'_cake_routes_' => [
'className' => 'Cake\Cache\Engine\FileEngine',
'className' => FileEngine::class,
'prefix' => 'myapp_cake_routes_',
'path' => CACHE,
'serialize' => true,
Expand Down Expand Up @@ -183,11 +190,26 @@
*/
'Error' => [
'errorLevel' => E_ALL,
'exceptionRenderer' => 'Cake\Error\ExceptionRenderer',
'skipLog' => [],
'log' => true,
'trace' => true,
'extraFatalErrorMemory' => 2
'ignoredDeprecationPaths' => [],
],

/*
* Debugger configuration
*
* Define development error values for Cake\Error\Debugger
*
* - `editor` Set the editor URL format you want to use.
* By default atom, emacs, macvim, phpstorm, sublime, textmate, and vscode are
* available. You can add additional editor link formats using
* `Debugger::addEditor()` during your application bootstrap.
* - `outputMask` A mapping of `key` to `replacement` values that
* `Debugger` should replace in dumped data and logs generated by `Debugger`.
*/
'Debugger' => [
'editor' => 'vscode',
],

/**
Expand All @@ -211,7 +233,7 @@
*/
'EmailTransport' => [
'default' => [
'className' => 'Cake\Mailer\Transport\SmtpTransport',
'className' => MailTransport::class,
/*
* The following keys are used in SMTP transports:
*/
Expand Down Expand Up @@ -264,8 +286,8 @@
*/
'Datasources' => [
'default' => [
'className' => 'Cake\Database\Connection',
'driver' => 'Cake\Database\Driver\Mysql',
'className' => Connection::class,
'driver' => Mysql::class,
'persistent' => false,
'host' => env('DB_HOST', null),
/*
Expand Down Expand Up @@ -312,8 +334,8 @@
* The test connection is used during the test suite.
*/
'test' => [
'className' => 'Cake\Database\Connection',
'driver' => 'Cake\Database\Driver\Mysql',
'className' => Connection::class,
'driver' => Mysql::class,
'persistent' => false,
'host' => env('TEST_DB_HOST', null),
//'port' => 'non_standard_port_number',
Expand All @@ -335,31 +357,31 @@
*/
'Log' => [
'debug' => [
'className' => 'Cake\Log\Engine\FileLog',
'className' => FileLog::class,
'path' => LOGS,
'file' => 'debug',
'url' => env('LOG_DEBUG_URL', null),
'scopes' => false,
'scopes' => null,
'levels' => ['notice', 'info', 'debug'],
],
'error' => [
'className' => 'Cake\Log\Engine\FileLog',
'className' => FileLog::class,
'path' => LOGS,
'file' => 'error',
'url' => env('LOG_ERROR_URL', null),
'scopes' => false,
'scopes' => null,
'levels' => ['warning', 'error', 'critical', 'alert', 'emergency'],
],
// To enable this dedicated query log, you need set your datasource's log flag to true
'queries' => [
'className' => 'Cake\Log\Engine\FileLog',
'className' => FileLog::class,
'path' => LOGS,
'file' => 'queries',
'url' => env('LOG_QUERIES_URL', null),
'scopes' => ['queriesLog'],
'scopes' => ['cake.database.queries'],
],
'cron' => [
'className' => 'Cake\Log\Engine\FileLog',
'className' => FileLog::class,
'path' => LOGS,
'file' => 'cron',
'scopes' => ['cron']
Expand Down

0 comments on commit 8c72747

Please sign in to comment.