2

我想删除所有以字符串为前缀的缓存条目,但我的代码返回:

Fatal error: Call to undefined method Doctrine\Common\Cache\FilesystemCache::deleteByPrefix()

我的代码是

$deleted = $cachemanager->deleteByPrefix('catalog_');

就像我检查的地方:进入教义文档http://docs.doctrine-project.org/projects/doctrine-orm/en/latest/reference/caching.html#deleting

我需要从控制器清除缓存,而不是从 CLI...

有人可以替代此方法“deleteByPrefix()”吗?

4

2 回答 2

0

You can use the namespace. This will require reorganizing your caches. Or you can write your own implementation (extending Doctrine\Common\Cache\FilesystemCache) which will implement deleteByPrefix(), but you'll use the ability to simply switch cache provider.

于 2013-10-10T12:32:10.500 回答
0

最后,我开始使用 Zend Framework 缓存包,它允许按前缀删除...

于 2013-10-17T12:54:49.453 回答