/** * Clears all caches in all available places */ public function clearAllCaches() { // Save usage for stats Usage::getInstance()->add(__CLASS__, __FUNCTION__); if (FileCache::itWorks()) { $this->getFileCacher()->deleteAll(); } if (MemcachedCache::itWorks()) { $this->getMemcachedCacher()->deleteAll(); } if (MemcacheCache::itWorks()) { $this->getMemcacheCacher()->deleteAll(); } if (FakeCache::itWorks()) { $this->getFakeCacher()->deleteAll(); } }
/** * Set current default cache class */ private function bootCacher() { /** @var Cacher $cacher */ $cacher = Cacher::getInstance(); // Default cacher if FileCache, so we do not check it if (MemcachedCache::itWorks()) { // Distributed cache new version $cacher->setDefaultCacher('MemcachedCache'); } elseif (MemcacheCache::itWorks()) { // Distributed cache old version $cacher->setDefaultCacher('MemcacheCache'); } }