Ignore:
Timestamp:
Apr 1, 2010 2:25:29 AM (3 years ago)
Author:
alec
Message:
  • Use MDB2's Manager module for listing tables
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/roundcubemail/program/include/rcube_mdb2.php

    r3450 r3456  
    405405    // get tables if not cached 
    406406    if (!$this->tables) { 
    407       $this->tables = array(); 
    408  
    409       switch ($this->db_provider) { 
    410         case 'sqlite': 
    411           $result = $this->db_handle->query("SELECT name FROM sqlite_master WHERE type='table'"); 
    412           break; 
    413         default: 
    414           $result = $this->db_handle->query("SHOW TABLES"); 
    415       } 
    416  
    417       if ($result !== false && !PEAR::isError($result)) 
    418         while ($rec = $result->fetchRow(MDB2_FETCHMODE_ORDERED)) 
    419           $this->tables[] = $rec[0]; 
     407      $this->db_handle->loadModule('Manager'); 
     408      if (!PEAR::isError($result = $this->db_handle->listTables())) 
     409        $this->tables = $result; 
     410      else 
     411        $this->tables = array(); 
    420412    } 
    421413 
Note: See TracChangeset for help on using the changeset viewer.