From 0974e0b74319af2181c607ad1ed055eba56b659d Mon Sep 17 00:00:00 2001 From: alec Date: Thu, 1 Apr 2010 06:25:29 +0000 Subject: - Use MDB2's Manager module for listing tables git-svn-id: https://svn.roundcube.net/trunk@3456 208e9e7b-5314-0410-a742-e7e81cd9613c --- roundcubemail/program/include/rcube_mdb2.php | 18 +++++------------- 1 file changed, 5 insertions(+), 13 deletions(-) (limited to 'roundcubemail/program/include') diff --git a/roundcubemail/program/include/rcube_mdb2.php b/roundcubemail/program/include/rcube_mdb2.php index 2f4ea26a4..876659c2c 100644 --- a/roundcubemail/program/include/rcube_mdb2.php +++ b/roundcubemail/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; -- cgit v1.2.3