summaryrefslogtreecommitdiff
path: root/roundcubemail/program/include
diff options
context:
space:
mode:
authoralec <alec@208e9e7b-5314-0410-a742-e7e81cd9613c>2010-04-01 06:25:29 +0000
committeralec <alec@208e9e7b-5314-0410-a742-e7e81cd9613c>2010-04-01 06:25:29 +0000
commit0974e0b74319af2181c607ad1ed055eba56b659d (patch)
treeb0d3d7cc13e27ff8669ff4663658a428301c200b /roundcubemail/program/include
parent10696617ca62e008d951af52861567357e7ca65c (diff)
- Use MDB2's Manager module for listing tables
git-svn-id: https://svn.roundcube.net/trunk@3456 208e9e7b-5314-0410-a742-e7e81cd9613c
Diffstat (limited to 'roundcubemail/program/include')
-rw-r--r--roundcubemail/program/include/rcube_mdb2.php18
1 files changed, 5 insertions, 13 deletions
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;