The branch, master has been updated via f62c4a1809458008c778afac98e481f54def216b (commit) from 90bd76540c22cdc1fca5529cf00f7dbc694b6b51 (commit)
- Log ----------------------------------------------------------------- commit f62c4a1809458008c778afac98e481f54def216b Author: Dieter Adriaenssens ruleant@users.sourceforge.net Date: Thu Nov 24 15:32:30 2011 +0100
coding style : control structures
-----------------------------------------------------------------------
Summary of changes: enum_editor.php | 2 +- libraries/header.inc.php | 4 ++-- libraries/header_scripts.inc.php | 2 +- libraries/import/sql.php | 2 +- libraries/mult_submits.inc.php | 12 +++--------- libraries/svg_plot/pma_scatter_plot.php | 11 +++++------ libraries/tbl_links.inc.php | 3 +-- libraries/tbl_select.lib.php | 5 ++--- navigation.php | 3 +-- pmd_pdf.php | 2 +- server_databases.php | 11 +++++------ server_status.php | 7 +++---- sql.php | 7 +++---- tbl_addfield.php | 2 +- tbl_change.php | 8 +++----- tbl_replace.php | 2 +- 16 files changed, 34 insertions(+), 49 deletions(-)
diff --git a/enum_editor.php b/enum_editor.php index 879023b..143d3c4 100644 --- a/enum_editor.php +++ b/enum_editor.php @@ -93,7 +93,7 @@ require_once './libraries/header_meta_style.inc.php'; // Remove a value, given a valid index, from the list // of values, if there was a request to do so. if (isset($_GET['drop']) && is_array($_GET['drop'])) { - foreach ($_GET['drop'] as $index => $value){ + foreach ($_GET['drop'] as $index => $value) { if ((int)$index == $index && $index > 0 && $index <= count($values) diff --git a/libraries/header.inc.php b/libraries/header.inc.php index 538d3e5..3dd65ff 100644 --- a/libraries/header.inc.php +++ b/libraries/header.inc.php @@ -208,8 +208,8 @@ if (isset($GLOBALS['is_ajax_request']) && !$GLOBALS['is_ajax_request']) { * Sets a variable to remember headers have been sent */ $GLOBALS['is_header_sent'] = true; -} //end if (!$GLOBALS['is_ajax_request']) -else { +//end if (!$GLOBALS['is_ajax_request']) +} else { if (empty($GLOBALS['is_header_sent'])) { include_once './libraries/header_http.inc.php'; $GLOBALS['is_header_sent'] = true; diff --git a/libraries/header_scripts.inc.php b/libraries/header_scripts.inc.php index 514f6ed..c8a68ac 100644 --- a/libraries/header_scripts.inc.php +++ b/libraries/header_scripts.inc.php @@ -64,7 +64,7 @@ if (typeof(parent.document) != 'undefined' && typeof(parent.document) != 'unknow parent.document.title = '<?php echo (isset($title) ? PMA_sanitize(PMA_escapeJsString(htmlspecialchars($title))) : ''); ?>'; } <?php -if(count($GLOBALS['js_script']) > 0) { +if (count($GLOBALS['js_script']) > 0) { echo implode("\n", $GLOBALS['js_script'])."\n"; }
diff --git a/libraries/import/sql.php b/libraries/import/sql.php index 08f95aa..3f1ed8e 100644 --- a/libraries/import/sql.php +++ b/libraries/import/sql.php @@ -106,7 +106,7 @@ while (!($GLOBALS['finished'] && $i >= $len) && !$error && !$timeout_passed) { // free memory unset($data); // Do not parse string when we're not at the end and don't have ; inside - if ((strpos($buffer, $sql_delimiter, $i) === false) && !$GLOBALS['finished']) { + if ((strpos($buffer, $sql_delimiter, $i) === false) && !$GLOBALS['finished']) { continue; } } diff --git a/libraries/mult_submits.inc.php b/libraries/mult_submits.inc.php index 6c67b27..bccc7b4 100644 --- a/libraries/mult_submits.inc.php +++ b/libraries/mult_submits.inc.php @@ -262,8 +262,7 @@ if (!empty($submit_mult) && !empty($what)) { <button type="submit" name="mult_btn" value="<?php echo __('Yes'); ?>" id="buttonYes"><?php echo __('Submit'); ?></button> </fieldset> <?php - } - elseif ($what == 'add_prefix_tbl') { ?> + } elseif ($what == 'add_prefix_tbl') { ?> <fieldset class = "input"> <legend><?php echo __('Add table prefix') ?>:</legend> <table> @@ -276,8 +275,7 @@ if (!empty($submit_mult) && !empty($what)) { <button type="submit" name="mult_btn" value="<?php echo __('Yes'); ?>" id="buttonYes"><?php echo __('Submit'); ?></button> </fieldset> <?php - } - else { ?> + } else { ?> <fieldset class="confirmation"> <legend><?php echo ($what == 'drop_db' ? __('You are about to DESTROY a complete database!') . ' ' : '') . __('Do you really want to '); ?>:</legend> <tt><?php echo $full_query; ?></tt> @@ -290,14 +288,10 @@ if (!empty($submit_mult) && !empty($what)) { } include './libraries/footer.inc.php';
-} // end if - - +} elseif ($mult_btn == __('Yes')) { /** * Executes the query - dropping rows, columns/fields, tables or dbs */ -elseif ($mult_btn == __('Yes')) { - if ($query_type == 'drop_db' || $query_type == 'drop_tbl' || $query_type == 'drop_fld') { include_once './libraries/relation_cleanup.lib.php'; } diff --git a/libraries/svg_plot/pma_scatter_plot.php b/libraries/svg_plot/pma_scatter_plot.php index 281a013..857a21c 100644 --- a/libraries/svg_plot/pma_scatter_plot.php +++ b/libraries/svg_plot/pma_scatter_plot.php @@ -118,13 +118,13 @@ class PMA_Scatter_Plot { $this->_dataPoints = array(); if (! is_null($this->_userSpecifiedSettings)) { - foreach (array_keys($this->_userSpecifiedSettings) as $key){ - $this->_settings[$key] = $this->_userSpecifiedSettings[$key]; - } + foreach (array_keys($this->_userSpecifiedSettings) as $key) { + $this->_settings[$key] = $this->_userSpecifiedSettings[$key]; + } } if ($this->_settings['dataLabel'] == '') { $labels = array_keys($this->_data[0]); - $this->_settings['dataLabel'] = $labels[0]; + $this->_settings['dataLabel'] = $labels[0]; } }
@@ -213,8 +213,7 @@ class PMA_Scatter_Plot for ($j = 0 ; $j < count($coordinates[$i]) ; $j++) { $coordinates[$i][$j] = $map[$coordinates[$i][$j]]; } - } - else if (is_numeric($coordinates[$i][0])) { + } else if (is_numeric($coordinates[$i][0])) { $maxC = max($coordinates[$i]); for ($j = 0 ; $j < count($coordinates[$i]) ; $j++) { if ($i == 0) { diff --git a/libraries/tbl_links.inc.php b/libraries/tbl_links.inc.php index e7e7152..bdc7adc 100644 --- a/libraries/tbl_links.inc.php +++ b/libraries/tbl_links.inc.php @@ -122,8 +122,7 @@ if ($table_info_num_rows == 0 && !$tbl_is_view) { echo PMA_generate_html_tabs($tabs, $url_params); unset($tabs);
-if (PMA_Tracker::isActive() and PMA_Tracker::isTracked($GLOBALS["db"], $GLOBALS["table"])) -{ +if (PMA_Tracker::isActive() and PMA_Tracker::isTracked($GLOBALS["db"], $GLOBALS["table"])) { $msg = PMA_Message::notice('<a href="tbl_tracking.php?'.$url_query.'">'.sprintf(__('Tracking of %s.%s is activated.'), htmlspecialchars($GLOBALS["db"]), htmlspecialchars($GLOBALS["table"])).'</a>'); $msg->display(); } diff --git a/libraries/tbl_select.lib.php b/libraries/tbl_select.lib.php index 27f643a..86601d1 100644 --- a/libraries/tbl_select.lib.php +++ b/libraries/tbl_select.lib.php @@ -152,12 +152,11 @@ function PMA_getForeignFields_Values($foreigners, $foreignData, $field, $tbl_fie $str .= '</select>' . "\n";
} elseif ($foreignData['foreign_link'] == true) { - if(isset($fields[$i]) && is_string($fields[$i])){ + if (isset($fields[$i]) && is_string($fields[$i])) { $str .= '<input type="text" id="fieldID_' . $i .'"name="fields[' . $i . ']" value="' . $fields[$i] . '"'; 'id="field_' . md5($field) . '[' . $i .']" class="textfield"/>' ; - } - else{ + } else { $str .= '<input type="text" id="fieldID_' . $i .'"name="fields[' . $i . ']"'; 'id="field_' . md5($field) . '[' . $i .']" class="textfield" />' ; diff --git a/navigation.php b/navigation.php index a93aae6..4966c73 100644 --- a/navigation.php +++ b/navigation.php @@ -43,8 +43,7 @@ if (! isset($_SESSION['tmp_user_values']['table_limit_offset']) || $_SESSION['tm if (isset($_REQUEST['pos'])) { if (isset($_REQUEST['tpos'])) { $_SESSION['tmp_user_values']['table_limit_offset'] = (int) $_REQUEST['pos']; - } - else { + } else { $_SESSION['tmp_user_values']['navi_limit_offset'] = (int) $_REQUEST['pos']; } } diff --git a/pmd_pdf.php b/pmd_pdf.php index ced74f9..6a47bc2 100644 --- a/pmd_pdf.php +++ b/pmd_pdf.php @@ -85,7 +85,7 @@ if (PMA_DBI_num_rows($table_info_result) > 0) { echo '<p>' . __('Page') . ':'; echo '<select name="pdf_page_number">';
- while($page = PMA_DBI_fetch_assoc($table_info_result)) { + while ($page = PMA_DBI_fetch_assoc($table_info_result)) { echo '<option value="' . $page['page_nr'] . '">'; echo htmlspecialchars($page['page_descr']); echo '</option>'; diff --git a/server_databases.php b/server_databases.php index 9b6d5b0..c76da53 100644 --- a/server_databases.php +++ b/server_databases.php @@ -181,8 +181,7 @@ if ($databases_count > 0) { } }
- foreach ($replication_types as $type) - { + foreach ($replication_types as $type) { if ($type=="master") $name = __('Master replication'); elseif ($type == "slave") @@ -245,10 +244,10 @@ if ($databases_count > 0) { } }
- foreach ($replication_types as $type) - { - if (${"server_{$type}_status"}) - echo ' <th></th>' . "\n"; + foreach ($replication_types as $type) { + if (${"server_{$type}_status"}) { + echo ' <th></th>' . "\n"; + { }
if ($is_superuser) { diff --git a/server_status.php b/server_status.php index bfd641d..4fa4707 100644 --- a/server_status.php +++ b/server_status.php @@ -421,7 +421,7 @@ $GLOBALS['js_include'][] = 'highcharts/highcharts.js'; /* Files required for chart exporting */ $GLOBALS['js_include'][] = 'highcharts/exporting.js'; /* < IE 9 doesn't support canvas natively */ -if(PMA_USR_BROWSER_AGENT == 'IE' && PMA_USR_BROWSER_VER < 9) { +if (PMA_USR_BROWSER_AGENT == 'IE' && PMA_USR_BROWSER_VER < 9) { $GLOBALS['js_include'][] = 'canvg/flashcanvas.js'; } $GLOBALS['js_include'][] = 'canvg/canvg.js'; @@ -671,7 +671,7 @@ foreach ($server_status as $name => $value) { } }
-if(PMA_DRIZZLE) { +if (PMA_DRIZZLE) { $used_queries = PMA_DBI_fetch_result( 'SELECT * FROM data_dictionary.global_statements', 0, @@ -1073,8 +1073,7 @@ function printServerTraffic() <h3><a name="replication"></a><?php echo __('Replication status'); ?></h3> <?php
- foreach ($replication_types as $type) - { + foreach ($replication_types as $type) { if (${"server_{$type}_status"}) { PMA_replication_print_status_table($type); } diff --git a/sql.php b/sql.php index 9100def..93b84da 100644 --- a/sql.php +++ b/sql.php @@ -777,10 +777,9 @@ if ((0 == $num_rows && 0 == $unlim_num_rows) || $is_affected) { PMA_sendHeaderLocation($cfg['PmaAbsoluteUri'] . str_replace('&', '&', $goto) . '&message=' . urlencode($message)); } // end else exit(); -} // end no rows returned - -// At least one row is returned -> displays a table with results -else { +// end no rows returned +} else { + // At least one row is returned -> displays a table with results //If we are retrieving the full value of a truncated field or the original // value of a transformed field, show it here and exit if ($GLOBALS['grid_edit'] == true && $GLOBALS['cfg']['AjaxEnable']) { diff --git a/tbl_addfield.php b/tbl_addfield.php index ce8735e..55a980c 100644 --- a/tbl_addfield.php +++ b/tbl_addfield.php @@ -185,7 +185,7 @@ if (isset($_REQUEST['do_save_data'])) { $message = PMA_Message::success(__('Table %1$s has been altered successfully')); $message->addParam($table);
- if( $GLOBALS['is_ajax_request'] == true) { + if ( $GLOBALS['is_ajax_request'] == true) { $extra_data['sql_query'] = PMA_showMessage(null, $sql_query); PMA_ajaxResponse($message, $message->isSuccess(), $extra_data); } diff --git a/tbl_change.php b/tbl_change.php index 4ffe4b2..660adff 100644 --- a/tbl_change.php +++ b/tbl_change.php @@ -803,9 +803,8 @@ foreach ($rows as $row_id => $vrow) { ?> </select> <?php - } // We don't want binary data destroyed - elseif ($field['is_binary'] || $field['is_blob']) { + } elseif ($field['is_binary'] || $field['is_blob']) { if (($cfg['ProtectBinary'] && $field['is_blob']) || ($cfg['ProtectBinary'] == 'all' && $field['is_binary']) ) { @@ -912,10 +911,9 @@ foreach ($rows as $row_id => $vrow) { echo ' </select>' . "\n"; } } // end if (web-server upload directory) - } // end elseif (binary or blob) - elseif (in_array($field['pma_type'], $no_support_types)) { + // end elseif (binary or blob) + } elseif (! in_array($field['pma_type'], $no_support_types)) { // ignore this column to avoid changing it - } else { if ($field['is_char']) { $fieldsize = $extracted_fieldspec['spec_in_brackets']; } else { diff --git a/tbl_replace.php b/tbl_replace.php index 38319b2..2505461 100644 --- a/tbl_replace.php +++ b/tbl_replace.php @@ -272,7 +272,7 @@ foreach ($loop_array as $rownumber => $where_clause) { } elseif (! in_array($me_funcs[$key], $func_no_param) || ($val != "''" && in_array($me_funcs[$key], $func_optional_param))) { $cur_value = $me_funcs[$key] . '(' . $val . ')'; - } else { + } else { $cur_value = $me_funcs[$key] . '()'; }
hooks/post-receive