Removes all cache entries of this cache which are tagged by the specified tag.

@param string $tag The tag the entries must have

@throws \TYPO3\CMS\Core\Cache\Exception
7320
public function flushByTag($tag)
    {
        $this->throwExceptionIfFrontendDoesNotExist();

        $this->logger->debug('SFC flushByTags', [$tag]);
        $identifiers = $this->findIdentifiersByTagIncludingExpired($tag);

        if ($this->isBoostMode()) {
            $this->getQueue()->addIdentifiers($identifiers);

            return;
        }

        foreach ($identifiers as $identifier) {
            $this->removeStaticFiles($identifier);
        }
        parent::flushByTag($tag);
    }
895389
public function clearTag(string $tag): void
    {
        // 指定标签清除
        $keys = $this->getTagItems($tag);

        foreach ($keys as $key) {
            $this->handler->delete($key);
        }

        $tagName = $this->getTagKey($tag);
        $this->rm($tagName);
    }
659619
public function replaceTags($tag, $blnCache=true)
	{
		$parts = explode('::', $tag);

		if(method_exists($this, $parts[0]))
		{
			$method = $parts[0];
			array_shift($parts);

			return $this->$method($parts, $blnCache);
		}

		return false;
	}
1111822
public function updateExpireByTag($tag, $lifetime = null)
    {
        $tags = (is_array($tag) ? $tag : array($tag));
        try {
            foreach ($tags as $tag) {
                $this->updateExpireTag($tag, $lifetime);
            }
        } catch (\Exception $e) {
            $this->log('warning', \sprintf('Unable to delete cache for tag(s) %s : %s', \implode(',', $tags), $e->getMessage()));

            return false;
        }

        return true;
    }
166905
public function removeTag($tag)
    {
        $this->tag = $tag;
        $this->getLogger()->info('Removing tag: ' . $tag . ' from layout ID ' . $this->mediaId);
        $this->doPost('/library/' . $this->mediaId . '/untag', [
            'tag' => [$tag]
        ]);

        return $this;
    }
58364
protected function remove_tag_from_cache($tagname) {
        // Trim the cache so we're not in danger of running out of memory.
        // "1" so that we replace only the FIRST instance.
        $this->xmlcache = trim(preg_replace('{<'.$tagname.'\b.*?>.*?</'.$tagname.'>}is', '', $this->xmlcache, 1));
    }
1373247
public function removeTag(Tag $tag)
    {
        if ($this->tags->contains($tag)) {
            $this->tags->removeElement($tag);
            return true;
        }
        return false;
    }
523460
public function removeTag($tag)
    {
        if (is_array($tag))
        {
            foreach ($tag as $t)
            {
                if (isset($this->allowed_tags[$t]))
                    unset($this->allowed_tags[$t]);
                $this->remove_tags[$t] = true;
            }
        }
        else
        {
            if (isset($this->allowed_tags[$tag]))
                unset($this->allowed_tags[$tag]);
            $this->remove_tags[$tag] = true;
        }
        return $this;
    }
117420
public function removeListenersWithTag($tag)
    {
        foreach ($this->listeners as $event => $priorities) {
            $this->clearSortedListeners($event);
            foreach ($priorities as $priority => $listeners) {
                $this->listeners[$event][$priority] = array_filter($listeners, function (TaggableListenerInterface $listener) use ($tag) {
                    return $listener->getTag() !== $tag;
                });
            }
        }

        return $this;
    }
1224815
public function flushByTag(string $tag): int
    {
        if ($this->isFrozen()) {
            throw new \RuntimeException(sprintf('Cannot add or modify cache entry because the backend of cache "%s" is frozen.', $this->cacheIdentifier), 1323344192);
        }

        $script = "
		local entries = redis.call('SMEMBERS', KEYS[1])
		for k1,entryIdentifier in ipairs(entries) do
			redis.call('DEL', ARGV[1]..'entry:'..entryIdentifier)
			local tags = redis.call('SMEMBERS', ARGV[1]..'tags:'..entryIdentifier)
			for k2,tagName in ipairs(tags) do
				redis.call('SREM', ARGV[1]..'tag:'..tagName, entryIdentifier)
			end
			redis.call('DEL', ARGV[1]..'tags:'..entryIdentifier)
			redis.call('LREM', KEYS[2], 0, entryIdentifier)
		end
		return #entries
		";
        $count = $this->redis->eval($script, [$this->buildKey('tag:' . $tag), $this->buildKey('entries'), $this->buildKey('')], 2);
        return $count;
    }
475229
public function removeTag(Tag $tagToRemove): void
    {
        foreach ($this->tags as $key => $tag) {
            if ($tag === $tagToRemove) {
                unset($this->tags[$key]);
                break;
            }
        }
    }
943811
public function removeAll( $tag, $priority = false ) {
		if ( isset( $this->hooks[$tag] ) ) {
			if ( false !== $priority && isset( $this->hooks[$tag][$priority] ) )
				unset( $this->hooks[$tag][$priority] );
			else
				unset( $this->hooks[$tag] );
		}

		if ( isset( $this->merged[$tag] ) )
			unset( $this->merged[$tag] );

		return true;
	}
488227
public function taggedAs($tag)
    {
        if (empty($this->current_node)) {
            return;
        }

        $this->current_node->tags = $tag;
        $this->current_node->save();
    }
707577
public function destroy(Tag $tag)
    {
        $deleted = $this->repository->delete($tag);

        return response()->json([
            'error' => !$deleted,
        ]);
    }
371947
public static function invalidate($tags)
    {
        if (Yii::$app->cache !== null) {
            TagDependency::invalidate(Yii::$app->cache, $tags);
        }
    }
822412
function clean($tag) {
		if (isset($this->_tags[$tag])) {
			foreach ($this->_tags[$tag] as $k) { /** @var string $k */
				unset($this->_data[$k]);
			}
			unset($this->_tags[$tag]);
		}
	}
186115
public function hasTag ($tag)
	{
		
		foreach ($this->lines as $line)
		{
			if (strpos ($line, '@' . $tag) === 0)
			{
				return TRUE;
			}
		}
		
		return FALSE;
		
	}