2011-05-06 71 views
0

我使用zfdebug的最新SVN版本(1.6)與Zend 1.11.4並試圖獲得zfdebug的緩存插件工作我如何使用zfdebug緩存插件?

,我發現這2個例子: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 

謝謝:)

回答

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(); 
} 
+0

如果它從未進入,我不有一個_initCache()函數,但我使用zend_緩存在我的項目中,無論如何我會給你正確的答案 – max4ever 2011-05-12 09:59:41