本文整理汇总了PHP中TYPO3\Flow\Cache\Frontend\VariableFrontend::flushByTag方法的典型用法代码示例。如果您正苦于以下问题:PHP VariableFrontend::flushByTag方法的具体用法?PHP VariableFrontend::flushByTag怎么用?PHP VariableFrontend::flushByTag使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类TYPO3\Flow\Cache\Frontend\VariableFrontend
的用法示例。
在下文中一共展示了VariableFrontend::flushByTag方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: collectGarbage
/**
* Iterates over all existing sessions and removes their data if the inactivity
* timeout was reached.
*
* @param boolean $maximumSessionsToRemove How many sessions to remove per run
* @return integer The number of outdated entries removed
* @api
*/
public function collectGarbage($maximumSessionsToRemove = 0)
{
if ($this->inactivityTimeout === 0) {
return 0;
}
if ($this->metaDataCache->has('_garbage-collection-running')) {
return false;
}
$sessionRemovalCount = 0;
$this->metaDataCache->set('_garbage-collection-running', true, array(), 120);
foreach ($this->metaDataCache->getIterator() as $sessionIdentifier => $sessionInfo) {
if ($sessionIdentifier === '_garbage-collection-running') {
continue;
}
$lastActivitySecondsAgo = $this->now - $sessionInfo['lastActivityTimestamp'];
if ($lastActivitySecondsAgo > $this->inactivityTimeout) {
if ($sessionInfo['storageIdentifier'] === null) {
$this->systemLogger->log('SESSION INFO INVALID: ' . $sessionIdentifier, LOG_WARNING, $sessionInfo);
} else {
$this->storageCache->flushByTag($sessionInfo['storageIdentifier']);
$sessionRemovalCount++;
}
$this->metaDataCache->remove($sessionIdentifier);
}
if ($maximumSessionsToRemove > 0 && $sessionRemovalCount >= $maximumSessionsToRemove) {
break;
}
}
$this->metaDataCache->remove('_garbage-collection-running');
return $sessionRemovalCount;
}
示例2: flushCachesByTag
/**
* Flushes 'findMatchResults' and 'resolve' caches for the given $tag
*
* @param string $tag
* @return void
*/
public function flushCachesByTag($tag)
{
$this->routeCache->flushByTag($tag);
$this->resolveCache->flushByTag($tag);
}
示例3: flushCachesByTag
/**
* Flushes 'findMatchResults' and 'resolve' caches for the given $tag
*
* @param string $tag
* @return void
*/
public function flushCachesByTag($tag)
{
$this->findMatchResultsCache->flushByTag($tag);
$this->resolveCache->flushByTag($tag);
}