protected function listTables() { global $wgDBprefix; $tables = $this->db->listTables($wgDBprefix, __METHOD__); $tables = array_map(array(__CLASS__, 'unprefixTable'), $tables); // Don't duplicate test tables from the previous fataled run $tables = array_filter($tables, array(__CLASS__, 'isNotUnittest')); if ($this->db->getType() == 'sqlite') { $tables = array_flip($tables); // these are subtables of searchindex and don't need to be duped/dropped separately unset($tables['searchindex_content']); unset($tables['searchindex_segdir']); unset($tables['searchindex_segments']); $tables = array_flip($tables); } return $tables; }
/** * @since 1.18 * * @param DatabaseBase $db * * @return array */ public static function listTables($db) { global $wgDBprefix; $tables = $db->listTables($wgDBprefix, __METHOD__); if ($db->getType() === 'mysql') { # bug 43571: cannot clone VIEWs under MySQL $views = $db->listViews($wgDBprefix, __METHOD__); $tables = array_diff($tables, $views); } $tables = array_map(array(__CLASS__, 'unprefixTable'), $tables); // Don't duplicate test tables from the previous fataled run $tables = array_filter($tables, array(__CLASS__, 'isNotUnittest')); if ($db->getType() == 'sqlite') { $tables = array_flip($tables); // these are subtables of searchindex and don't need to be duped/dropped separately unset($tables['searchindex_content']); unset($tables['searchindex_segdir']); unset($tables['searchindex_segments']); $tables = array_flip($tables); } return $tables; }