當前位置: 首頁>>代碼示例>>PHP>>正文


PHP Repository::flush方法代碼示例

本文整理匯總了PHP中Illuminate\Cache\Repository::flush方法的典型用法代碼示例。如果您正苦於以下問題:PHP Repository::flush方法的具體用法?PHP Repository::flush怎麽用?PHP Repository::flush使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在Illuminate\Cache\Repository的用法示例。


在下文中一共展示了Repository::flush方法的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: testShouldReturnNullFlushRecord

 public function testShouldReturnNullFlushRecord()
 {
     $this->repository->add('memcached-testing', 'couchbase', 60);
     $this->repository->decrement('memcached-testing-decrement', 100);
     $this->repository->increment('memcached-testing-increment', 100);
     $this->repository->flush();
     $this->assertNull($this->repository->get('memcached-testing'));
     $this->assertNull($this->repository->get('memcached-testing-decrement'));
     $this->assertNull($this->repository->get('memcached-testing-increment'));
 }
開發者ID:ytake,項目名稱:laravel-couchbase,代碼行數:10,代碼來源:MemcachedBucketTest.php

示例2: flush

 public function flush()
 {
     $this->cache->flush();
 }
開發者ID:sdebacker,項目名稱:laravel-responsecache,代碼行數:4,代碼來源:ResponseCacheRepository.php

示例3: flush

 /**
  * Flushes traces of records related to the provided keywords, otherwise proceeds to regular flush() method.
  */
 public function flush()
 {
     if (!empty($this->keywords)) {
         $flushedKeys = $this->forgetKeywordIndex($this->keywords);
         $affectedKeywords = $this->forgetInverseIndex($flushedKeys);
         foreach ($flushedKeys as $flushedKey) {
             // Set all affected keywords as old keywords and request
             // empty new keywords to remove the flushed key from other indices as well.
             $this->determineKeywordsState($flushedKey, [], $affectedKeywords);
             $this->updateKeywordIndex($flushedKey);
             parent::forget($flushedKey);
         }
     } else {
         parent::flush();
     }
     if (!$this->operatingOnKeywords()) {
         $this->resetCurrentKeywords();
     }
 }
開發者ID:propaganistas,項目名稱:laravel-cache-keywords,代碼行數:22,代碼來源:KeywordsRepository.php


注:本文中的Illuminate\Cache\Repository::flush方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。