From 50d515a7d690f6017d97017f1370705e1a214c27 Mon Sep 17 00:00:00 2001 From: alecpl Date: Sat, 2 May 2009 20:11:45 +0000 Subject: - some hints to use sqlite db (#1485821) --- INSTALL | 5 ++--- installer/config.php | 2 +- program/include/rcube_mdb2.php | 4 +++- 3 files changed, 6 insertions(+), 5 deletions(-) diff --git a/INSTALL b/INSTALL index 5f2f3dd60..42fd4bbef 100644 --- a/INSTALL +++ b/INSTALL @@ -70,9 +70,8 @@ RoundCube with utf-8 charset. * SQLite -------- -Sqlite requires specifically php5 (sqlite in php4 currently doesn't -work with roundcube), and you need sqlite 2 (preferably 2.8) to setup -the sqlite db (sqlite 3.x also doesn't work at the moment). Here is +You need sqlite 2 (preferably 2.8) to setup the sqlite db +(sqlite 3.x also doesn't work at the moment). Here is an example how you can setup the sqlite.db for roundcube: # sqlite -init SQL/sqlite.initial.sql sqlite.db diff --git a/installer/config.php b/installer/config.php index f72a0e820..d090312ed 100644 --- a/installer/config.php +++ b/installer/config.php @@ -269,7 +269,7 @@ echo '
'; echo $input_dbhost->show($RCI->is_post ? $_POST['_dbhost'] : $dsnw['hostspec']); echo '
'; echo $input_dbname->show($RCI->is_post ? $_POST['_dbname'] : $dsnw['database']); -echo '
'; +echo '
'; echo $input_dbuser->show($RCI->is_post ? $_POST['_dbuser'] : $dsnw['username']); echo '
'; echo $input_dbpass->show($RCI->is_post ? $_POST['_dbpass'] : $dsnw['password']); diff --git a/program/include/rcube_mdb2.php b/program/include/rcube_mdb2.php index 1c491a874..713ff4255 100644 --- a/program/include/rcube_mdb2.php +++ b/program/include/rcube_mdb2.php @@ -585,7 +585,9 @@ class rcube_mdb2 $data = file_get_contents($file_name); if (strlen($data)) - sqlite_exec($dbh->connection, $data); + if (!sqlite_exec($dbh->connection, $data, $error) || MDB2::isError($dbh)) + raise_error(array('code' => 500, 'type' => 'db', + 'line' => __LINE__, 'file' => __FILE__, 'message' => $error), TRUE, FALSE); } -- cgit v1.2.3