FastSitePHP\Data\KeyValue\SqliteStorage

Store Key-Value Pairs in a SQLite Database.

This class uses the [FastSitePHP\Data\KeyValue\StorageInterface] class interface.

Código Fuente

GitHub

Métodos

__construct($file_path)

Class Constructor

Specify a path for the SQLite Database. The database file will be created if it does not exist and the table [key_value_pairs] will be added.

get($key, $default_value = null)

Get a saved value with an optional default value if it doesn't exist or is null.

Returns: string

set($key, $value)

Set a value for a named key.

exists($key)

Check if a key exists in the database.

Returns: bool

remove($key)

Remove (delete) a key exists from the database.