diff options
Diffstat (limited to 'app')
-rw-r--r-- | app/check_setup.php | 4 | ||||
-rw-r--r-- | app/common.php | 8 |
2 files changed, 6 insertions, 6 deletions
diff --git a/app/check_setup.php b/app/check_setup.php index af830de7..d962a6f8 100644 --- a/app/check_setup.php +++ b/app/check_setup.php @@ -15,8 +15,8 @@ if (version_compare(PHP_VERSION, '5.4.0', '<')) { } // Check data folder if sqlite -if (DB_DRIVER === 'sqlite' && ! is_writable('data')) { - throw new Exception('The directory "data" must be writeable by your web server user'); +if (DB_DRIVER === 'sqlite' && ! is_writable(dirname(DB_FILENAME))) { + throw new Exception('The directory "'.dirname(DB_FILENAME).'" must be writeable by your web server user'); } // Check PDO extensions diff --git a/app/common.php b/app/common.php index da624844..c9907ce1 100644 --- a/app/common.php +++ b/app/common.php @@ -14,12 +14,12 @@ if (getenv('DATABASE_URL')) { define('DB_NAME', ltrim($dbopts["path"], '/')); } -if (file_exists('config.php')) { - require 'config.php'; +if (file_exists(__DIR__.DIRECTORY_SEPARATOR.'config.php')) { + require __DIR__.DIRECTORY_SEPARATOR.'config.php'; } -if (file_exists('data'.DIRECTORY_SEPARATOR.'config.php')) { - require 'data'.DIRECTORY_SEPARATOR.'config.php'; +if (file_exists(__DIR__.DIRECTORY_SEPARATOR.'..'.DIRECTORY_SEPARATOR.'data'.DIRECTORY_SEPARATOR.'config.php')) { + require __DIR__.DIRECTORY_SEPARATOR.'..'.DIRECTORY_SEPARATOR.'data'.DIRECTORY_SEPARATOR.'config.php'; } require __DIR__.'/constants.php'; |