清除另一个应用程序的Symfony缓存 [英] Clearing Symfony cache for another application

查看:78
本文介绍了清除另一个应用程序的Symfony缓存的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想从后端应用程序中的操作清除前端应用程序的缓存。

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

如何实现?

推荐答案

我相信在symfony 1.2中执行此操作的正确方法如下:

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

这篇关于清除另一个应用程序的Symfony缓存的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆