【发布时间】:2019-04-16 08:38:10
【问题描述】:
我正在寻找一种解决方案来替换 Zend 3 应用程序中的 Zend 1/2 缓存。旧应用程序正在使用
$cache = Zend_Cache::factory('Core', 'File, $frontendOptions, $backendOptions)
获取缓存实例。如何在 Zend Framework 3 中获得相同的实例?
【问题讨论】:
标签: zend-framework3 zend-cache
我正在寻找一种解决方案来替换 Zend 3 应用程序中的 Zend 1/2 缓存。旧应用程序正在使用
$cache = Zend_Cache::factory('Core', 'File, $frontendOptions, $backendOptions)
获取缓存实例。如何在 Zend Framework 3 中获得相同的实例?
【问题讨论】:
标签: zend-framework3 zend-cache
看看这段代码。完整描述可查看here
$cache = \Zend\Cache\StorageFactory::factory([
'adapter' => [
'name' => 'filesystem',
'options' => [
'namespace' => 'builder',
],
],
'options' => [
'cache_dir' => 'data/cache',
],
'plugins' => [
'exception_handler' => [
'throw_exceptions' => true,
],
'Serializer',
],
]);
【讨论】: