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(), ?)");