示例#1
0
 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');
 }
示例#2
0
 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 = [];
 }
示例#3
0
 public function reset()
 {
     parent::reset();
     $this->_cachedData = [];
     Cache::delete('model-metadata');
 }
示例#4
0
 public static function clearAssetsCache()
 {
     static::$cachedAssets = [];
     Cache::delete('assets');
 }
示例#5
0
 public static function clearCache()
 {
     $environment = static::environment();
     is_file($cacheFile = storagePath('cache/config-' . $environment . '.php')) and unlink($cacheFile);
     Cache::delete('db_configs_' . $environment);
 }
示例#6
0
 public function removePendingConfirmationData()
 {
     Cache::delete('reg-pc-' . Session::get('pending-confirm'));
     Session::remove('pending-confirm');
     return $this;
 }