try to recognise the DB engine *before* trying to connect...
This commit is contained in:
parent
13fb551fb3
commit
5ba28817a8
11
install.php
11
install.php
@ -164,11 +164,6 @@ function install_process($database_dsn) { // {{{
|
|||||||
header("Location: index.php");
|
header("Location: index.php");
|
||||||
} // }}}
|
} // }}}
|
||||||
function create_tables($dsn) { // {{{
|
function create_tables($dsn) { // {{{
|
||||||
$db = NewADOConnection($dsn);
|
|
||||||
if(!$db) {
|
|
||||||
die("Couldn't connect to \"$dsn\"");
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
if(substr($dsn, 0, 5) == "mysql") {
|
if(substr($dsn, 0, 5) == "mysql") {
|
||||||
$engine = new MySQL();
|
$engine = new MySQL();
|
||||||
}
|
}
|
||||||
@ -182,6 +177,12 @@ function create_tables($dsn) { // {{{
|
|||||||
die("Unknown database engine; Shimmie currently officially supports MySQL
|
die("Unknown database engine; Shimmie currently officially supports MySQL
|
||||||
(mysql://), with hacks for Postgres (pgsql://) and SQLite (sqlite://)");
|
(mysql://), with hacks for Postgres (pgsql://) and SQLite (sqlite://)");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
$db = NewADOConnection($dsn);
|
||||||
|
if(!$db) {
|
||||||
|
die("Couldn't connect to \"$dsn\"");
|
||||||
|
}
|
||||||
|
else {
|
||||||
$engine->init($db);
|
$engine->init($db);
|
||||||
|
|
||||||
$db->execute($engine->create_table_sql("aliases", "
|
$db->execute($engine->create_table_sql("aliases", "
|
||||||
|
Loading…
x
Reference in New Issue
Block a user