diff --git a/sys/common/db_pdo.php b/sys/common/db_pdo.php index 70a69c2..011b7b3 100644 --- a/sys/common/db_pdo.php +++ b/sys/common/db_pdo.php @@ -105,7 +105,7 @@ abstract class DB_PDO extends PDO { */ public function get_query_data($statement) { - $this->statement =& $statement; + $this->statement = $statement; // Execute the query $this->statement->execute(); diff --git a/sys/common/query_builder.php b/sys/common/query_builder.php index 371199d..be95e2b 100644 --- a/sys/common/query_builder.php +++ b/sys/common/query_builder.php @@ -64,14 +64,7 @@ class Query_Builder { break; case "firebird": - if(in_array('firebird', pdo_drivers())) - { - $this->db = new $dbtype("host={$params->host};dbname={$params->file}", $params->user, $params->pass); - } - else - { - $this->db = new $dbtype("{$params->host}:{$params->file}", $params->user, $params->pass); - } + $this->db = new $dbtype("{$params->host}:{$params->file}", $params->user, $params->pass); break; } } diff --git a/sys/databases/firebird.php b/sys/databases/firebird.php index 1412df2..1461b91 100644 --- a/sys/databases/firebird.php +++ b/sys/databases/firebird.php @@ -21,7 +21,7 @@ class Firebird extends DB_PDO { */ public function __construct($dbpath, $user='sysdba', $pass='masterkey') { - parent::__construct("firebird:dbname={$dbpath}", $user, $pass); + parent::__construct("firebird:{$dbpath}", $user, $pass); $class = __CLASS__."_sql"; $this->sql = new $class; @@ -60,7 +60,7 @@ SQL; $tables = array(); - while($row = $this->statement->fetch(PDO::FETCH_ASSOC)) + while($row = $this->fetch(PDO::FETCH_ASSOC)) { $tables[] = $row['RDB$RELATION_NAME']; } @@ -87,7 +87,7 @@ SQL; $tables = array(); - while($row = $this->statement->fetch(PDO::FETCH_ASSOC)) + while($row = $this->fetch(PDO::FETCH_ASSOC)) { $tables[] = $row['RDB$RELATION_NAME']; } @@ -111,7 +111,7 @@ SQL; } //Fetch all the rows for the result - $this->result = $this->statement->fetchAll(); + $this->result = $this->fetchAll(); return count($this->result); } @@ -163,7 +163,7 @@ SQL; { $sql = 'SELECT * FROM "'.trim($t).'"'; $res = $this->query($sql); - $obj_res = $res->fetchAll(PDO::FETCH_ASSOC); + $obj_res = $this->fetchAll(PDO::FETCH_ASSOC); unset($res); diff --git a/tests/databases/firebird.php b/tests/databases/firebird.php index 8a7a07b..507a6eb 100644 --- a/tests/databases/firebird.php +++ b/tests/databases/firebird.php @@ -38,7 +38,7 @@ class FirebirdTest extends UnitTestCase { function tearDown() { - //unset($this->db); + unset($this->db); unset($this->tables); } @@ -98,8 +98,8 @@ class FirebirdTest extends UnitTestCase { INSERT INTO "create_test" ("id", "key", "val") VALUES (?,?,?) SQL; - $query = $this->db->prepare($sql); - $query->execute(array(1,"booger's", "Gross")); + $this->db->prepare($sql); + $this->db->execute(array(1,"booger's", "Gross")); } diff --git a/tests/index.php b/tests/index.php index b1d8f62..99dc92a 100644 --- a/tests/index.php +++ b/tests/index.php @@ -41,11 +41,6 @@ $test_path = "./databases/"; foreach(pdo_drivers() as $d) { - if($d === 'firebird') - { - continue; - } - $src_file = "{$src_path}{$d}.php"; if(is_file($src_file)) @@ -57,7 +52,7 @@ foreach(pdo_drivers() as $d) } // Load Firebird if there is support -if(function_exists('ibase_connect'))// && ! in_array('firebird', pdo_drivers())) +if(function_exists('ibase_connect') && ! in_array('firebird', pdo_drivers())) { require_once("{$src_path}firebird-ibase.php"); require_once("{$src_path}firebird_sql.php"); diff --git a/tests/test_dbs/FB_TEST_DB.FDB b/tests/test_dbs/FB_TEST_DB.FDB index 9372bee..7e44e4f 100755 Binary files a/tests/test_dbs/FB_TEST_DB.FDB and b/tests/test_dbs/FB_TEST_DB.FDB differ