From 211068ce504c48ee95e742a12ec04f16f3988c6c Mon Sep 17 00:00:00 2001 From: Maryana Rozhankivska Date: Thu, 21 Aug 2014 17:17:36 +0300 Subject: vendor dir is not accessible before install, sqlite db dir write check moved into db class --- inc/poche/Database.class.php | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'inc') diff --git a/inc/poche/Database.class.php b/inc/poche/Database.class.php index 2c80b64b..dfd7ae34 100755 --- a/inc/poche/Database.class.php +++ b/inc/poche/Database.class.php @@ -23,6 +23,10 @@ class Database { { switch (STORAGE) { case 'sqlite': + // Check if /db is writeable + if ( !is_writable(STORAGE_SQLITE) || !is_writable(dirname(STORAGE_SQLITE))) { + die('An error occured: "db" directory must be writeable for your web server user!'); + } $db_path = 'sqlite:' . STORAGE_SQLITE; $this->handle = new PDO($db_path); break; -- cgit v1.2.3