예제 #1
0
 /**
  * Adds all non-Joomla tables to the exclusion filters
  */
 function ExcludeNonJoomla()
 {
     // Get all tables
     $db = JoomlapackAbstraction::getDatabase();
     $sql = "SHOW TABLES";
     $db->setQuery($sql);
     $tables = $db->loadRowList();
     // Get prefix
     $prefix = JoomlapackAbstraction::getDBPrefix();
     // Loop tables
     foreach ($tables as $row) {
         $table = $row[0];
         $abstractTable = str_replace($prefix, '#__', $table);
         if ($table == $abstractTable) {
             // Filter only non-Joomla tables
             $this->modifyFilter($abstractTable, true);
         }
     }
 }
예제 #2
0
 /**
  * Returns a table's abstract name (replacing the prefix with the magic #__ string)
  *
  * @param string $tableName The canonical name, e.g. 'jos_content'
  * @return string The abstract name, e.g. '#__content'
  */
 function _getAbstract($tableName)
 {
     // FIX 1.2 Stable - Handle (very rare) cases with an empty db prefix
     $prefix = JoomlapackAbstraction::getDBPrefix();
     switch ($prefix) {
         case '':
             // This is more of a hack; it assumes all tables are Joomla! tables if the prefix is empty.
             return '#__' . $tableName;
             break;
         default:
             // Normal behaviour for 99% of sites
             return str_replace($prefix, "#__", $tableName);
             break;
     }
 }