Download the PHP package olivier-ls/binary-storage-php without Composer

On this page you can find all versions of the php package olivier-ls/binary-storage-php. 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 binary-storage-php

BinaryStorage

License PHP

BinaryStorage is a lightweight binary key/value store for PHP. It keeps all values inside a single data file and all keys inside a binary index, reducing filesystem overhead and allowing fast random-access lookups.

It is designed for projects that need simple, fast persistent storage without running Redis, SQLite, or a full database.

BinaryStorage is a fast, lightweight, zero-dependency binary key/value store for PHP (one data file, one index file).

✔️ Why use BinaryStorage?

BinaryStorage may be useful if you want:

It is not a replacement for a database, but fits well for caches, catalogs, and read-heavy workloads.

📦 Installation

composer require olivier-ls/binary-storage-php

🚀 Basic Usage

📘 API Overview

Method Description Example
open(string $store) Opens (or creates) a storage file. Must be called before reading/writing. $store->open('products');
close(string $store) Closes a storage file. $store->close('products');
closeAll() Closes all opened storage files. $store->closeAll();
set(string $store, string $key, mixed $value, ?int $ttl) Stores a value for a key (serialized automatically). $store->set('products', 'p123', $data, 3600);
setMultiple(string $store, array $items) Stores multiple values. $store->setMultiple('products', ['key' => 'value', ...])
saveIndex(string $store) Persists the in-memory index to disk (important after many writes). $store->saveIndex('products');
get(string $store, string $key) Retrieves a value by key. Returns null if the key doesn't exist. $product = $store->get('products', 'p123');
getAllKeys(string $store) Returns all keys. $keys = $store->getAllKeys('products');
delete(string $store, string $key) Deletes a value by key. $store->delete('products', 'p123');
exists(string $store, string $key) Checks whether a key exists. if ($store->exists('products', 'p123')) { ... }
startsWith(string $store, string $prefix) Returns all values where the key starts with a prefix. $list = $store->startsWith('products', 'p1');
contains(string $store, array $patterns) Returns all values where the key contains one or more substrings. $list = $store->contains('products', ['12']);
stats(string $store) Returns file statistics (sizes, fragmentation, counts). $info = $store->stats('products');
compact(string $store) Rebuilds the file and removes fragmentation. $saved = $store->compact('products');
deleteCache(string $store) Deletes both the data and index files for a store. $store->deleteCache('products');

🧰 When to use it

Good scenarios:

Less good scenarios:

🤝 Contributing

Issues and pull requests are welcome. If you find a performance bottleneck or have an idea for improved index structures, feel free to open a discussion.

📄 License

MIT


All versions of binary-storage-php with dependencies

PHP Build Version
Package Version
Requires php Version >=8.0
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 olivier-ls/binary-storage-php contains the following files

Loading the files please wait ...