Skip to content

Commit

Permalink
Reorder in alphabetical order
Browse files Browse the repository at this point in the history
Signed-off-by: Madhura Jayaratne <madhura.cj@gmail.com>
  • Loading branch information
madhuracj committed Apr 23, 2015
1 parent 95eb45f commit 9764ec4
Show file tree
Hide file tree
Showing 2 changed files with 51 additions and 43 deletions.
86 changes: 47 additions & 39 deletions libraries/operations.lib.php
Original file line number Diff line number Diff line change
Expand Up @@ -1064,74 +1064,67 @@ function PMA_getListofMaintainActionLink($is_myisam_or_aria,
) {
$html_output = '';

if ($is_myisam_or_aria || $is_innodb) {
// analyze table
if ($is_innodb || $is_myisam_or_aria || $is_berkeleydb) {
$params = array(
'sql_query' => 'CHECK TABLE '
'sql_query' => 'ANALYZE TABLE '
. PMA_Util::backquote($GLOBALS['table']),
'table_maintenance' => 'Go',
);
$html_output .= PMA_getMaintainActionlink(
__('Check table'),
$params,
$url_params,
'CHECK_TABLE'
);
}
if ($is_innodb) {
$params = array(
'sql_query' => 'ALTER TABLE '
. PMA_Util::backquote($GLOBALS['table'])
. ' ENGINE = InnoDB;'
);
$html_output .= PMA_getMaintainActionlink(
__('Defragment table'),
__('Analyze table'),
$params,
$url_params,
'InnoDB_File_Defragmenting'
'ANALYZE_TABLE'
);
}
if ($is_innodb || $is_myisam_or_aria || $is_berkeleydb) {

// check table
if ($is_myisam_or_aria || $is_innodb) {
$params = array(
'sql_query' => 'ANALYZE TABLE '
'sql_query' => 'CHECK TABLE '
. PMA_Util::backquote($GLOBALS['table']),
'table_maintenance' => 'Go',
);
$html_output .= PMA_getMaintainActionlink(
__('Analyze table'),
__('Check table'),
$params,
$url_params,
'ANALYZE_TABLE'
'CHECK_TABLE'
);
}
if ($is_myisam_or_aria && !PMA_DRIZZLE) {

// checksum table
if (! PMA_DRIZZLE) {
$params = array(
'sql_query' => 'REPAIR TABLE '
'sql_query' => 'CHECKSUM TABLE '
. PMA_Util::backquote($GLOBALS['table']),
'table_maintenance' => 'Go',
);
$html_output .= PMA_getMaintainActionlink(
__('Repair table'),
__('Checksum table'),
$params,
$url_params,
'REPAIR_TABLE'
'CHECKSUM_TABLE'
);
}
if (($is_myisam_or_aria || $is_innodb || $is_berkeleydb)
&& !PMA_DRIZZLE
) {

// defragment table
if ($is_innodb) {
$params = array(
'sql_query' => 'OPTIMIZE TABLE '
. PMA_Util::backquote($GLOBALS['table']),
'table_maintenance' => 'Go',
'sql_query' => 'ALTER TABLE '
. PMA_Util::backquote($GLOBALS['table'])
. ' ENGINE = InnoDB;'
);
$html_output .= PMA_getMaintainActionlink(
__('Optimize table'),
__('Defragment table'),
$params,
$url_params,
'OPTIMIZE_TABLE'
'InnoDB_File_Defragmenting'
);
}

// flush table
$params = array(
'sql_query' => 'FLUSH TABLE '
. PMA_Util::backquote($GLOBALS['table']),
Expand All @@ -1141,29 +1134,44 @@ function PMA_getListofMaintainActionLink($is_myisam_or_aria,
),
'reload' => 1,
);

$html_output .= PMA_getMaintainActionlink(
__('Flush the table (FLUSH)'),
$params,
$url_params,
'FLUSH'
);

if (! PMA_DRIZZLE) {
// optimize table
if (($is_myisam_or_aria || $is_innodb || $is_berkeleydb)
&& !PMA_DRIZZLE
) {
$params = array(
'sql_query' => 'CHECKSUM TABLE '
'sql_query' => 'OPTIMIZE TABLE '
. PMA_Util::backquote($GLOBALS['table']),
'table_maintenance' => 'Go',
);
$html_output .= PMA_getMaintainActionlink(
__('Checksum table'),
__('Optimize table'),
$params,
$url_params,
'CHECKSUM_TABLE'
'OPTIMIZE_TABLE'
);
}


// repair table
if ($is_myisam_or_aria && !PMA_DRIZZLE) {
$params = array(
'sql_query' => 'REPAIR TABLE '
. PMA_Util::backquote($GLOBALS['table']),
'table_maintenance' => 'Go',
);
$html_output .= PMA_getMaintainActionlink(
__('Repair table'),
$params,
$url_params,
'REPAIR_TABLE'
);
}

return $html_output;
}
Expand Down
8 changes: 4 additions & 4 deletions libraries/structure.lib.php
Original file line number Diff line number Diff line change
Expand Up @@ -330,18 +330,18 @@ function PMA_getHtmlForCheckAllTables($pmaThemeImage, $text_dir,
$html_output .= '</optgroup>';

$html_output .= '<optgroup label="' . __('Table maintenance') . '">';
$html_output .= '<option value="analyze_tbl" >'
. __('Analyze table') . '</option>' . "\n";
$html_output .= '<option value="check_tbl" >'
. __('Check table') . '</option>' . "\n";
if (!PMA_DRIZZLE) {
$html_output .= '<option value="checksum_tbl" >'
. __('Checksum table') . '</option>' . "\n";
$html_output .= '<option value="optimize_tbl" >'
. __('Optimize table') . '</option>' . "\n";
$html_output .= '<option value="repair_tbl" >'
. __('Repair table') . '</option>' . "\n";
}
$html_output .= '<option value="analyze_tbl" >'
. __('Analyze table') . '</option>' . "\n";
$html_output .= '<option value="checksum_tbl" >'
. __('Checksum table') . '</option>' . "\n";
$html_output .= '</optgroup>';

$html_output .= '<optgroup label="' . __('Prefix') . '">';
Expand Down

0 comments on commit 9764ec4

Please sign in to comment.