我如何使用zfdebug缓存插件?

时间:2011-05-06 10:45:17

标签: zend-framework

我正在使用zfdebug的最新svn版本(1.6)和zend 1.11.4并试图让zfdebug的缓存插件工作

我找到了这两个例子:http://code.google.com/p/zfdebug/wiki/Installationhttp://www.jaceju.net/blog/archives/1077

在我的 bootstrap.php 代码中

# Setup the cache plugin
if ($this->hasPluginResource('cache')) {
    $this->bootstrap('cache');
    $cache = $this->getPluginResource('cache')->getDbAdapter();
    $options['plugins']['Cache']['backend'] = $cache->getBackend();
}

似乎不起作用,我得调用未定义的方法Gestionale_Application_Resource_Cache :: getDbAdapter()

我的application.ini有这个

;cache stuff
resources.cache.frontEnd = core 
resources.cache.backEnd = file 
resources.cache.frontEndOptions.lifetime = 1200 ; in secondi
resources.cache.frontEndOptions.automatic_serialization = true 
resources.cache.backEndOptions.lifetime = 3600 ; in secondi
resources.cache.backEndOptions.cache_dir = APPLICATION_PATH "/../cache"
pluginPaths.Gestionale_Application_Resource = APPLICATION_PATH "/../library/Gestionale/Application/Resource"  
;;fine cache stuff

谢谢:)

1 个答案:

答案 0 :(得分:0)

替换


# Setup the cache plugin
if ($this->hasPluginResource('cache')) {
    $this->bootstrap('cache');
    $cache = $this->getPluginResource('cache')->getDbAdapter();
    $options['plugins']['Cache']['backend'] = $cache->getBackend();
}

通过


# Setup the cache plugin
if ($this->hasResource('cache')) {
  $this->bootstrap('cache');
  $options['plugins']['Cache']['backend'] = $this->getResource('cache')->getBackend();
}
相关问题