Remove all caches.

@param int $count
Size of the chunk.
199922
public function resetCache($count = 100) {
    $timer = 'reset_cache';
    Timer::start($timer);

    $result = $this->queryFactory->get(self::ENTITY_TYPE)->execute();
    if (empty($result)) {
      $this->logger->info('No cache was found. Nothing to clear.');
      Timer::stop($timer);
      return;
    }

    $this->removeByChunk($result, $count);

    $msg = 'All caches were cleared. [items removed: %items, elapsed time: %time sec.]';
    $this->logger->info(
      $msg,
      [
        '%items' => count($result),
        '%time' => round(Timer::read($timer) / 1000, 1)
      ]
    );

    Timer::stop($timer);
  }
18004
@VisibleForTesting
    void removeAllCacheEntries() {
        List<CacheEntry> entries;
        synchronized (this.cacheEntries) {
            entries = new ArrayList<>(this.cacheEntries.values());
            this.cacheEntries.clear();
        }

        removeFromCache(entries);
        if (entries.size() > 0) {
            log.debug("{}: Cleared all cache entries ({}).", this.traceObjectId, entries.size());
        }
    }
1115219
public function paginate(int $count)
    {
        $this->count = $count;

        $this->treatmentPerPage();
                        
        if ($this->perPage !== null) {
            $this->nbPages = ceil($this->count / $this->perPage);
        } else {
            $this->nbPages = 1;
        }

        if ($this->getP !== null && $this->getP > 0 && $this->getP <= $this->nbPages && preg_match(self::REGEX_INTEGER, $this->getP)) {
            $this->currentPage = $this->getP;
        } else {
            $this->currentPage = 1;
        }

        $this->setLimitAndSetOffset();
    }
816723
public function emptyTo(& $colorData, $count) 
    {
        for ($i = 0; $i < $count; $i++) {
            $sampleCount = $this->samples[$i * 5 + self::IDX_COUNT];
            $a = $this->samples[$i * 5 + self::IDX_A];
            $color = $sampleCount == 0 || $a == 0 ? 0 :
                ColorUtils::from(
                    (int)($a / $sampleCount),
                    (int)($this->samples[$i * 5 + self::IDX_R] / $a),
                    (int)($this->samples[$i * 5 + self::IDX_G] / $a),
                    (int)($this->samples[$i * 5 + self::IDX_B] / $a)
                );
            
            $colorData[] = 1;
            $colorData[] = $color;
        }
        
        $this->pixelOffset = 0;
        $this->subPixelOffset = 0;
        $this->used = -1;
    }
315519
private function _deleteCache()
    {
        if ($this->_cache instanceof \Zend_Cache_Core) {
            $this->_cache->remove($this->_cacheid);
            $this->_cache->remove($this->_cacheid . 'trans');
        }
    }
1098709
public function hasExactCountOfObjects($count): bool
    {
        $this->collectObjects(true);

        return $this->getCountOfObjectsInCollection() === (int)$count;
    }
515876
public function pop($count = 1)
    {
        $newPath = $this->path->copy();
        for ($i = 0; $i < $count; ++$i) {
            $newPath->pop();
        }

        return $this->replicate(['path' => $newPath]);
    }
1059603
public function removeRange($index, $count){
		
		if($this->_ReadOnly){
			throw new ReadOnlyException(\get_called_class() . ' is read only');
		}
		
		if(!$this->offsetExists($index)){
			throw new \OutOfRangeException('$index is invalid');
		}
		
		\array_splice($this->_Arr, $index, $count);
		
		return $this;
		
	}
884078
public function cleanup($size, $rate)
    {
        // Check if overall cache size exceeds cache limit
        $result = $this->db->query('SELECT SUM(size) as size FROM metadata');
        $cacheSize = $result->fetchArray(SQLITE3_NUM);
        $cacheSize = $cacheSize[0];
        $result->finalize();

        if ($cacheSize <= $size) {
            // Cache size does not exceed cache value, so we can exit
            // immediately.
            return false;
        }

        // Otherwise clear cache values, until we pass the lower size border
        $maxSize = $size * $rate;
        $result  = $this->db->query('SELECT path, size FROM metadata ORDER BY accessed ASC');
        $removed = array();
        do {
            $row = $result->fetchArray(SQLITE3_ASSOC);
            $cacheSize -= $row['size'];
            unlink($this->root . ($removed[] = $row['path']));
        } while ($cacheSize > $maxSize);
        $result->finalize();

        // Remove entries from database
        foreach ($removed as $nr => $value) {
            $removed[$nr] = "'" . $this->db->escapeString($value) . "'";
        }
        $this->db->query('DELETE FROM metadata WHERE path IN (' . implode(', ', $removed) . ')');
    }
298920
public function remove($index)
    {
        if($index >= $this->count())
            throw new OutOfRangeException('Index out of range');

        array_splice($this->_collection, $index, 1);
    }
300041
public function limit($count, $offset = 0)
    {
        $this->limit = array((int) $count, (int) $offset);

        return $this;
    }
379214
public function update( $count ) {
		update_post_meta(
			$this->post_id,
			'_inc2734_count_cache_' . $this->service_name,
			[
				'count'      => $count,
				'expiration' => time() + (int) apply_filters( 'inc2734_wp_share_buttons_count_cache_seconds', 60 * 5 ),
			]
		);
	}
272748
public function deleteLast($value, int $count = 1): int
    {
        return $this->handle->lRem($this->name, $value, -$count);
    }
238715
public void discard(int count) {
    assert elementsCount >= count;

    elementsCount -= count;
    /* #if ($TemplateOptions.KTypeGeneric) */
    Arrays.fill(buffer, elementsCount, elementsCount + count, null);
    /* #end */
  }
303062
public function skip($count = 1)
    {
        for ($i = $count; $this->valid() && $i > 0; $i--) {
            $this->next();
        }

        return $this->valid();
    }
446552
public function setParcelCount($count)
    {
        $this->set(Config::T8905, (string)$count);
        $this->set(Config::T8702, (string)$count);

        return $this;
    }
723946
public function lremove($key, $count, $value)
    {
        try {
            return $this->redis->lremove($key, $count, $value);
        } catch (\RedisException $e) {
            die("Error!: " . $e->getMessage() . "<br/>");
        }
    }