diff --git a/index.php b/index.php index f4cca98..c06d108 100644 --- a/index.php +++ b/index.php @@ -128,7 +128,7 @@ foreach(pdo_drivers() as $d) // Load Firebird if there is support if(function_exists('fbird_connect')) { - array_map('do_include', glob($path.'*.php')); + array_map('do_include', glob($path.'firebird/*.php')); } // -------------------------------------------------------------------------- diff --git a/nbproject/private/private.properties b/nbproject/private/private.properties new file mode 100644 index 0000000..c8d3d05 --- /dev/null +++ b/nbproject/private/private.properties @@ -0,0 +1,6 @@ +auxiliary.org-netbeans-modules-php-editor.dbconn=jdbc:derby://localhost:1527/sample [app on APP] +copy.src.files=false +copy.src.target= +index.file=index.php +run.as=SCRIPT +url=http://localhost/OpenSQLManager/ diff --git a/nbproject/private/private.xml b/nbproject/private/private.xml new file mode 100644 index 0000000..cc2c0e5 --- /dev/null +++ b/nbproject/private/private.xml @@ -0,0 +1,4 @@ + + + + diff --git a/nbproject/project.properties b/nbproject/project.properties new file mode 100644 index 0000000..e2559b2 --- /dev/null +++ b/nbproject/project.properties @@ -0,0 +1,7 @@ +include.path=${php.global.include.path} +php.version=PHP_5 +source.encoding=UTF-8 +src.dir=. +tags.asp=false +tags.short=true +web.root=. diff --git a/nbproject/project.xml b/nbproject/project.xml new file mode 100644 index 0000000..6d87a83 --- /dev/null +++ b/nbproject/project.xml @@ -0,0 +1,9 @@ + + + org.netbeans.modules.php.project + + + OpenSQLManager + + + diff --git a/sys/db/drivers/firebird/firebird_driver.php b/sys/db/drivers/firebird/firebird_driver.php index c5ca01d..4f8e93c 100644 --- a/sys/db/drivers/firebird/firebird_driver.php +++ b/sys/db/drivers/firebird/firebird_driver.php @@ -45,17 +45,6 @@ class firebird extends DB_PDO { // -------------------------------------------------------------------------- - /** - * Close the link to the database and any existing results - */ - public function __destruct() - { - @fbird_close(); - @fbird_free_result($this->statement); - } - - // -------------------------------------------------------------------------- - /** * Doesn't apply to Firebird */ diff --git a/sys/db/drivers/firebird/firebird_result.php b/sys/db/drivers/firebird/firebird_result.php index ea5a3f6..7d9cc6e 100644 --- a/sys/db/drivers/firebird/firebird_result.php +++ b/sys/db/drivers/firebird/firebird_result.php @@ -51,7 +51,7 @@ class Firebird_Result { switch($fetch_style) { case PDO::FETCH_OBJ: - return fbird_fetch_object($this->statement, IBASE_FETCH_BLOBS); + return fbird_fetch_object($this->statement, F_FETCH_BLOBS); break; case PDO::FETCH_NUM: @@ -85,6 +85,20 @@ class Firebird_Result { return $all; } + + // -------------------------------------------------------------------------- + + /** + * Emulate PDOStatement::fetchColumn + * + * @param int $colum_num + * @return mixed + */ + public function fetchColumn($column_num=0) + { + $row = $this->fetch(PDO::FETCH_NUM); + return $row[$column_num]; + } // -------------------------------------------------------------------------- diff --git a/sys/db/drivers/firebird/firebird_sql.php b/sys/db/drivers/firebird/firebird_sql.php index c7e6feb..4b4acab 100644 --- a/sys/db/drivers/firebird/firebird_sql.php +++ b/sys/db/drivers/firebird/firebird_sql.php @@ -232,10 +232,9 @@ class Firebird_SQL extends DB_SQL { public function table_list() { return <<settings->add_db($data['name'], $data); - if ( ! $res) + if ($res === FALSE) { error("Failed to add database - Connection information invalid"); } diff --git a/sys/windows/widgets/db_tabs.php b/sys/windows/widgets/db_tabs.php index 35c15a4..a59a164 100644 --- a/sys/windows/widgets/db_tabs.php +++ b/sys/windows/widgets/db_tabs.php @@ -123,7 +123,7 @@ class DB_tabs extends GTKNotebook { // 'Procedures' Tab { - self::_add_tab($conn, 'Procedures', 'Procedure name', 'get_procedures'); + self::_add_row_tab($conn, 'Procedures', 'get_procedures'); } // 'Functions' Tab @@ -289,7 +289,7 @@ class DB_tabs extends GTKNotebook { foreach($tab_data[$i] as $v) { $vals[] = ++$j; - $vals[] = $v; + $vals[] = trim($v); } call_user_func_array(array($tab_model, 'set'), $vals); @@ -308,32 +308,5 @@ class DB_tabs extends GTKNotebook { return; } - - /** - * Connects to a different database than the one currently in use - * - * @param type $view - * @param type $path - * @param type $column - * @param type $data - */ - public function _switch_db($view, $path, $column, $data=array()) - { - // Get the selected database - $new_db = $view->get(0); - - // Get existing connections - $conns = DB_REG::get_connections(); - - // Get connection info for existing connections - $conn_info = array(); - - foreach($conns as $c) - { - $conn_info[$c] = Settings::get_instance()->get_db($c); - } - - // @todo figure out how to single out the current db connection - } } // End of db_tabs.php diff --git a/tests/test_dbs/FB_TEST_DB.FDB b/tests/test_dbs/FB_TEST_DB.FDB index 5e0d1f2..5045f85 100755 Binary files a/tests/test_dbs/FB_TEST_DB.FDB and b/tests/test_dbs/FB_TEST_DB.FDB differ