diff options
author | alecpl <alec@alec.pl> | 2010-04-01 06:25:29 +0000 |
---|---|---|
committer | alecpl <alec@alec.pl> | 2010-04-01 06:25:29 +0000 |
commit | cbde304b98e4e0fc2ff33fd84068d63ae3e86c45 (patch) | |
tree | 54c8037b51cb78b9c6b4a9a792df48098e585be0 /program | |
parent | 04adaac71b863e8b13303b945ac433b03644ed3f (diff) |
- Use MDB2's Manager module for listing tables
Diffstat (limited to 'program')
-rw-r--r-- | program/include/rcube_mdb2.php | 18 |
1 files changed, 5 insertions, 13 deletions
diff --git a/program/include/rcube_mdb2.php b/program/include/rcube_mdb2.php index 2f4ea26a4..876659c2c 100644 --- a/program/include/rcube_mdb2.php +++ b/program/include/rcube_mdb2.php @@ -404,19 +404,11 @@ class rcube_mdb2 { // get tables if not cached if (!$this->tables) { - $this->tables = array(); - - switch ($this->db_provider) { - case 'sqlite': - $result = $this->db_handle->query("SELECT name FROM sqlite_master WHERE type='table'"); - break; - default: - $result = $this->db_handle->query("SHOW TABLES"); - } - - if ($result !== false && !PEAR::isError($result)) - while ($rec = $result->fetchRow(MDB2_FETCHMODE_ORDERED)) - $this->tables[] = $rec[0]; + $this->db_handle->loadModule('Manager'); + if (!PEAR::isError($result = $this->db_handle->listTables())) + $this->tables = $result; + else + $this->tables = array(); } return $this->tables; |