Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

fix coding style

  • Loading branch information...
commit 4a5e87186b4f0324f89f5a2ed3d8990044ec32db 1 parent f196b48
Dieter Adriaenssens ruleant authored

Showing 2 changed files with 62 additions and 33 deletions. Show diff stats Hide diff stats

  1. +14 9 server_status.php
  2. +48 24 tbl_operations.php
23 server_status.php
@@ -61,7 +61,8 @@
61 61 $queries = PMA_DBI_fetch_result(
62 62 "SHOW GLOBAL STATUS
63 63 WHERE (Variable_name LIKE 'Com_%' OR Variable_name = 'Questions')
64   - AND Value > 0", 0, 1);
  64 + AND Value > 0", 0, 1
  65 + );
65 66 }
66 67 cleanDeprecated($queries);
67 68 // admin commands are not queries
@@ -83,7 +84,8 @@
83 84 $traffic = PMA_DBI_fetch_result(
84 85 "SHOW GLOBAL STATUS
85 86 WHERE Variable_name = 'Bytes_received'
86   - OR Variable_name = 'Bytes_sent'", 0, 1);
  87 + OR Variable_name = 'Bytes_sent'", 0, 1
  88 + );
87 89
88 90 $ret = array(
89 91 'x' => microtime(true) * 1000,
@@ -943,12 +945,12 @@ function printQueryStatistics()
943 945 echo '<br />';
944 946
945 947 echo '&oslash; ' . __('per minute') . ': ';
946   - echo PMA_formatNumber( $total_queries * 60 / $server_status['Uptime'], 0);
  948 + echo PMA_formatNumber($total_queries * 60 / $server_status['Uptime'], 0);
947 949 echo '<br />';
948 950
949 951 if ($total_queries / $server_status['Uptime'] >= 1) {
950 952 echo '&oslash; ' . __('per second') . ': ';
951   - echo PMA_formatNumber( $total_queries / $server_status['Uptime'], 0);
  953 + echo PMA_formatNumber($total_queries / $server_status['Uptime'], 0);
952 954 }
953 955 ?>
954 956 </span>
@@ -1038,22 +1040,25 @@ function printServerTraffic()
1038 1040 * starttime calculation
1039 1041 */
1040 1042 $start_time = PMA_DBI_fetch_value(
1041   - 'SELECT UNIX_TIMESTAMP() - ' . $server_status['Uptime']);
  1043 + 'SELECT UNIX_TIMESTAMP() - ' . $server_status['Uptime']
  1044 + );
1042 1045
1043 1046 ?>
1044 1047 <h3><?php
1045 1048 echo sprintf(
1046 1049 __('Network traffic since startup: %s'),
1047   - implode(' ', PMA_formatByteDown( $server_status['Bytes_received'] + $server_status['Bytes_sent'], 3, 1))
1048   - );
  1050 + implode(' ', PMA_formatByteDown($server_status['Bytes_received'] + $server_status['Bytes_sent'], 3, 1))
  1051 + );
1049 1052 ?>
1050 1053 </h3>
1051 1054
1052 1055 <p>
1053 1056 <?php
1054   - echo sprintf(__('This MySQL server has been running for %1$s. It started up on %2$s.'),
  1057 + echo sprintf(
  1058 + __('This MySQL server has been running for %1$s. It started up on %2$s.'),
1055 1059 PMA_timespanFormat($server_status['Uptime']),
1056   - PMA_localisedDate($start_time)) . "\n";
  1060 + PMA_localisedDate($start_time)
  1061 + ) . "\n";
1057 1062 ?>
1058 1063 </p>
1059 1064
72 tbl_operations.php
@@ -380,8 +380,10 @@
380 380
381 381 <!-- Table character set -->
382 382 <tr><td><?php echo __('Collation'); ?></td>
383   - <td><?php echo PMA_generateCharsetDropdownBox(PMA_CSDROPDOWN_COLLATION,
384   - 'tbl_collation', null, $tbl_collation, false, 3); ?>
  383 + <td><?php echo PMA_generateCharsetDropdownBox(
  384 + PMA_CSDROPDOWN_COLLATION,
  385 + 'tbl_collation', null, $tbl_collation, false, 3
  386 + ); ?>
385 387 </td>
386 388 </tr>
387 389 <?php
@@ -598,11 +600,13 @@
598 600 // Note: BERKELEY (BDB) is no longer supported, starting with MySQL 5.1
599 601 if ($is_myisam_or_aria || $is_innodb || $is_berkeleydb) {
600 602 if ($is_myisam_or_aria || $is_innodb) {
601   - $this_url_params = array_merge($url_params,
  603 + $this_url_params = array_merge(
  604 + $url_params,
602 605 array(
603 606 'sql_query' => 'CHECK TABLE ' . PMA_backquote($GLOBALS['table']),
604 607 'table_maintenance' => 'Go',
605   - ));
  608 + )
  609 + );
606 610 ?>
607 611 <li><a class='maintain_action' href="tbl_operations.php<?php echo PMA_generate_common_url($this_url_params); ?>">
608 612 <?php echo __('Check table'); ?></a>
@@ -611,8 +615,10 @@
611 615 <?php
612 616 }
613 617 if ($is_innodb) {
614   - $this_url_params = array_merge($url_params,
615   - array('sql_query' => 'ALTER TABLE ' . PMA_backquote($GLOBALS['table']) . ' ENGINE = InnoDB'));
  618 + $this_url_params = array_merge(
  619 + $url_params,
  620 + array('sql_query' => 'ALTER TABLE ' . PMA_backquote($GLOBALS['table']) . ' ENGINE = InnoDB')
  621 + );
616 622 ?>
617 623 <li><a class='maintain_action' href="sql.php<?php echo PMA_generate_common_url($this_url_params); ?>">
618 624 <?php echo __('Defragment table'); ?></a>
@@ -621,11 +627,13 @@
621 627 <?php
622 628 }
623 629 if ($is_myisam_or_aria || $is_berkeleydb) {
624   - $this_url_params = array_merge($url_params,
  630 + $this_url_params = array_merge(
  631 + $url_params,
625 632 array(
626 633 'sql_query' => 'ANALYZE TABLE ' . PMA_backquote($GLOBALS['table']),
627 634 'table_maintenance' => 'Go',
628   - ));
  635 + )
  636 + );
629 637 ?>
630 638 <li><a class='maintain_action' href="tbl_operations.php<?php echo PMA_generate_common_url($this_url_params); ?>">
631 639 <?php echo __('Analyze table'); ?></a>
@@ -634,11 +642,13 @@
634 642 <?php
635 643 }
636 644 if ($is_myisam_or_aria && !PMA_DRIZZLE) {
637   - $this_url_params = array_merge($url_params,
  645 + $this_url_params = array_merge(
  646 + $url_params,
638 647 array(
639 648 'sql_query' => 'REPAIR TABLE ' . PMA_backquote($GLOBALS['table']),
640 649 'table_maintenance' => 'Go',
641   - ));
  650 + )
  651 + );
642 652 ?>
643 653 <li><a class='maintain_action' href="tbl_operations.php<?php echo PMA_generate_common_url($this_url_params); ?>">
644 654 <?php echo __('Repair table'); ?></a>
@@ -647,11 +657,13 @@
647 657 <?php
648 658 }
649 659 if (($is_myisam_or_aria || $is_innodb || $is_berkeleydb) && !PMA_DRIZZLE) {
650   - $this_url_params = array_merge($url_params,
  660 + $this_url_params = array_merge(
  661 + $url_params,
651 662 array(
652 663 'sql_query' => 'OPTIMIZE TABLE ' . PMA_backquote($GLOBALS['table']),
653 664 'table_maintenance' => 'Go',
654   - ));
  665 + )
  666 + );
655 667 ?>
656 668 <li><a class='maintain_action' href="tbl_operations.php<?php echo PMA_generate_common_url($this_url_params); ?>">
657 669 <?php echo __('Optimize table'); ?></a>
@@ -660,13 +672,17 @@
660 672 <?php
661 673 }
662 674 } // end MYISAM or BERKELEYDB case
663   -$this_url_params = array_merge($url_params,
  675 +$this_url_params = array_merge(
  676 + $url_params,
664 677 array(
665 678 'sql_query' => 'FLUSH TABLE ' . PMA_backquote($GLOBALS['table']),
666   - 'message_to_show' => sprintf(__('Table %s has been flushed'),
667   - htmlspecialchars($GLOBALS['table'])),
  679 + 'message_to_show' => sprintf(
  680 + __('Table %s has been flushed'),
  681 + htmlspecialchars($GLOBALS['table'])
  682 + ),
668 683 'reload' => 1,
669   - ));
  684 + )
  685 +);
670 686 ?>
671 687 <li><a class='maintain_action' href="sql.php<?php echo PMA_generate_common_url($this_url_params); ?>">
672 688 <?php echo __('Flush the table (FLUSH)'); ?></a>
@@ -684,13 +700,15 @@
684 700 <?php
685 701 if (! $tbl_is_view && ! (isset($db_is_information_schema) && $db_is_information_schema)) {
686 702 $this_sql_query = 'TRUNCATE TABLE ' . PMA_backquote($GLOBALS['table']);
687   - $this_url_params = array_merge($url_params,
  703 + $this_url_params = array_merge(
  704 + $url_params,
688 705 array(
689 706 'sql_query' => $this_sql_query,
690 707 'goto' => 'tbl_structure.php',
691 708 'reload' => '1',
692 709 'message_to_show' => sprintf(__('Table %s has been emptied'), htmlspecialchars($table)),
693   - ));
  710 + )
  711 + );
694 712 ?>
695 713 <li><a href="sql.php<?php echo PMA_generate_common_url($this_url_params); ?>" <?php echo ($GLOBALS['cfg']['AjaxEnable'] ? 'id="truncate_tbl_anchor" class="ajax"' : ''); ?>>
696 714 <?php echo __('Empty the table (TRUNCATE)'); ?></a>
@@ -700,7 +718,8 @@
700 718 }
701 719 if (! (isset($db_is_information_schema) && $db_is_information_schema)) {
702 720 $this_sql_query = 'DROP TABLE ' . PMA_backquote($GLOBALS['table']);
703   - $this_url_params = array_merge($url_params,
  721 + $this_url_params = array_merge(
  722 + $url_params,
704 723 array(
705 724 'sql_query' => $this_sql_query,
706 725 'goto' => 'db_operations.php',
@@ -710,7 +729,8 @@
710 729 // table name is needed to avoid running
711 730 // PMA_relationsCleanupDatabase() on the whole db later
712 731 'table' => $GLOBALS['table'],
713   - ));
  732 + )
  733 + );
714 734 ?>
715 735 <li><a href="sql.php<?php echo PMA_generate_common_url($this_url_params); ?>" <?php echo ($GLOBALS['cfg']['AjaxEnable'] ? 'id="drop_tbl_anchor"' : ''); ?>>
716 736 <?php echo __('Delete the table (DROP)'); ?></a>
@@ -756,10 +776,12 @@
756 776 echo PMA_showMySQLDocu('partitioning_maintenance', 'partitioning_maintenance');
757 777 // I'm not sure of the best way to display that; this link does
758 778 // not depend on the Go button
759   - $this_url_params = array_merge($url_params,
  779 + $this_url_params = array_merge(
  780 + $url_params,
760 781 array(
761 782 'sql_query' => 'ALTER TABLE ' . PMA_backquote($GLOBALS['table']) . ' REMOVE PARTITIONING'
762   - ));
  783 + )
  784 + );
763 785 ?>
764 786 <br /><a href="sql.php<?php echo PMA_generate_common_url($this_url_params); ?>">
765 787 <?php echo __('Remove partitioning'); ?></a>
@@ -810,8 +832,10 @@
810 832 . ' IS NULL AND '
811 833 . PMA_backquote($GLOBALS['table']) . '.' . PMA_backquote($master)
812 834 . ' IS NOT NULL';
813   - $this_url_params = array_merge($url_params,
814   - array('sql_query' => $join_query));
  835 + $this_url_params = array_merge(
  836 + $url_params,
  837 + array('sql_query' => $join_query)
  838 + );
815 839 echo ' <li>'
816 840 . '<a href="sql.php'
817 841 . PMA_generate_common_url($this_url_params)

0 comments on commit 4a5e871

Please sign in to comment.
Something went wrong with that request. Please try again.