a somewhat nicer error message for can't connect to DB
git-svn-id: file:///home/shish/svn/shimmie2/trunk@390 7f39781d-f577-437e-ae19-be835c7a54ca
This commit is contained in:
parent
86561be3ec
commit
619d18c8f3
@ -32,10 +32,26 @@ class Database {
|
|||||||
public function Database() {
|
public function Database() {
|
||||||
if(is_readable("config.php")) {
|
if(is_readable("config.php")) {
|
||||||
require_once "config.php";
|
require_once "config.php";
|
||||||
$this->db = NewADOConnection($database_dsn);
|
$this->db = @NewADOConnection($database_dsn);
|
||||||
$this->db->SetFetchMode(ADODB_FETCH_ASSOC);
|
if($this->db) {
|
||||||
$this->db->Execute("SET NAMES utf8"); // FIXME: mysql specific :|
|
$this->db->SetFetchMode(ADODB_FETCH_ASSOC);
|
||||||
$this->extensions = $this->db->GetAssoc("SELECT name, version FROM extensions");
|
$this->db->Execute("SET NAMES utf8"); // FIXME: mysql specific :|
|
||||||
|
$this->extensions = $this->db->GetAssoc("SELECT name, version FROM extensions");
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
$version = VERSION;
|
||||||
|
print "
|
||||||
|
<html>
|
||||||
|
<head>
|
||||||
|
<title>Internal error - Shimmie-$version</title>
|
||||||
|
</head>
|
||||||
|
<body>
|
||||||
|
Internal error: Could not connect to database
|
||||||
|
</body>
|
||||||
|
</html>
|
||||||
|
";
|
||||||
|
exit;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
header("Location: install.php");
|
header("Location: install.php");
|
||||||
|
Loading…
x
Reference in New Issue
Block a user