What's the simplest way to clear the cache in Kohana 3.3.1?

别说谁变了你拦得住时间么 提交于 2019-12-11 16:01:18

问题


I inherited a web application in Kohana 3.3.1 (I'm used to working in Symfony).

What is the simplest command or process to clear the entire cache?

I've looked at

http://forum.kohanaframework.org/discussion/5779/how-i-can-clear-the-cache-folder-in-ko3/p1

and

http://www.hcs.harvard.edu/~powerpak/kohanadocs/libraries/cache.html

But I'm really looking for something that can be automated as part of our deploy/CI process.

Thanks!


回答1:


I think what easiest way will be write a minion task ( https://github.com/kohana/minion )

Put your task in classes/Task/ClearCache.php

<?php
class Task_ClearCache extends Minion_Task {

    protected function _execute(array $params)
    {
        Cache::instance()->delete_all();
    }
} 
?>

And run it into your BASEPATH directory > php minion.php ClearCache



来源:https://stackoverflow.com/questions/48329300/whats-the-simplest-way-to-clear-the-cache-in-kohana-3-3-1

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!