Cachearium\CacheAbstract::clearAll PHP Method

clearAll() public static method

Clears all cache classes.
public static clearAll ( )
    public static function clearAll()
    {
        $caches = [\Cachearium\Backend\CacheRAM::singleton(), \Cachearium\Backend\CacheFilesystem::singleton(), \Cachearium\Backend\CacheMemcached::singleton()];
        foreach ($caches as $cacheInst) {
            if ($cacheInst->isEnabled()) {
                $cacheInst->clear();
            }
        }
    }

Usage Example

Example #1
0
 public static function setUpBeforeClass()
 {
     global $FLOH_CONFIG;
     self::$testMemoryCache = true;
     // CONF('LH_CACHE_ENABLE') && CONF('LH_CACHE_MEMCACHE');
     self::$enabled = true;
     // CONF('LH_CACHE_ENABLE');
     $FLOH_CONFIG['LH_CACHE_DEBUG_ONPAGE'] = false;
     if (!self::$enabled) {
         self::markTestSkipped('CacheAbstract disabled');
     } else {
         CacheMemcached::singleton([['localhost', 11211]]);
         // set server
         CacheAbstract::clearAll();
     }
 }
All Usage Examples Of Cachearium\CacheAbstract::clearAll