Skip to content

Commit

Permalink
Add a simple/cheap test to make sure that the database config is ok. …
Browse files Browse the repository at this point in the history
…Fixes ticket #1029.
  • Loading branch information
bharat authored and Tim Almdal committed Jun 15, 2010
1 parent b2afba1 commit 7e5661c
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions modules/gallery/hooks/init_gallery.php
Expand Up @@ -24,6 +24,15 @@
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"));
Expand Down

0 comments on commit 7e5661c

Please sign in to comment.