Clearing Symfony cache for another application

后端 未结 5 2256
不知归路
不知归路 2021-02-10 05:37

I would like to clear my frontend application\'s cache from an action in my backend application.

How can I achieve this?

5条回答
  •  礼貌的吻别
    2021-02-10 06:06

    I believe the proper way to do this in symfony 1.2 is as follows:

    sfContext::switchTo('frontend'); //switch to the environment you wish to clear
    sfContext::getInstance()->getViewCacheManager()->getCache()->clean(sfCache::ALL);
    sfContext::switchTo('backend'); //switch back to the environment you started from
    

提交回复
热议问题