Download the PHP package palicao/php-rebloom without Composer

On this page you can find all versions of the php package palicao/php-rebloom. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package php-rebloom

PhpRebloom

Use Redis Bloom with PHP!

Code Climate maintainability Code Climate coverage Build Status Latest Stable Version GitHub

Disclaimer: this is a very lightweight library. For a battery-included experience, please checkout: https://github.com/averias/phpredis-bloom

Install

composer require palicao/php-rebloom

Bloom Filter

A Bloom filter is a space-efficient probabilistic data structure designed to determine whether an element is present in a set. False positives are possible.

reserve

BloomFilter::reserve(string $key, float $error, int $capacity): bool

Creates an empty Bloom Filter with a given desired error ratio and initial capacity.

See https://oss.redislabs.com/redisbloom/Bloom_Commands/#bfreserve.

insert

BloomFilter::insert(string $key, string $value, ?float $error = null, ?int $capacity = null): bool

Adds an item to the Bloom Filter, creating the filter if it does not yet exist.

See https://oss.redislabs.com/redisbloom/Bloom_Commands/#bfadd and https://oss.redislabs.com/redisbloom/Bloom_Commands/#bfinsert.

insertMany

BloomFilter::insertMany(string $key, array $values, ?float $error = null, ?int $capacity = null): bool[]

Adds several items to the BloomFilter, creating the filter if it does not yet exist.

See https://oss.redislabs.com/redisbloom/Bloom_Commands/#bfmadd and https://oss.redislabs.com/redisbloom/Bloom_Commands/#bfinsert.

insertIfKeyExists

BloomFilter::insertIfKeyExists(string $key, string $value): bool

Adds an item to the Bloom Filter, only if the filter already exists.

See https://oss.redislabs.com/redisbloom/Bloom_Commands/#bfadd and https://oss.redislabs.com/redisbloom/Bloom_Commands/#bfinsert.

insertManyIfKeyExists

BloomFilter::insertManyIfKeyExists(string $key, array $values): bool[]

Adds several items to the Bloom Filter, only if the filter already exists.

See https://oss.redislabs.com/redisbloom/Bloom_Commands/#bfadd and https://oss.redislabs.com/redisbloom/Bloom_Commands/#bfinsert.

exists

BloomFilter::exists(string $key, string $value): bool

Checks if an item exists.

See https://oss.redislabs.com/redisbloom/Bloom_Commands/#bfadd.

manyExist

BloomFilter::manyExist(string $key, array $values): bool[]

Checks if many items exist.

See https://oss.redislabs.com/redisbloom/Bloom_Commands/#bfmexists.

scanDump, loadChunks and copy

BloomFilter::scanDump(string $key): array BloomFilter::loadChunks(string $key, array $chunks): void BloomFilter::copy(string $sourceKey, string $destKey): void

scanDump exports the whole Bloom Filter in an array, which can be loaded in chunks by loadChunks. The copy function, using the previous 2 functions, allows to quickly copy one Bloom Filter to a different key.

See https://oss.redislabs.com/redisbloom/Bloom_Commands/#bfscandump and https://oss.redislabs.com/redisbloom/Bloom_Commands/#bfloadchunk.

Cuckoo Filter

Cuckoo filter is similar to Bloom Filter, but it's even more space-efficient and allows deleting items.

reserve

CuckooFilter::reserve(string $key, int $capacity, ?int $bucketSize = null, ?int $maxIterations = null, ?int $expansion = null): bool

Create an empty cuckoo filter with an initial capacity. The false positive rate is fixed at about 3%, depending on how full the filter is.

See https://oss.redislabs.com/redisbloom/Cuckoo_Commands/#cfreserve.

insert

CuckooFilter::insert(string $key, string $value, bool $allowDuplicateValues = true, ?int $capacity = null): bool

Adds an item to the cuckoo filter, creating the filter if it does not exist.

See https://oss.redislabs.com/redisbloom/Cuckoo_Commands/#cfadd, https://oss.redislabs.com/redisbloom/Cuckoo_Commands/#cfaddnx, https://oss.redislabs.com/redisbloom/Cuckoo_Commands/#cfinsert, https://oss.redislabs.com/redisbloom/Cuckoo_Commands/#cfinsertnx.

insertMany

CuckooFilter::insertMany(string $key, array $values, bool $allowDuplicateValues = true, ?int $capacity = null): bool[]

Similar to the previous, adds many values to the key.

See https://oss.redislabs.com/redisbloom/Cuckoo_Commands/#cfadd, https://oss.redislabs.com/redisbloom/Cuckoo_Commands/#cfaddnx, https://oss.redislabs.com/redisbloom/Cuckoo_Commands/#cfinsert, https://oss.redislabs.com/redisbloom/Cuckoo_Commands/#cfinsertnx.

insertIfKeyExists

CuckooFilter::insertIfKeyExists(string $key, string $value, bool $allowDuplicateValues = true, ?int $capacity = null): bool

Inserts an item in a cuckoo filter, only if it exists.

See https://oss.redislabs.com/redisbloom/Cuckoo_Commands/#cfadd, https://oss.redislabs.com/redisbloom/Cuckoo_Commands/#cfaddnx, https://oss.redislabs.com/redisbloom/Cuckoo_Commands/#cfinsert, https://oss.redislabs.com/redisbloom/Cuckoo_Commands/#cfinsertnx.

insertManyIfKeyExists

CuckooFilter::insertManyIfKeyExists(string $key, array $values, bool $allowDuplicateValues = true, ?int $capacity = null): bool[]

Inserts many items in a cuckoo filter, only if it exists.

See https://oss.redislabs.com/redisbloom/Cuckoo_Commands/#cfadd, https://oss.redislabs.com/redisbloom/Cuckoo_Commands/#cfaddnx, https://oss.redislabs.com/redisbloom/Cuckoo_Commands/#cfinsert, https://oss.redislabs.com/redisbloom/Cuckoo_Commands/#cfinsertnx.

exists

CuckooFilter::exists(string $key, string $value): bool

Returns true if a cuckoo filter exists.

See https://oss.redislabs.com/redisbloom/Cuckoo_Commands/#cfexists.

delete

CuckooFilter::delete(string $key, string $value): bool

Deletes an item once in a filter.

See https://oss.redislabs.com/redisbloom/Cuckoo_Commands/#cfdel.

count

CuckooFilter::count(string $key, string $value): int

Returns the number of times an item may be in the filter.

See https://oss.redislabs.com/redisbloom/Cuckoo_Commands/#cfcount.

scanDump, loadChunks and copy

CuckooFilter::scanDump(string $key): array CuckooFilter::loadChunks(string $key, array $chunks): void CuckooFilter::copy(string $sourceKey, string $destKey): void

scanDump exports the whole Cuckoo Filter in an array, which can be loaded in chunks by loadChunks. The copy function, using the previous 2 functions, allows to quickly copy one Cuckoo Filter to a different key.

CountMinSketch

Count-Min Sketch is a probabilistic data structure that serves as a frequency table of events in a stream of data.

initByDimensions

CountMinSketch::initByDimensions(string $key, int $width, int $depth): bool

Initializes a CountMinSketch named $key with the $width and $depth provided by the user.

See https://oss.redislabs.com/redisbloom/CountMinSketch_Commands/#cmsinitbydim.

initByProbability

CountMinSketch::initByProbability(string $key, float $error, float $probability): bool

Initializes a CountMinSketch to accommodate the desired error rate and probability for inflated count.

See https://oss.redislabs.com/redisbloom/CountMinSketch_Commands/#cmsinitbyprob.

incrementBy

CountMinSketch::incrementBy(string $key, Pair ...$pairs): bool

Increments one or more items by a given value in a CountMinSketch. A Pair represents an item and the value we want to increment.

See https://oss.redislabs.com/redisbloom/CountMinSketch_Commands/#cmsincrby.

query

CountMinSketch::query(string $key, string ... $items): Pair[]

Returns the approximate count for one or more items.

See https://oss.redislabs.com/redisbloom/CountMinSketch_Commands/#cmsquery.

merge

Merges multiple CountMinSketches into one, so that the value for each item is the sum of the values in each sketch. The $sourceKeysWeightMap is an associative array where each key is a sketch, and the value is the weight, that is the value we want each item count to be multiplied by before merging.

CountMinSketch::merge(string $destinationKey, array $sourceKeysWeightMap) : bool

See https://oss.redislabs.com/redisbloom/CountMinSketch_Commands/#cmsmerge.

info

Returns an instance of CountMinSketchInfo, which contains information regarding width, depth and total count of the sketch.

CountMinSketch::info(string $key): CountMinSketchInfo

See https://oss.redislabs.com/redisbloom/CountMinSketch_Commands/#cmsinfo.

TopK

Similar to CountMinSketch, is based on the algorithm described here: https://www.usenix.org/conference/atc18/presentation/gong

reserve

TopK::reserve(string $key, int $topK, int $width, int $depth, float $decay): bool

Reserves a TopK suitable to calculate $topK top elements, with a given $width and $depth and with a specified $decay (probability of reducing a counter in an occupied bucket).

See https://oss.redislabs.com/redisbloom/TopK_Commands/#topkreserve.

add

Adds one or more item to the TooK. If an item enters the Top-K list, the item which is expelled is returned in the position that was occupied by the added item that took its place in the Top-K.

TopK::add(string $key, string ... $items): array

See https://oss.redislabs.com/redisbloom/TopK_Commands/#topkadd.

incrementBy

Increase the score of an item in the data structure by increment. Similar to add, expelled items are returned.

TopK::incrementBy(string $key, Pair ...$pairs): array

See https://oss.redislabs.com/redisbloom/TopK_Commands/#topkincrby.

query

Returns subset of $items containing the elements found in the Top-K.

TopK::query(string $key, string ... $items): string[]

See https://oss.redislabs.com/redisbloom/TopK_Commands/#topkquery.

count

Returns a subset of $items containing the elements found in the top-k with their approximate count.

TopK::count(string $key, string ... $items): Pair[]

See https://oss.redislabs.com/redisbloom/TopK_Commands/#topkcount.

list

Returns the top-k items with their relative position.

TopK::list(string $key): Pair[]

See https://oss.redislabs.com/redisbloom/TopK_Commands/#topklist.

info

Returns a TopKInfo object containing information about size, with, depth and decay of the Top-K

TopK::info(string $key): TopKInfo

See https://oss.redislabs.com/redisbloom/TopK_Commands/#topkinfo.


All versions of php-rebloom with dependencies

PHP Build Version
Package Version
Requires php Version >=7.2.0
ext-redis Version *
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package palicao/php-rebloom contains the following files

Loading the files please wait ....