Permalink
Browse files

Throw an exception if base or database config is not found

  • Loading branch information...
Alexander Pánek
Alexander Pánek committed Mar 21, 2013
1 parent 3ad8196 commit 181b4878ce18b22b046bf886a613f982f9ed9234
Showing with 5 additions and 1 deletion.
  1. +4 −0 lib/Bacon/DB.php
  2. +1 −1 lib/boot.php
@@ -61,6 +61,10 @@ public static function setLog ($log)
*/
public static function __getInstance ($name = 'default', array $config = NULL)
{
if (!class_exists('\Config\Database')) {
throw new \Exception('You are trying to use the database, but there was no database configuration found in Config/Database.php! Aborting.');
}
if (!is_string($name)) {
static::$static_log->error('Wrong db instance parameter: ' . $name);
@@ -18,7 +18,7 @@
ini_set('display_errors', 'stdout');
if (!class_exists('\Config\Base')) {
// TODO: Output something like "copy the Base.sample.php to Base.php"
throw new \Exception('There was no base configuration found in Config/Base.php! Aborting.');
}
$config = Ar([

0 comments on commit 181b487

Please sign in to comment.