public function onAuthSuccess(AuthenticateEvent $event) { if (!($credentials = $event->getCredentials()) or !isset($credentials['username'])) { return; } App::cache()->delete($this->getCacheKey($credentials['username'])); }
public function __destruct() { if ($this->cacheDirty) { App::cache()->save(self::CACHE_KEY, $this->cacheEntries); } }
/** * Clears resolver cache. */ public function clearCache() { App::cache()->delete(FileUrlResolver::CACHE_KEY); App::cache()->delete(CategoryUrlResolver::CACHE_KEY); }
/** * Clears resolver cache. */ public function clearCache() { App::cache()->delete(UrlResolver::CACHE_KEY); }
/** * TODO: clear opcache */ public function doClearCache(array $options = []) { // clear cache if (empty($options) || @$options['cache']) { App::cache()->flushAll(); foreach (glob(App::get('path.cache') . '/*.cache') as $file) { @unlink($file); } } // clear temp folder if (@$options['temp']) { foreach (App::finder()->in(App::get('path.temp'))->depth(0)->ignoreDotFiles(true) as $file) { App::file()->delete($file->getPathname()); } } }