FastSitePHP\Data\KeyValue\SqliteStorage

Store Key-Value Pairs in a SQLite Database.

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

源代码

GitHub

方法

__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.

返回类型: string

set($key, $value)

Set a value for a named key.

exists($key)

Check if a key exists in the database.

返回类型: bool

remove($key)

Remove (delete) a key exists from the database.