脚本宝典收集整理的这篇文章主要介绍了CakePHP 1.3在添加新帖子后清除所有缓存页面,脚本宝典觉得挺不错的,现在分享给大家,也给大家做个参考。
Cache::config('default',array('engine' => 'File','duration' => 8640000));
app / controllers / articles_controller.PHP:
VAR $helPErs = array('Cache'); var $cacheAction = array( 'view' => array('duration' => 8640000),'latest' => array('duration' => 8640000),);
/** * Delete a key From the cache * * @param string $key Identifier for the data * @return boolean True if the value was successfully deleted,false if IT didn't exist or Couldn't be removed */ public function delete($key) { if ($this->_setKey($key) === false || !$this->_init) { return false; } $path = $this->_File->getRealPath(); $this->_File = null; //@codingStandardsIgnoreStart return @unlink($path); //@codingStandardsIgnoreEnd }
此外,不是编辑核心蛋糕文件,您可以添加自己的文件引擎,并通过移动代码并在那里扩展代码来使用蛋糕引擎的分离(这在开源中非常酷).
以上是脚本宝典为你收集整理的CakePHP 1.3在添加新帖子后清除所有缓存页面全部内容,希望文章能够帮你解决CakePHP 1.3在添加新帖子后清除所有缓存页面所遇到的问题。
本图文内容来源于网友网络收集整理提供,作为学习参考使用,版权属于原作者。
如您有任何意见或建议可联系处理。小编QQ:384754419,请注明来意。