Clear all or the given cache.

@param string $cache The alias of the cache

@throws CacheNotFoundException if the cache is not found
778900
public function clear($cache = null)
    {
        if (null !== $cache) {
            if (!array_key_exists($cache, $this->caches)) {
                throw new CacheNotFoundException($cache);
            }

            $this->caches[$cache]->clear();
        } else {
            foreach ($this->caches as $cache) {
                $cache->clear();
            }
        }
    }
1141916
public function delete($key)
    {
		if (! $key || ! is_string($key)) {
			throw new InvalidArgumentException('Invalid cache key');
		}

		$transientKey = $this->generateTransientKey($key);
		delete_transient($transientKey);
	}
340158
public function delete($key)
    {
        if (true === array_key_exists($key, $this->cache)) {
            unset($this->cache[$key]);

            return true;
        }

        return false;
    }
952813
public function purge($key) {
		if ($this->log != null) {
			if ($this->log instanceof LoggerInterface) {
				$this->log->info("Purging key '{key}' from no-cache. Nothing to purge.", array('key'=>$key));
			} else {
				$this->log->trace("Purging key '$key' from no-cache. Nothing to purge.");
			}
		}
	}
1247655
public void clear() {
    if (cache == null) {
      return;
    }
    synchronized (cache) {
      inFlushAll = true;
      cache.invalidateAll();
      out.clear();
      inFlushAll = false;
    }
  }
687239
public static function clearGroupsAllCaches($caches = false, $groups = false) {
        $caches = self::_getCachesList($caches);
        foreach ($caches as $cache) {
            if (!$groups)//alls groups
                $cache->clearGroups();
            else {//groups list
                if (is_array($groups)) {
                    foreach ($groups as &$group)
                        $cache->clearGroup($group);
                } elseif (is_string($groups))
                    $cache->clearGroup($groups);
            }
        }
    }
20159
public function clear($prefix = null)
    {
        try {
            $engine = Cache::engine($prefix);
            Cache::clear(false, $prefix);
            if ($engine instanceof ApcuEngine) {
                $this->warn("ApcuEngine detected: Cleared $prefix CLI cache successfully " .
                "but $prefix web cache must be cleared separately.");
            } elseif ($engine instanceof WincacheEngine) {
                $this->warn("WincacheEngine detected: Cleared $prefix CLI cache successfully " .
                "but $prefix web cache must be cleared separately.");
            } else {
                $this->out("<success>Cleared $prefix cache</success>");
            }
        } catch (InvalidArgumentException $e) {
            $this->abort($e->getMessage());
        }
    }
1060716
public function forget(string $key): bool
    {
        $key = $this->hashKey($key);
        if (\array_key_exists($key, $this->cache)) {
            unset($this->cache[$key]);
            return true;
        }
        return false;
    }
1024316
public static function setArrayAccessCache(\ArrayAccess $cache)
    {
        self::$cacheImplementation = new ArrayAccessCacheAdapter($cache);
        self::$hasBeenCleared      = false;
    }
199804
public function isValidCache($cache)
    {
        // Get the valid caches
        $caches = $this->getCaches();
        $cacheKeys = array_keys($caches);
        $cacheKeys[] = 'all';

        if (!in_array($cache, array_values($cacheKeys))) {
            return false;
        }

        return $cache;
    }
86708
public function setCache($cache) : self
    {
        if (is_string($cache)) {
            $this->cache = CacheFactory::make($cache);
        } elseif ($cache instanceof Cacheable) {
            $this->cache = $cache;
        }

        $prefix = 'tus:' . strtolower((new \ReflectionClass(static::class))->getShortName()) . ':';

        $this->cache->setPrefix($prefix);

        return $this;
    }
826822
public function clear(): void
    {
        // On purpose does not check if enabled, in case of prior phase being enabled we clear cache when someone asks.
        $this->cache = $this->cacheIndex = $this->cacheExpiryTime = $this->cacheAccessCount = [];
    }
1283777
public function clear($prefix = null) {
        $prefix = !is_null($prefix) ? $prefix : $this->prefix;
        if ($prefix) {
            unset($_SESSION[$prefix]);
        }
        else {
            $_SESSION = [];
        }
    }
1137683
public function clear($cache = null)
    {
        if ($cache === null) {
            $cache = $this->cache_name;
        }
        $cache = self::encodeCache($cache);
        $url = "projects/{$this->project_id}/caches/$cache/clear";
        $params = array();
        $this->setJsonHeaders();
        return self::json_decode($this->apiCall(self::POST, $url, $params));
    }
772277
public function forget(string $key)
    {
        $cacheKey = $this->cacheKeys[$key] ?? null;
        if (!empty($cacheKey)) {
            Cache::forget($cacheKey);
        }
    }
248704
private function cacheIsStale($cache)
    {
        if (!$cache) {
            return true;
        }

        $updated = $cache['updated'];
        foreach ($cache['files'] as $import => $mtime) {
            $filemtime = filemtime($import);

            if ($filemtime !== $mtime || $filemtime > $updated) {
                return true;
            }
        }

        return false;
    }
1082284
public function clear($partition = null)
    {
        if (!$this->connected) {
            throw new CacheException('Cache not connected');
        }
        if (!$partition) {
            $partition = $this->namespace;
        }
        $this->memcache->increment($partition);
    }