From bf2fdffc752a4f3f2651d587b9fadeeb4fee0082 Mon Sep 17 00:00:00 2001 From: Shish Date: Thu, 16 Jul 2009 20:44:04 +0100 Subject: [PATCH] re-initialise the database after re-opening the connection (allows sqlite to use now()) --- install.php | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/install.php b/install.php index 445afa44..6d9563d8 100644 --- a/install.php +++ b/install.php @@ -217,6 +217,21 @@ function insert_defaults($dsn) { // {{{ die("Couldn't connect to \"$dsn\""); } else { + if(substr($dsn, 0, 5) == "mysql") { + $engine = new MySQL(); + } + else if(substr($dsn, 0, 5) == "pgsql") { + $engine = new PostgreSQL(); + } + else if(substr($dsn, 0, 6) == "sqlite") { + $engine = new SQLite(); + } + else { + die("Unknown database engine; Shimmie currently officially supports MySQL + (mysql://), with hacks for Postgres (pgsql://) and SQLite (sqlite://)"); + } + $engine->init($db); + $config_insert = $db->Prepare("INSERT INTO config(name, value) VALUES(?, ?)"); $user_insert = $db->Prepare("INSERT INTO users(name, pass, joindate, admin) VALUES(?, ?, now(), ?)");