From f9b4e5128ad0b40627c4339b4fbf08e2457d8e66 Mon Sep 17 00:00:00 2001 From: Timothy Warren Date: Thu, 2 Feb 2012 19:07:26 -0500 Subject: [PATCH] Corrected misnamed get_dbs() methods --- src/databases/firebird.php | 9 ++++----- src/databases/mysql.php | 4 ++-- src/databases/odbc.php | 11 ++++++++++- src/databases/pgsql.php | 6 +++--- src/databases/sqlite.php | 7 +++---- 5 files changed, 22 insertions(+), 15 deletions(-) diff --git a/src/databases/firebird.php b/src/databases/firebird.php index 444e61a..9c1294c 100644 --- a/src/databases/firebird.php +++ b/src/databases/firebird.php @@ -67,14 +67,13 @@ class firebird { } /** - * Gets all the databases for the current connection + * List tables for the current database * * @return mixed */ - function get_dbs() - { - // I don't think this is possible with Firebird - return FALSE; + function get_tables() + { + //TODO: implement } } diff --git a/src/databases/mysql.php b/src/databases/mysql.php index 0b295e9..a1ba70d 100644 --- a/src/databases/mysql.php +++ b/src/databases/mysql.php @@ -49,11 +49,11 @@ class MySQL extends DB_PDO { } /** - * Returns the datbases available for the current connection + * Returns the tables available in the current database * * @return array */ - function get_dbs() + function get_tables() { $sql = "SHOW TABLES"; $res = $this->query($sql); diff --git a/src/databases/odbc.php b/src/databases/odbc.php index 7996aa0..4c1af81 100644 --- a/src/databases/odbc.php +++ b/src/databases/odbc.php @@ -26,7 +26,16 @@ class ODBC extends DB_PDO { parent::__construct("odbc:$dsn", $username, $password, $options); } - function get_dbs(){} + /** + * List tables for the current database + * + * @return mixed + */ + function get_tables() + { + //Not possible reliably with this driver + return FALSE; + } } diff --git a/src/databases/pgsql.php b/src/databases/pgsql.php index bfdcf61..fb520e7 100644 --- a/src/databases/pgsql.php +++ b/src/databases/pgsql.php @@ -44,11 +44,11 @@ class pgSQL extends DB_PDO { } /** - * Get the list of databases for the current db connection + * Get the list of tables for the current db * * @return array */ - function get_dbs() + function get_tables() { $sql = 'SELECT "tablename" FROM "pg_tables" WHERE "tablename" NOT LIKE pg\_% @@ -62,7 +62,7 @@ class pgSQL extends DB_PDO { } /** - * Get a list of views for the current db connection + * Get a list of views for the current db * * @return array */ diff --git a/src/databases/sqlite.php b/src/databases/sqlite.php index ca7ba83..822042b 100644 --- a/src/databases/sqlite.php +++ b/src/databases/sqlite.php @@ -44,14 +44,13 @@ class SQLite extends DB_PDO { } /** - * List databases for the current connection + * List tables for the current database * * @return mixed */ - function get_dbs() + function get_tables() { - // SQLite doesn't have a way of doing this - return FALSE; + //TODO: implement } }