public function testSetAndRemoveCache() { $cacheKey = 'test.set.cache'; $value = 'Some stub'; Cache::set($cacheKey, $value); $this->assertEquals($value, Cache::get($cacheKey), 'Unable to set cache'); Cache::delete($cacheKey); $this->assertNull(Cache::get($cacheKey), 'Unable to delete cache'); }
public static function clearCache($memoryOnly = false) { static::$instance or static::$instance = static::$di->getShared('i18n'); static::$instance->locale = []; if ($memoryOnly) { return; } foreach (glob(static::$instance->localePath . '/*', GLOB_ONLYDIR) as $dir) { $locale = basename($dir); Cache::delete('locale.' . $locale); } is_file(static::$instance->undefinedStringsLogFile) and unlink(static::$instance->undefinedStringsLogFile); static::$instance->undefinedStrings = []; }
public function reset() { parent::reset(); $this->_cachedData = []; Cache::delete('model-metadata'); }
public static function clearAssetsCache() { static::$cachedAssets = []; Cache::delete('assets'); }
public static function clearCache() { $environment = static::environment(); is_file($cacheFile = storagePath('cache/config-' . $environment . '.php')) and unlink($cacheFile); Cache::delete('db_configs_' . $environment); }
public function removePendingConfirmationData() { Cache::delete('reg-pc-' . Session::get('pending-confirm')); Session::remove('pending-confirm'); return $this; }