From d168f3a06f7b47364f3d51f8b4fff5dbf059b29d Mon Sep 17 00:00:00 2001 From: Dominique Fournier Date: Fri, 20 Jun 2014 11:16:42 +0000 Subject: [PATCH] Force the SQLite database file in 0666 mode to be readable from CLI or Web site git-svn-id: https://svn.fournier38.fr/svn/ProgSVN/trunk@1473 bf3deb0d-5f1a-0410-827f-c0cc1f45334c --- dblayer.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/dblayer.php b/dblayer.php index 3db25cd..0de5175 100644 --- a/dblayer.php +++ b/dblayer.php @@ -136,7 +136,7 @@ class dblayer extends PDO @param string|null $password Password to connect @param string|null $driver_options Driver options to the database */ public function __construct ($dsn, $username=null, $password=null, - $driver_options=null) + $driver_options=null) { try { @@ -161,6 +161,7 @@ class dblayer extends PDO if (file_exists ($file) && ! is_writeable ($file)) throw new Exception (_("The SQLite database file is write protected"), 500); + chmod ($file, 0666); // Force ForeignKeys support (disabled by default) $this->db->exec("PRAGMA foreign_keys = ON"); break;