当前位置: 首页>>代码示例>>PHP>>正文


PHP PMA_Index::findDuplicates方法代码示例

本文整理汇总了PHP中PMA_Index::findDuplicates方法的典型用法代码示例。如果您正苦于以下问题:PHP PMA_Index::findDuplicates方法的具体用法?PHP PMA_Index::findDuplicates怎么用?PHP PMA_Index::findDuplicates使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在PMA_Index的用法示例。


在下文中一共展示了PMA_Index::findDuplicates方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: PMA_getHtmlForIndexesProblems

/**
 * Function to get html to display problems in indexes
 *
 * @param string     $query_type     query type
 * @param array|null $selectedTables array of table names selected from the
 *                                   database structure page, for an action
 *                                   like check table, optimize table,
 *                                   analyze table or repair table
 * @param string     $db             current database
 *
 * @return string
 */
function PMA_getHtmlForIndexesProblems($query_type, $selectedTables, $db)
{
    // BEGIN INDEX CHECK See if indexes should be checked.
    if (isset($query_type) && $query_type == 'check_tbl' && isset($selectedTables) && is_array($selectedTables)) {
        $indexes_problems_html = '';
        foreach ($selectedTables as $tbl_name) {
            $check = PMA_Index::findDuplicates($tbl_name, $db);
            if (!empty($check)) {
                $indexes_problems_html .= sprintf(__('Problems with indexes of table `%s`'), $tbl_name);
                $indexes_problems_html .= $check;
            }
        }
    } else {
        $indexes_problems_html = null;
    }
    return $indexes_problems_html;
}
开发者ID:harryboulderdash,项目名称:PlayGFC,代码行数:29,代码来源:sql.lib.php

示例2: getView

 /**
  * Show index data
  *
  * @param string  $table      The table name
  * @param string  $schema     The schema name
  * @param boolean $print_mode Whether the output is for the print mode
  *
  * @return string HTML for showing index
  *
  * @access  public
  */
 public static function getView($table, $schema, $print_mode = false)
 {
     $indexes = PMA_Index::getFromTable($table, $schema);
     $no_indexes_class = count($indexes) > 0 ? ' hide' : '';
     $no_indexes = "<div class='no_indexes_defined{$no_indexes_class}'>";
     $no_indexes .= PMA_Message::notice(__('No index defined!'))->getDisplay();
     $no_indexes .= '</div>';
     if (!$print_mode) {
         $r = '<fieldset class="index_info">';
         $r .= '<legend id="index_header">' . __('Indexes');
         $r .= PMA_Util::showMySQLDocu('optimizing-database-structure');
         $r .= '</legend>';
         $r .= $no_indexes;
         if (count($indexes) < 1) {
             $r .= '</fieldset>';
             return $r;
         }
         $r .= PMA_Index::findDuplicates($table, $schema);
     } else {
         $r = '<h3>' . __('Indexes') . '</h3>';
         $r .= $no_indexes;
         if (count($indexes) < 1) {
             return $r;
         }
     }
     $r .= '<table id="table_index">';
     $r .= '<thead>';
     $r .= '<tr>';
     if (!$print_mode) {
         $r .= '<th colspan="2">' . __('Action') . '</th>';
     }
     $r .= '<th>' . __('Keyname') . '</th>';
     $r .= '<th>' . __('Type') . '</th>';
     $r .= '<th>' . __('Unique') . '</th>';
     $r .= '<th>' . __('Packed') . '</th>';
     $r .= '<th>' . __('Column') . '</th>';
     $r .= '<th>' . __('Cardinality') . '</th>';
     $r .= '<th>' . __('Collation') . '</th>';
     $r .= '<th>' . __('Null') . '</th>';
     if (PMA_MYSQL_INT_VERSION > 50500) {
         $r .= '<th>' . __('Comment') . '</th>';
     }
     $r .= '</tr>';
     $r .= '</thead>';
     $r .= '<tbody>';
     $odd_row = true;
     foreach ($indexes as $index) {
         $row_span = ' rowspan="' . $index->getColumnCount() . '" ';
         $r .= '<tr class="noclick ' . ($odd_row ? 'odd' : 'even') . '">';
         if (!$print_mode) {
             $this_params = $GLOBALS['url_params'];
             $this_params['index'] = $index->getName();
             $r .= '<td class="edit_index';
             $r .= ' ajax';
             $r .= '" ' . $row_span . '>' . '    <a class="';
             $r .= 'ajax';
             $r .= '" href="tbl_indexes.php' . PMA_URL_getCommon($this_params) . '">' . PMA_Util::getIcon('b_edit.png', __('Edit')) . '</a>' . '</td>' . "\n";
             $this_params = $GLOBALS['url_params'];
             if ($index->getName() == 'PRIMARY') {
                 $this_params['sql_query'] = 'ALTER TABLE ' . PMA_Util::backquote($table) . ' DROP PRIMARY KEY;';
                 $this_params['message_to_show'] = __('The primary key has been dropped.');
                 $js_msg = PMA_jsFormat('ALTER TABLE ' . $table . ' DROP PRIMARY KEY');
             } else {
                 $this_params['sql_query'] = 'ALTER TABLE ' . PMA_Util::backquote($table) . ' DROP INDEX ' . PMA_Util::backquote($index->getName()) . ';';
                 $this_params['message_to_show'] = sprintf(__('Index %s has been dropped.'), $index->getName());
                 $js_msg = PMA_jsFormat('ALTER TABLE ' . $table . ' DROP INDEX ' . $index->getName() . ';');
             }
             $r .= '<td ' . $row_span . '>';
             $r .= '<input type="hidden" class="drop_primary_key_index_msg"' . ' value="' . $js_msg . '" />';
             $r .= '    <a class="drop_primary_key_index_anchor';
             $r .= ' ajax';
             $r .= '" href="sql.php' . PMA_URL_getCommon($this_params) . '" >' . PMA_Util::getIcon('b_drop.png', __('Drop')) . '</a>' . '</td>' . "\n";
         }
         if (!$print_mode) {
             $r .= '<th ' . $row_span . '>' . htmlspecialchars($index->getName()) . '</th>';
         } else {
             $r .= '<td ' . $row_span . '>' . htmlspecialchars($index->getName()) . '</td>';
         }
         $r .= '<td ' . $row_span . '>' . htmlspecialchars($index->getType()) . '</td>';
         $r .= '<td ' . $row_span . '>' . $index->isUnique(true) . '</td>';
         $r .= '<td ' . $row_span . '>' . $index->isPacked(true) . '</td>';
         foreach ($index->getColumns() as $column) {
             if ($column->getSeqInIndex() > 1) {
                 $r .= '<tr class="noclick ' . ($odd_row ? 'odd' : 'even') . '">';
             }
             $r .= '<td>' . htmlspecialchars($column->getName());
             if ($column->getSubPart()) {
                 $r .= ' (' . $column->getSubPart() . ')';
             }
//.........这里部分代码省略.........
开发者ID:FilipeRamosFernandes,项目名称:phpmyadmin,代码行数:101,代码来源:Index.class.php

示例3: getView

 /**
  * Show index data
  *
  * @param   string      $table          The tablename
  * @param   array       $indexes_info   Referenced info array
  * @param   array       $indexes_data   Referenced data array
  * @param   boolean     $print_mode
  * @access  public
  * @return  array       Index collection array
  */
 public static function getView($table, $schema, $print_mode = false)
 {
     $indexes = PMA_Index::getFromTable($table, $schema);
     if (count($indexes) < 1) {
         return PMA_Message::error(__('No index defined!'))->getDisplay();
     }
     $r = '';
     $r .= '<h2>' . __('Indexes') . ': ';
     $r .= PMA_showMySQLDocu('optimization', 'optimizing-database-structure');
     $r .= '</h2>';
     $r .= '<table>';
     $r .= '<thead>';
     $r .= '<tr>';
     if (!$print_mode) {
         $r .= '<th colspan="2">' . __('Action') . '</th>';
     }
     $r .= '<th>' . __('Keyname') . '</th>';
     $r .= '<th>' . __('Type') . '</th>';
     $r .= '<th>' . __('Unique') . '</th>';
     $r .= '<th>' . __('Packed') . '</th>';
     $r .= '<th>' . __('Column') . '</th>';
     $r .= '<th>' . __('Cardinality') . '</th>';
     $r .= '<th>' . __('Collation') . '</th>';
     $r .= '<th>' . __('Null') . '</th>';
     $r .= '<th>' . __('Comment') . '</th>';
     $r .= '</tr>';
     $r .= '</thead>';
     $r .= '<tbody>';
     $odd_row = true;
     foreach ($indexes as $index) {
         $row_span = ' rowspan="' . $index->getColumnCount() . '" ';
         $r .= '<tr class="' . ($odd_row ? 'odd' : 'even') . '">';
         if (!$print_mode) {
             $this_params = $GLOBALS['url_params'];
             $this_params['index'] = $index->getName();
             $r .= '<td ' . $row_span . '>' . '    <a href="tbl_indexes.php' . PMA_generate_common_url($this_params) . '">' . PMA_getIcon('b_edit.png', __('Edit')) . '</a>' . '</td>' . "\n";
             $this_params = $GLOBALS['url_params'];
             if ($index->getName() == 'PRIMARY') {
                 $this_params['sql_query'] = 'ALTER TABLE ' . PMA_backquote($table) . ' DROP PRIMARY KEY';
                 $this_params['message_to_show'] = __('The primary key has been dropped');
                 $js_msg = PMA_jsFormat('ALTER TABLE ' . $table . ' DROP PRIMARY KEY');
             } else {
                 $this_params['sql_query'] = 'ALTER TABLE ' . PMA_backquote($table) . ' DROP INDEX ' . PMA_backquote($index->getName());
                 $this_params['message_to_show'] = sprintf(__('Index %s has been dropped'), $index->getName());
                 $js_msg = PMA_jsFormat('ALTER TABLE ' . $table . ' DROP INDEX ' . $index->getName());
             }
             $r .= '<td ' . $row_span . '>';
             $r .= '<input type="hidden" class="drop_primary_key_index_msg" value="' . $js_msg . '" />';
             $r .= '    <a ';
             if ($GLOBALS['cfg']['AjaxEnable']) {
                 $r .= 'class="drop_primary_key_index_anchor" ';
             }
             $r .= ' href="sql.php' . PMA_generate_common_url($this_params) . '" >' . PMA_getIcon('b_drop.png', __('Drop')) . '</a>' . '</td>' . "\n";
         }
         $r .= '<th ' . $row_span . '>' . htmlspecialchars($index->getName()) . '</th>';
         $r .= '<td ' . $row_span . '>' . htmlspecialchars($index->getType()) . '</td>';
         $r .= '<td ' . $row_span . '>' . $index->isUnique(true) . '</td>';
         $r .= '<td ' . $row_span . '>' . $index->isPacked(true) . '</td>';
         foreach ($index->getColumns() as $column) {
             if ($column->getSeqInIndex() > 1) {
                 $r .= '<tr class="' . ($odd_row ? 'odd' : 'even') . '">';
             }
             $r .= '<td>' . htmlspecialchars($column->getName());
             if ($column->getSubPart()) {
                 $r .= ' (' . $column->getSubPart() . ')';
             }
             $r .= '</td>';
             $r .= '<td>' . htmlspecialchars($column->getCardinality()) . '</td>';
             $r .= '<td>' . htmlspecialchars($column->getCollation()) . '</td>';
             $r .= '<td>' . htmlspecialchars($column->getNull()) . '</td>';
             if ($column->getSeqInIndex() == 1) {
                 $r .= '<td ' . $row_span . '>' . htmlspecialchars($index->getComments()) . '</td>';
             }
             $r .= '</tr>';
         }
         // end foreach $index['Sequences']
         $odd_row = !$odd_row;
     }
     // end while
     $r .= '</tbody>';
     $r .= '</table>';
     if (!$print_mode) {
         $r .= PMA_Index::findDuplicates($table, $schema);
     }
     return $r;
 }
开发者ID:BGCX262,项目名称:zuozhenshi-prego-svn-to-git,代码行数:96,代码来源:Index.class.php

示例4: getView


//.........这里部分代码省略.........
    static public function getView($table, $schema, $print_mode = false)
    {
        $indexes = PMA_Index::getFromTable($table, $schema);

        if (count($indexes) < 1) {
            return PMA_Message::warning('strNoIndex')->getDisplay();
        }

        $r = '';

        $r .= '<h2>' . $GLOBALS['strIndexes'] . ': ';
        $r .= PMA_showMySQLDocu('optimization', 'optimizing-database-structure');
        $r .= '</h2>';
        $r .= '<table>';
        $r .= '<thead>';
        $r .= '<tr>';
        if (! $print_mode) {
            $r .= '<th colspan="2">' . $GLOBALS['strAction'] . '</th>';
        }
        $r .= '<th>' . $GLOBALS['strKeyname'] . '</th>';
        $r .= '<th>' . $GLOBALS['strType'] . '</th>';
        $r .= '<th>' . $GLOBALS['strUnique'] . '</th>';
        $r .= '<th>' . $GLOBALS['strPacked'] . '</th>';
        $r .= '<th>' . $GLOBALS['strField'] . '</th>';
        $r .= '<th>' . $GLOBALS['strCardinality'] . '</th>';
        $r .= '<th>' . $GLOBALS['strCollation'] . '</th>';
        $r .= '<th>' . $GLOBALS['strNull'] . '</th>';
        $r .= '<th>' . $GLOBALS['strComment'] . '</th>';
        $r .= '</tr>';
        $r .= '</thead>';
        $r .= '<tbody>';

        $odd_row = true;
        foreach ($indexes as $index) {
            $row_span = ' rowspan="' . $index->getColumnCount() . '" ';

            $r .= '<tr class="' . ($odd_row ? 'odd' : 'even') . '">';

            if (! $print_mode) {
                $this_params = $GLOBALS['url_params'];
                $this_params['index'] = $index->getName();
                $r .= '<td ' . $row_span . '>'
                   . '    <a href="tbl_indexes.php' . PMA_generate_common_url($this_params)
                   . '">' . PMA_getIcon('b_edit.png', $GLOBALS['strEdit']) . '</a>'
                   . '</td>' . "\n";

                $this_params = $GLOBALS['url_params'];
                if ($index->getName() == 'PRIMARY') {
                    $this_params['sql_query'] = 'ALTER TABLE ' . PMA_backquote($table) . ' DROP PRIMARY KEY';
                    $this_params['zero_rows'] = $GLOBALS['strPrimaryKeyHasBeenDropped'];
                    $js_msg      = PMA_jsFormat('ALTER TABLE ' . $table . ' DROP PRIMARY KEY');
                } else {
                    $this_params['sql_query'] = 'ALTER TABLE ' . PMA_backquote($table) . ' DROP INDEX ' . PMA_backquote($index->getName());
                    $this_params['zero_rows'] = sprintf($GLOBALS['strIndexHasBeenDropped'], $index->getName());
                    $js_msg      = PMA_jsFormat('ALTER TABLE ' . $table . ' DROP INDEX ' . $index->getName());
                }

                $r .= '<td ' . $row_span . '>'
                   . '    <a href="sql.php' . PMA_generate_common_url($this_params)
                   . '" onclick="return confirmLink(this, \'' . $js_msg . '\')">'
                   . PMA_getIcon('b_drop.png', $GLOBALS['strDrop'])  . '</a>'
                   . '</td>' . "\n";
            }

            $r .= '<th ' . $row_span . '>' . htmlspecialchars($index->getName()) . '</th>';
            $r .= '<td ' . $row_span . '>' . htmlspecialchars($index->getType()) . '</td>';
            $r .= '<td ' . $row_span . '>' . $index->isUnique(true) . '</td>';
            $r .= '<td ' . $row_span . '>' . $index->isPacked(true) . '</td>';

            foreach ($index->getColumns() as $column) {
                if ($column->getSeqInIndex() > 1) {
                    $r .= '<tr class="' . ($odd_row ? 'odd' : 'even') . '">';
                }
                $r .= '<td>' . htmlspecialchars($column->getName());
                if ($column->getSubPart()) {
                    $r .= ' (' . $column->getSubPart() . ')';
                }
                $r .= '</td>';
                $r .= '<td>' . htmlspecialchars($column->getCardinality()) . '</td>';
                $r .= '<td>' . htmlspecialchars($column->getCollation()) . '</td>';
                $r .= '<td>' . htmlspecialchars($column->getNull()) . '</td>';

                if ($column->getSeqInIndex() == 1) {
                    $r .= '<td ' . $row_span . '>'
                        . htmlspecialchars($index->getComments()) . '</td>';
                }
                $r .= '</tr>';
            } // end foreach $index['Sequences']

            $odd_row = ! $odd_row;
        } // end while
        $r .= '</tbody>';
        $r .= '</table>';

        if (! $print_mode) {
            $r .= PMA_Index::findDuplicates($table, $schema);
        }

        return $r;
    }
开发者ID:blumenbach,项目名称:blumenbach-online.de,代码行数:101,代码来源:Index.class.php


注:本文中的PMA_Index::findDuplicates方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。