diff --git a/index.php b/index.php index 9398db4..306eb07 100644 --- a/index.php +++ b/index.php @@ -26,7 +26,7 @@ error_reporting(-1 & ~(E_STRICT)); // Set the stupid timezone so PHP shuts up. date_default_timezone_set('GMT'); -// Don't set an arbitary memory limit! +// Don't set an arbitrary memory limit! ini_set('memory_limit', -1); // Set the current directory as the base for included files @@ -75,6 +75,16 @@ if( ! class_exists('pdo')) // -------------------------------------------------------------------------- +// Convert Errors to Exceptions +// Do this after the two compatibility checks for cleaner output +function exception_error_handler($errno, $errstr, $errfile, $errline) +{ + throw new ErrorException($errstr, 0, $errno, $errfile, $errline); +} +set_error_handler("exception_error_handler", -1); + +// -------------------------------------------------------------------------- + /** * Alias for require_once for array_map * diff --git a/sys/db/drivers/firebird/firebird_driver.php b/sys/db/drivers/firebird/firebird_driver.php index 7a61546..c5ca01d 100644 --- a/sys/db/drivers/firebird/firebird_driver.php +++ b/sys/db/drivers/firebird/firebird_driver.php @@ -30,14 +30,14 @@ class firebird extends DB_PDO { */ public function __construct($dbpath, $user='sysdba', $pass='masterkey') { - $this->conn = @fbird_connect($dbpath, $user, $pass, 'utf-8'); + $this->conn = fbird_connect($dbpath, $user, $pass, 'utf-8'); // Throw an exception to make this match other pdo classes - if ( ! is_resource($this->conn)) + /*if ( ! is_resource($this->conn)) { throw new PDOException(fbird_errmsg()); die(); - } + }*/ $class = __CLASS__."_sql"; $this->sql = new $class; @@ -91,8 +91,8 @@ class firebird extends DB_PDO { $this->count = 0; $this->statement_link = (isset($this->trans)) - ? @fbird_query($this->trans, $sql) - : @fbird_query($this->conn, $sql); + ? fbird_query($this->trans, $sql) + : fbird_query($this->conn, $sql); // Throw the error as a exception if ($this->statement_link === FALSE) @@ -115,7 +115,7 @@ class firebird extends DB_PDO { */ public function prepare($query, $options=NULL) { - $this->statement_link = @fbird_prepare($this->conn, $query); + $this->statement_link = fbird_prepare($this->conn, $query); // Throw the error as an exception if ($this->statement_link === FALSE) diff --git a/sys/db/drivers/firebird/firebird_sql.php b/sys/db/drivers/firebird/firebird_sql.php index bea8a03..c7e6feb 100644 --- a/sys/db/drivers/firebird/firebird_sql.php +++ b/sys/db/drivers/firebird/firebird_sql.php @@ -136,7 +136,7 @@ class Firebird_SQL extends DB_SQL { */ public function backup_structure() { - // @todo Implement Backup function + // @todo Implement Backup structure function return ''; } diff --git a/tests/test_dbs/FB_TEST_DB.FDB b/tests/test_dbs/FB_TEST_DB.FDB index af187fb..d78e6c1 100755 Binary files a/tests/test_dbs/FB_TEST_DB.FDB and b/tests/test_dbs/FB_TEST_DB.FDB differ