diff --git a/check_setup.php b/check_setup.php old mode 100644 new mode 100755 index 7e378b1..cf02c34 --- a/check_setup.php +++ b/check_setup.php @@ -5,11 +5,6 @@ if (! is_writable('cache')) { die('The directory "cache" must be writeable by your web server user'); } -// Check if /db is writeable -if (! is_writable('db') && STORAGE === 'sqlite') { - die('The directory "db" must be writeable by your web server user'); -} - // install folder still present, need to install wallabag if (is_dir('install')) { require('install/index.php'); diff --git a/inc/poche/Database.class.php b/inc/poche/Database.class.php index 2c80b64..dfd7ae3 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; diff --git a/index.php b/index.php index f191d7e..39990d5 100755 --- a/index.php +++ b/index.php @@ -10,8 +10,8 @@ define ('POCHE', '1.8.0'); require 'check_essentials.php'; -require_once 'inc/poche/global.inc.php'; require 'check_setup.php'; +require_once 'inc/poche/global.inc.php'; // Start session Session::$sessionName = 'wallabag';