From 8eefbb2158c43b51a8c33e6c480cbe61539b9535 Mon Sep 17 00:00:00 2001 From: Aleksander Machniak <alec@alec.pl> Date: Mon, 27 Aug 2012 04:16:04 -0400 Subject: [PATCH] Add option to enable HTML editor on forwarding (#1488517) --- program/include/rcube_db_sqlite.php | 21 ++++++++++++--------- 1 files changed, 12 insertions(+), 9 deletions(-) diff --git a/program/include/rcube_db_sqlite.php b/program/include/rcube_db_sqlite.php index 1fcecd6..a9774cd 100644 --- a/program/include/rcube_db_sqlite.php +++ b/program/include/rcube_db_sqlite.php @@ -1,6 +1,6 @@ <?php -/* +/** +-----------------------------------------------------------------------+ | program/include/rcube_db_sqlite.php | | | @@ -26,8 +26,8 @@ * * This is a wrapper for the PHP PDO * - * @package Database - * @version 1.0 + * @package Database + * @version 1.0 */ class rcube_db_sqlite extends rcube_db { @@ -45,7 +45,12 @@ { // Create database file, required by PDO to exist on connection if (!empty($dsn['database']) && !file_exists($dsn['database'])) { - touch($dsn['database']); + $created = touch($dsn['database']); + + // File mode setting, for compat. with MDB2 + if (!empty($dsn['mode']) && $created) { + chmod($dsn['database'], octdec($dsn['mode'])); + } } } @@ -63,14 +68,12 @@ $data = file_get_contents(INSTALL_PATH . 'SQL/sqlite.initial.sql'); if (strlen($data)) { - if ($this->options['debug_mode']) { - $this::debug('INITIALIZE DATABASE'); - } + $this->debug('INITIALIZE DATABASE'); $q = $dbh->exec($data); if ($q === false) { - $error = $this->dbh->errorInfo(); + $error = $dbh->errorInfo(); $this->db_error = true; $this->db_error_msg = sprintf('[%s] %s', $error[1], $error[2]); @@ -134,7 +137,7 @@ /** * Returns list of columns in database table * - * @param string Table name + * @param string $table Table name * * @return array List of table cols */ -- Gitblit v1.9.1