/** * Clear cache. * * @param boolean $check If true will check expiration, otherwise delete all * @param string $config Name of the configuration to use. Defaults to 'default' * @return boolean True if the cache was successfully cleared, false otherwise */ public static function clear($check = true, $config = 'default') { $EventManager = new CommonEventManager(); $EventManager->loadListeners($EventManager, 'Cache'); $Event = new CakeEvent('Cache.clear', null, compact('check', 'config')); list($Event->break, $Event->breakOn) = array(true, false); $EventManager->trigger($Event); if (false === $Event->result) { return false; } return Cache::clear($check, $config); }
/** * Flushes all static properties (useful in tests). * * @return void */ public static function flush($scope = null) { if (empty($scope)) { self::$implementedEvents = self::$loadedListeners = self::$loadedScopes = array(); return; } // foreach (self::) }