1
0
mirror of https://github.com/dg/dibi.git synced 2025-08-12 00:54:11 +02:00

throwing exception on connect

This commit is contained in:
David Grudl
2006-11-13 06:32:16 +00:00
parent 11b294be44
commit f447a03c96
11 changed files with 78 additions and 92 deletions

View File

@@ -53,7 +53,7 @@ abstract class DibiDriver
* @param array connect configuration
* @return bool|object DibiDriver object on success, FALSE or Exception on failure
*/
abstract static public function connect($config);
/*abstract PHP 5.2*/ static public function connect($config) {}

View File

@@ -37,18 +37,21 @@ class DibiException extends Exception
if (isset($info['message']))
$message = "$message: $info[message]";
/*
if (isset($info['sql']))
$message .= "\n[SQL] $info[sql]";
*/
/* experimental */
dibi::log($message);
if (dibi::$debug) {
echo '[dibi error] ' . $message;
if (isset($info['sql'])) dibi::dump($info['sql']);
}
parent::__construct($message);
}
public function getSql()
{
return $this->info['sql'];
return @$this->info['sql'];
}