Download the PHP package james-draper/sqlite-key-value-store without Composer

On this page you can find all versions of the php package james-draper/sqlite-key-value-store. 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 sqlite-key-value-store

Sqlite key value store

A package for creating self-contained sqlite key-value stores held in a file.

Usage

A key-value file is managed via the \SqliteKeyValueStore\Store class. To create an instance, pass the absolute path to the key-value file into the constructor. If the file does not exist yet, the constructor will create it.

$store = \SqliteKeyValueStore\Store('/path/to/file');

There are 2 exceptions that can be thrown by the constructor:

Getting a value from the store

Values can be retrieved from the store via the get method:

$value = $store->get('key', 'default value');

If the key exists then it is returned. If it does not then the default value (second parameter) is returned instead. The default value is null if not specified. \SqliteKeyValueStore\Exception if there was an issue retrieving the key.

Setting a value to the store

Values can be added/updated to the store via the set method:

$value = $store->set('key', 'value');

If the key exists then it is updated. If it does not then it is created. \SqliteKeyValueStore\Exception if there was an issue setting the key. This method returns the instance for method chaining.

Removing a value from the store

Values can be removed from the store via the remove method:

$value = $store->remove('key');

If the key exists, then it is removed. If it does not exist then nothing happens. \SqliteKeyValueStore\Exception if there was an issue deleting the key. This method returns the instance for method chaining.

Searching the store

There are 3 ways to search the store:

// search by keys containing the substring "some_key" where "?" is a wildcard.
$matches = $store->searchKeys('?some_key?', '?');

// search by values containing the substring "some_value" where "?" is a wildcard.
$matches = $store->searchValues('?some_value?', '?');

// search by keys containing the substring "some_key"
// AND by values containing the substring "some_value"
// where "?" is a wildcard.
$matches = $store->search('?some_key?', '?some_value?', '?');

The wildcard is an optional argument that defaults to *. If it is not exactly 1 character then \SqliteKeyValueStore\Exception is thrown. Each method returns a key-value array of pairs that were matched in the store.

Backing up the store

The store can be backed up by calling backup and specifying a path to backup the database to. The path must be empty or \SqliteKeyValueStore\Exception is thrown. While backing up the database is locked, and all write operations will block until the backup is complete.

$store->backup('backup/path');

Getting the store size

The size of the store can be determined by calling getSize which returns the number of key-value pairs in the store as an integer.

$store->getSize();

All versions of sqlite-key-value-store with dependencies

PHP Build Version
Package Version
Requires php Version >=8.1.4
ext-pdo Version *
ext-pdo_sqlite 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 james-draper/sqlite-key-value-store contains the following files

Loading the files please wait ...