ItemPool::clear

Deletes all items in the pool.

@return bool
True if the pool was successfully cleared. False if there was an error.
198060
public function clear()
    {
        if (isset($this->config[ 'dbIndex' ])) {
            return $this->redis->flushDB();
        } else {
            return $this->redis->flushAll();
        }
    }
294525
public function delete()
    {
        foreach ($this->value as $index => $item) {
            $item->delete();
            unset($this->value[$index]);
        }

        return true;
    }
1241148
public function purge()
    {
        if (file_exists($this->directory)) {
            $files          = $this->getCachedFiles();
            $successDeleted = true;
            foreach ($files as $file) {
                $successDeleted &= $this->removeCacheFile($file);
            }

            return (bool)$successDeleted;
        }

        return false;
    }
1056936
public function clear()
    {
        $keys = eaccelerator_list_keys();
        if (is_array($keys)) {
            foreach ($keys as $info) {
                // eaccelerator bug (Http://eaccelerator.net/ticket/287)
                if (0 === strpos($info['name'], ':')) {
                    $key = substr($info['name'], 1);
                } else {
                    $key = $info['name'];
                }

                if (!eaccelerator_rm($key)) {
                    return false;
                }
            }
        }

        return true;
    }
677162
public function clear()
    {
        if (empty($this->tags)) {
            return false;
        }

        return $this->cacheFrontend->clean(\Zend_Cache::CLEANING_MODE_MATCHING_TAG, $this->tags);
    }
847777
public function delete($key)
    {
        if ($this->enabled) {
            return $this->pool->getItem($key)->clear();
        } else {
            return false;
        }
    }
1351697
public function clear()
    {
        $result = parent::clear();

        $this->_data = KObjectConfig::unbox($this->getConfig()->data);

        return $result;
    }
58541
public function clear()
    {
        $directory = new \RecursiveIteratorIterator(
            new \RecursiveDirectoryIterator($this->path),
            \RecursiveIteratorIterator::SELF_FIRST
        );

        $cacheIterator = new \RegexIterator($directory, '/^.+\.cache/i', \RecursiveRegexIterator::GET_MATCH);

        $isCleared = false;

        foreach ($cacheIterator as $cacheFiles) {
            foreach ($cacheFiles as $cacheFile) {
                if (false === ($isCleared = unlink($cacheFile))) {
                    return $isCleared;
                    break;
                }
            }
        }

        return $isCleared;
    }
390917
public function clear()
    {
        $purged = $this->writeStorage->clear();

        if ($this->bigStorage) {
            $this->bigStorage->clear();
        }

        $this->entryCache = [];

        return $purged;
    }
231801
public function clear(): bool
    {
        if (!empty($this->tag)) {
            foreach ($this->tag as $tag) {
                $this->clearTag($tag);
            }
            return true;
        }

        $this->writeTimes++;
        return wincache_ucache_clear();
    }
878707
public function clear()
    {
        $this->callBeforeListeners('clear', [$this->storageName]);
        $result = $this->storage->clear();
        $this->callAfterListeners('clear', [$this->storageName]);

        return $result;
    }
254771
public function clearAll(): bool
    {
        // 取缓存目录
        $fileList = $this->getFileList();

        // 删除目录 中的每一个数据缓存文件
        foreach ($fileList as $key => $expire) {
            $info = $this->getFile($key);
            unlink($info[1]);
            unlink($info[2]);
        }

        // 删除目录文件
        $this->delFileList();
        return true;
    }
1187704
protected function clearAllObjectsFromCacheCluster()
    {
        $nodes = $this->cache->_masters();

        foreach ($nodes as $node) {
            if (!$this->cache->flushDB($node)) {
                return false;
            }
        }

        return true;
    }
1235958
public function clear()
	{
		foreach( $GLOBALS[$this->poolKey] as $key => $value )
			unset( $GLOBALS[$this->poolKey][$key] );
	}
24145
public function clear()
    {
        foreach ($this->items as $item) {
            $this->deleted[] = $item;
        }

        $this->items = [];
    }
998632
public function invalidateCache(): bool
    {
        if ($this->cache !== null) {
            $this->cache->delete($this->cacheKey);
            $this->items = null;
        }

        return true;
    }
1092964
public function clear()
    {
        try {
            if (\apc_clear_cache('user')) {
                $this->_hashmap = array();

                return $this->saveHashmap();
            }
        } catch (\Exception $e) {
            $this->log('warning', sprintf('Unable to clear cache : %s', $e->getMessage()));
        }

        return false;
    }