mirror of
https://github.com/Pathduck/gallery3.git
synced 2026-04-21 21:19:18 -04:00
Add a simple/cheap test to make sure that the database config is ok. Fixes ticket #1029.
This commit is contained in:
committed by
Tim Almdal
parent
b2afba1db1
commit
7e5661cf49
@@ -24,6 +24,15 @@ if (!file_exists(VARPATH . "database.php")) {
|
||||
url::redirect(url::abs_file("installer"));
|
||||
}
|
||||
|
||||
// Simple and cheap test to make sure that the database config is ok. Do this before we do
|
||||
// anything else database related.
|
||||
try {
|
||||
Database::instance()->connect();
|
||||
} catch (Kohana_PHP_Exception $e) {
|
||||
print "Database configuration error. Please check var/database.php";
|
||||
exit;
|
||||
}
|
||||
|
||||
Event::add("system.ready", array("Gallery_I18n", "instance"));
|
||||
Event::add("system.ready", array("module", "load_modules"));
|
||||
Event::add("system.ready", array("gallery", "ready"));
|
||||
|
||||
Reference in New Issue
Block a user