1
0
Fork 0
mirror of https://github.com/sbrl/Pepperminty-Wiki.git synced 2024-11-21 16:13:00 +00:00

lib-storage-box: make more robust

I have no idea what's going on here
This commit is contained in:
Starbeamrainbowlabs 2022-02-27 15:35:01 +00:00
parent 0ecc874fc1
commit d99ca1685c
Signed by: sbrl
GPG key ID: 1BE5172E637709C2

View file

@ -5,7 +5,7 @@
register_module([ register_module([
"name" => "Library: Storage box", "name" => "Library: Storage box",
"version" => "0.13", "version" => "0.13.1",
"author" => "Starbeamrainbowlabs", "author" => "Starbeamrainbowlabs",
"description" => "A library module that provides a fast cached key-value store backed by SQLite. Used by the search engine.", "description" => "A library module that provides a fast cached key-value store backed by SQLite. Used by the search engine.",
"id" => "lib-storage-box", "id" => "lib-storage-box",
@ -59,7 +59,7 @@ class StorageBox {
$this->db = new \PDO("sqlite:$filename_db"); // HACK: This might not work on some systems, because it depends on the current working directory $this->db = new \PDO("sqlite:$filename_db"); // HACK: This might not work on some systems, because it depends on the current working directory
$this->db->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION); $this->db->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);
if($firstrun) { if($firstrun) {
$this->query("CREATE TABLE store (key TEXT UNIQUE NOT NULL, value TEXT)"); $this->query("CREATE TABLE IF NOT EXISTS store (key TEXT UNIQUE NOT NULL, value TEXT)");
} }
} }
/** /**