本文整理汇总了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'));
}
示例2: flush
public function flush()
{
$this->cache->flush();
}
示例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();
}
}