Skip to content

Commit 63635ed

Browse files
committed
Fix "Cache config _cake_core_ is deprecated. Use _cake_translations_ instead"
Ref: https://github.com/cakephp/app/blob/5.x/config/app.php
1 parent b7aa982 commit 63635ed

2 files changed

Lines changed: 24 additions & 48 deletions

File tree

config/app_ci.php

Lines changed: 12 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,8 @@
77
use Cake\Mailer\Transport\DebugTransport;
88
use Cake\Mailer\Transport\MailTransport;
99

10+
use function Cake\Core\env;
11+
1012
return [
1113
/**
1214
* Debug Level:
@@ -91,32 +93,32 @@
9193
// 'cacheTime' => '+1 year'
9294
],
9395

94-
/**
96+
/*
9597
* Configure the cache adapters.
9698
*/
9799
'Cache' => [
98100
'default' => [
99101
'className' => FileEngine::class,
100102
'path' => CACHE,
101-
'url' => null,
103+
'url' => env('CACHE_DEFAULT_URL', null),
102104
],
103105

104-
/**
106+
/*
105107
* Configure the cache used for general framework caching.
106108
* Translation cache files are stored with this configuration.
107109
* Duration will be set to '+2 minutes' in bootstrap.php when debug = true
108110
* If you set 'className' => 'Null' core cache will be disabled.
109111
*/
110-
'_cake_core_' => [
112+
'_cake_translations_' => [
111113
'className' => FileEngine::class,
112-
'prefix' => 'myapp_cake_core_',
113-
'path' => CACHE . 'persistent/',
114+
'prefix' => 'myapp_cake_translations_',
115+
'path' => CACHE . 'persistent' . DS,
114116
'serialize' => true,
115117
'duration' => '+1 years',
116-
'url' => null,
118+
'url' => env('CACHE_CAKECORE_URL', null),
117119
],
118120

119-
/**
121+
/*
120122
* Configure the cache for model and datasource caches. This cache
121123
* configuration is used to store schema descriptions, and table listings
122124
* in connections.
@@ -125,24 +127,10 @@
125127
'_cake_model_' => [
126128
'className' => FileEngine::class,
127129
'prefix' => 'myapp_cake_model_',
128-
'path' => CACHE . 'models/',
129-
'serialize' => true,
130-
'duration' => '+1 years',
131-
'url' => null,
132-
],
133-
134-
/**
135-
* Configure the cache for routes. The cached routes collection is built the
136-
* first time the routes are processed via `config/routes.php`.
137-
* Duration will be set to '+2 seconds' in bootstrap.php when debug = true
138-
*/
139-
'_cake_routes_' => [
140-
'className' => FileEngine::class,
141-
'prefix' => 'myapp_cake_routes_',
142-
'path' => CACHE,
130+
'path' => CACHE . 'models' . DS,
143131
'serialize' => true,
144132
'duration' => '+1 years',
145-
'url' => null,
133+
'url' => env('CACHE_CAKEMODEL_URL', null),
146134
],
147135
],
148136

config/app_example.php

Lines changed: 12 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,8 @@
66
use Cake\Log\Engine\FileLog;
77
use Cake\Mailer\Transport\MailTransport;
88

9+
use function Cake\Core\env;
10+
911
return [
1012
/**
1113
* Debug Level:
@@ -89,32 +91,32 @@
8991
// 'cacheTime' => '+1 year'
9092
],
9193

92-
/**
94+
/*
9395
* Configure the cache adapters.
9496
*/
9597
'Cache' => [
9698
'default' => [
9799
'className' => FileEngine::class,
98100
'path' => CACHE,
99-
'url' => null,
101+
'url' => env('CACHE_DEFAULT_URL', null),
100102
],
101103

102-
/**
104+
/*
103105
* Configure the cache used for general framework caching.
104106
* Translation cache files are stored with this configuration.
105107
* Duration will be set to '+2 minutes' in bootstrap.php when debug = true
106108
* If you set 'className' => 'Null' core cache will be disabled.
107109
*/
108-
'_cake_core_' => [
110+
'_cake_translations_' => [
109111
'className' => FileEngine::class,
110-
'prefix' => 'myapp_cake_core_',
111-
'path' => CACHE . 'persistent/',
112+
'prefix' => 'myapp_cake_translations_',
113+
'path' => CACHE . 'persistent' . DS,
112114
'serialize' => true,
113115
'duration' => '+1 years',
114-
'url' => null,
116+
'url' => env('CACHE_CAKECORE_URL', null),
115117
],
116118

117-
/**
119+
/*
118120
* Configure the cache for model and datasource caches. This cache
119121
* configuration is used to store schema descriptions, and table listings
120122
* in connections.
@@ -123,24 +125,10 @@
123125
'_cake_model_' => [
124126
'className' => FileEngine::class,
125127
'prefix' => 'myapp_cake_model_',
126-
'path' => CACHE . 'models/',
127-
'serialize' => true,
128-
'duration' => '+1 years',
129-
'url' => null,
130-
],
131-
132-
/**
133-
* Configure the cache for routes. The cached routes collection is built the
134-
* first time the routes are processed via `config/routes.php`.
135-
* Duration will be set to '+2 seconds' in bootstrap.php when debug = true
136-
*/
137-
'_cake_routes_' => [
138-
'className' => FileEngine::class,
139-
'prefix' => 'myapp_cake_routes_',
140-
'path' => CACHE,
128+
'path' => CACHE . 'models' . DS,
141129
'serialize' => true,
142130
'duration' => '+1 years',
143-
'url' => null,
131+
'url' => env('CACHE_CAKEMODEL_URL', null),
144132
],
145133
],
146134

0 commit comments

Comments
 (0)