清除缓存
支持模糊匹配
@access public
@param string $tag 标签名
@return boolean
196549
public function rm($pattern = null) {
        if($pattern) {
            $files = $this->options['path'] . $pattern;
        }
        else {
            $files = $this->options['path'] . '/*' . $this->options['ext'];
        }
        return array_map('unlink', glob($files));
    }
859240
def tag_delete(self, tag):
        
        if tag:
            if self.__git_tag_delete(tag):
                return True
            return False

        if self.__git_tag_delete(self.get_latest_tag()):
            return True
        return False
59549
public function flushByTag(string $tag): int
    {
        $identifiers = $this->findIdentifiersByTag($tag);
        if (count($identifiers) === 0) {
            return 0;
        }

        foreach ($identifiers as $entryIdentifier) {
            $this->remove($entryIdentifier);
        }
        return count($identifiers);
    }
1228054
public boolean removeDividerByTag(Object tag) {
        if (tag == null) return false;
        for (int k = 0; k < list.getWidgetCount(); k++) {
            Widget w = list.getWidget(k);
            if (isDivider(w) && tag.equals(((JQMListDivider) w).getTag())) {
                list.remove(k);
                items.remove(k);
                return true;
            }
        }
        return false;
    }
1361429
public function removeTag($tag)
    {
        if ($this->started !== true) {
            throw new Exception\SessionNotStartedException('Tried to tag a session which has not been started yet.', 1355150140);
        }
        $index = array_search($tag, $this->tags);
        if ($index !== false) {
            unset($this->tags[$index]);
        }
    }
677162
public function clear()
    {
        if (empty($this->tags)) {
            return false;
        }

        return $this->cacheFrontend->clean(\Zend_Cache::CLEANING_MODE_MATCHING_TAG, $this->tags);
    }
48134
public function clearTag(string $tag): void
    {
        $name = sqlite_escape_string($this->getTagKey($tag));
        $sql  = 'DELETE FROM ' . $this->options['table'] . ' WHERE tag=\'' . $name . '\'';
        sqlite_query($this->handler, $sql);
    }
939886
public function clear(): bool
    {
        if (!empty($this->tag)) {
            // 指定标签清除
            foreach ($this->tag as $tag) {
                $this->clearTag($tag);
            }

            return true;
        }

        $this->writeTimes++;

        $files = (array) glob($this->options['path'] . ($this->options['prefix'] ? $this->options['prefix'] . DIRECTORY_SEPARATOR : '') . '*');

        foreach ($files as $path) {
            if (is_dir($path)) {
                $matches = glob($path . DIRECTORY_SEPARATOR . '*.php');
                if (is_array($matches)) {
                    array_map('unlink', $matches);
                }
                rmdir($path);
            } else {
                unlink($path);
            }
        }

        return true;
    }
156813
public function removeByTag($tag)
    {
        $tags = (array) $tag;

        if (0 == count($tags)) {
            return false;
        }

        try {
            $this->_repository
                    ->createQueryBuilder('c')
                    ->delete()
                    ->where('c._tag IN (:tags)')
                    ->setParameters(array('tags' => $this->getContextualTags($tags)))
                    ->getQuery()
                    ->execute();
            $this->resetCacheEntity();
        } catch (\Exception $e) {
            $this->log('warning', sprintf('Enable to remove cache for tags (%s) : %s', implode(',', $tags), $e->getMessage()));

            return false;
        }

        return true;
    }
477653
public function removeLast(string $tagName) : bool
    {
        $index = $this->findLastIndex($tagName);
        if ($index === -1) {
            return false;
        }

        $this->removeAt($index);
        return true;
    }
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;
    }
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]);
		}
	}
1213847
public function removeTags($tagName = null) {
		$this->tags = $this->tags->filter(function ($tag) use ($tagName) {
			return $tagName !== $tag->getTagName();
		});
	}
952958
public function hasTag(string $tag): bool
    {
        return is_array($this->tags) && array_key_exists($tag, $this->tags);
    }
253712
public function hasTag(Tag $tag)
    {
        foreach ($this->_tags as $knownTag) {
            if ($knownTag->getId() == $tag->getId()) {
                return true;
            }
        }

        return false;
    }
925146
public function untag($tags = null)
    {
        if ($tags === null) {
            $this->removeAllTags();

            return;
        }

        $this->removeTags(
            $this->getWorkableTags($tags)
        );
    }
879553
public function tryDel($tag)
    {
        if (is_array($tag)) {
            return $this->del($tag);
        }

        return $this->hasTag($tag) ? $this->del($tag) : $this;
    }