在CakePHP升级到3.3.16>3.6.7之后,“_cake_model_”缓存配置不存在

iqjalb3h  于 2022-11-11  发布在  PHP
关注(0)|答案(2)|浏览(139)

我收到错误:
The "_cake_model_" cache configuration does not exist.
在从CakePHP v3.3.16升级到3.6.7之后。
然而该高速缓存配置确实存在,这来自config/app.php:

'Cache' => [
    '_cake_model_' => [
        'className' => 'Cake\Cache\Engine\FileEngine',
        'prefix' => 'myapp_cake_model_',
        'path' => CACHE . 'models/',
        'serialize' => true,
        'duration' => '+2 minutes',
        'url' => env('CACHE_CAKEMODEL_URL', null),
    ],
],

有人知道为什么会这样吗?

az31mfrm

az31mfrm1#

您可以检查配置数据是否在应用程序引导结束时以Cache::getConfig('_cake_model_')结束在缓存中。如果失败,您的配置数据很可能没有传递到Cache

ff29svar

ff29svar2#

在我的例子中,它在“className”位置是NULL。下面的更改纠正了这个错误。

'className' => 'File'

可能是className字段的正确阅读出现了问题。

相关问题