From cfeb30652642d995bb0c8d17988d33d11b02318f Mon Sep 17 00:00:00 2001 From: Sebastian Mendel Date: Sun, 1 Apr 2007 11:02:46 +0000 Subject: [PATCH] coding standard: no spaces inside braces --- browse_foreigners.php | 44 +- db_datadict.php | 10 +- db_export.php | 16 +- db_qbe.php | 6 +- db_sql.php | 2 +- export.php | 2 +- index.php | 2 +- libraries/Config.class.php | 4 +- libraries/PMA_Sql.class.php | 8 +- libraries/Table.class.php | 2 +- libraries/Theme_Manager.class.php | 6 +- libraries/auth/config.auth.lib.php | 4 +- libraries/bookmark.lib.php | 2 +- libraries/charset_conversion.lib.php | 2 +- libraries/common.lib.php | 8 +- libraries/database_interface.lib.php | 272 ++++++------- libraries/db_common.inc.php | 2 +- libraries/db_links.inc.php | 16 +- libraries/db_routines.inc.php | 4 +- libraries/dbg/setup.php | 6 +- libraries/dbi/mysql.dbi.lib.php | 8 +- libraries/dbi/mysqli.dbi.lib.php | 2 +- libraries/display_create_table.lib.php | 10 +- libraries/display_export.lib.php | 16 +- libraries/display_import.lib.php | 10 +- libraries/display_select_lang.lib.php | 6 +- libraries/display_tbl_links.lib.php | 2 +- libraries/engines/innodb.lib.php | 4 +- libraries/export/htmlexcel.php | 2 +- libraries/export/htmlword.php | 6 +- libraries/export/latex.php | 3 +- libraries/export/sql.php | 10 +- libraries/export/xml.php | 2 +- libraries/export/yaml.php | 2 +- libraries/grab_globals.lib.php | 12 +- libraries/header.inc.php | 20 +- libraries/header_printview.inc.php | 2 +- libraries/iconv_wrapper.lib.php | 4 +- libraries/import/docsql.php | 4 +- libraries/import/sql.php | 2 +- libraries/mult_submits.inc.php | 19 +- libraries/mysql_charsets.lib.php | 30 +- libraries/navigation_header.inc.php | 28 +- libraries/plugin_interface.lib.php | 6 +- libraries/server_links.inc.php | 4 +- libraries/sql_query_form.lib.php | 18 +- libraries/sqlparser.data.php | 4 +- libraries/sqlparser.lib.php | 23 +- libraries/sqlvalidator.class.php | 2 +- libraries/storage_engines.lib.php | 2 +- libraries/tbl_common.php | 6 +- libraries/tbl_indexes.lib.php | 10 +- libraries/tbl_info.inc.php | 20 +- libraries/tbl_links.inc.php | 14 +- libraries/tbl_properties.inc.php | 48 +-- libraries/zip.lib.php | 14 +- pdf_pages.php | 2 +- phpinfo.php | 4 +- phpmyadmin.css.php | 2 +- pmd_common.php | 4 +- pmd_general.php | 2 +- pmd_pdf.php | 2 +- pmd_relation_new.php | 2 +- pmd_save_pos.php | 2 +- scripts/setup.php | 26 +- server_binlog.php | 2 +- server_collations.php | 6 +- server_databases.php | 82 ++-- server_engines.php | 26 +- server_privileges.php | 376 +++++++++--------- server_processlist.php | 8 +- server_variables.php | 6 +- tbl_alter.php | 4 +- tbl_change.php | 14 +- tbl_export.php | 2 +- tbl_indexes.php | 18 +- tbl_printview.php | 7 +- tbl_relation.php | 20 +- tbl_select.php | 22 +- .../darkblue_orange/css/theme_right.css.php | 18 +- themes/original/css/theme_left.css.php | 4 +- themes/original/css/theme_right.css.php | 18 +- transformation_wrapper.php | 18 +- view_create.php | 2 +- 84 files changed, 745 insertions(+), 747 deletions(-) diff --git a/browse_foreigners.php b/browse_foreigners.php index 13daf3454..823fc1066 100644 --- a/browse_foreigners.php +++ b/browse_foreigners.php @@ -56,7 +56,7 @@ $showall = ''; if (isset($disp_row) && is_array($disp_row)) { - if ( $cfg['ShowAll'] && ($the_total > $per_page) ) { + if ($cfg['ShowAll'] && ($the_total > $per_page)) { $showall = ''; } @@ -64,7 +64,7 @@ if (isset($disp_row) && is_array($disp_row)) { $pageNow = @floor($pos / $session_max_rows) + 1; $nbTotalPage = @ceil($the_total / $session_max_rows); - if ( $the_total > $per_page ) { + if ($the_total > $per_page) { $gotopage = PMA_pageselector( 'browse_foreigners.php?field=' . urlencode($field) . '&' . PMA_generate_common_url($db, $table) @@ -90,22 +90,22 @@ if (isset($disp_row) && is_array($disp_row)) { phpMyAdmin + href="phpmyadmin.css.php?&js_frame=right&nocache=getMtime(); ?>" /> - +
', ' '); @@ -201,11 +201,11 @@ echo PMA_pluginGetJavascript($export_list); +if ($is_zip || $is_gzip || $is_bzip) { ?>
: ' . $strCharsetOfFile . '' . "\n"; $temp_charset = reset($cfg['AvailableCharsets']); echo '
' . "\n" . ' '; } elseif (PMA_MYSQL_INT_VERSION >= 40100) { @@ -128,7 +128,7 @@ if ($cfg['ZipDump'] && @function_exists('gzinflate')) { // We don't have show anything about compression, when no supported if ($compressions != $strNone) { echo '
' . "\n"; - printf( $strCompressionWillBeDetected, $compressions); + printf($strCompressionWillBeDetected, $compressions); echo '
' . "\n"; } echo "\n"; diff --git a/libraries/display_select_lang.lib.php b/libraries/display_select_lang.lib.php index 073fd2569..e7a48ab47 100644 --- a/libraries/display_select_lang.lib.php +++ b/libraries/display_select_lang.lib.php @@ -14,7 +14,7 @@ * @return the sorted array * @access private */ -function PMA_language_cmp( &$a, &$b ) { +function PMA_language_cmp(&$a, &$b) { return (strcmp($a[1], $b[1])); } // end of the 'PMA_language_cmp()' function @@ -51,9 +51,9 @@ function PMA_select_language($use_fieldset = FALSE) { } $language_title = $GLOBALS['strLanguage'] . ($GLOBALS['strLanguage'] != 'Language' ? ' - Language' : '') . ' ' . - ( $cfg['ReplaceHelpImg'] ? + ($cfg['ReplaceHelpImg'] ? 'Info' : - '(*)' ) . ''; + '(*)') . ''; if ($use_fieldset) { echo '
' . $language_title . ''; } else { diff --git a/libraries/display_tbl_links.lib.php b/libraries/display_tbl_links.lib.php index 52e28f4e2..f9a42ec2f 100644 --- a/libraries/display_tbl_links.lib.php +++ b/libraries/display_tbl_links.lib.php @@ -13,7 +13,7 @@ /** * */ -if ( $doWriteModifyAt == 'left' ){ +if ($doWriteModifyAt == 'left') { if (!empty($del_url) && $is_display['del_lnk'] != 'kp') { echo ' ' . "\n" diff --git a/libraries/engines/innodb.lib.php b/libraries/engines/innodb.lib.php index 87c8b8abc..88cb10f68 100644 --- a/libraries/engines/innodb.lib.php +++ b/libraries/engines/innodb.lib.php @@ -189,7 +189,7 @@ class PMA_StorageEngine_innodb extends PMA_StorageEngine SHOW STATUS WHERE Variable_name LIKE \'Innodb\\_buffer\\_pool\\_%\' OR Variable_name = \'Innodb_page_size\';'; - $status = PMA_DBI_fetch_result( $sql, 0, 1 ); + $status = PMA_DBI_fetch_result($sql, 0, 1); $output = '' . "\n" . ' '; } if ($do_comments && $cfgRelation['commwork']) { - $schema_insert .= ''; + $schema_insert .= ''; } if ($do_mime && $cfgRelation['mimework']) { - $schema_insert .= ''; + $schema_insert .= ''; } $schema_insert .= ''; diff --git a/libraries/export/latex.php b/libraries/export/latex.php index 6c21e8769..4ea8188d6 100644 --- a/libraries/export/latex.php +++ b/libraries/export/latex.php @@ -242,7 +242,8 @@ function PMA_exportData($db, $table, $crlf, $error_url, $sql_query) { $buffer = ''; // print each row for ($i = 0; $i < $columns_cnt; $i++) { - if ( isset($record[$columns[$i]]) && (!function_exists('is_null') || !is_null($record[$columns[$i]]))) { + if (isset($record[$columns[$i]]) + && (! function_exists('is_null') || !is_null($record[$columns[$i]]))) { $column_value = PMA_texEscape(stripslashes($record[$columns[$i]])); } else { $column_value = $GLOBALS['latex_null']; diff --git a/libraries/export/sql.php b/libraries/export/sql.php index 7fcc782b3..ffb669212 100644 --- a/libraries/export/sql.php +++ b/libraries/export/sql.php @@ -127,7 +127,7 @@ $GLOBALS['comment_marker'] = '-- '; /** * Avoids undefined variables, use NULL so isset() returns false */ -if ( ! isset( $sql_backquotes ) ) { +if (! isset($sql_backquotes)) { $sql_backquotes = null; } @@ -348,7 +348,7 @@ function PMA_exportDBFooter($db) $procs_funcs .= PMA_DBI_get_procedure_or_function_def($db, 'FUNCTION', $function_name) . $crlf . $crlf; } } - if ( !empty($procs_funcs)) { + if (!empty($procs_funcs)) { $result = PMA_exportOutputHandler($procs_funcs); } } @@ -830,12 +830,12 @@ function PMA_exportData($db, $table, $crlf, $error_url, $sql_query) } elseif ($fields_meta[$j]->numeric && $fields_meta[$j]->type != 'timestamp' && ! $fields_meta[$j]->blob) { $values[] = $row[$j]; - // a true BLOB + // a true BLOB // - mysqldump only generates hex data when the --hex-blob // option is used, for fields having the binary attribute // no hex is generated - // - a TEXT field returns type blob but a real blob - // returns also the 'binary' flag + // - a TEXT field returns type blob but a real blob + // returns also the 'binary' flag } elseif (stristr($field_flags[$j], 'BINARY') && $fields_meta[$j]->blob && isset($GLOBALS['sql_hex_for_blob'])) { diff --git a/libraries/export/xml.php b/libraries/export/xml.php index 009c17d82..9f3da1021 100644 --- a/libraries/export/xml.php +++ b/libraries/export/xml.php @@ -157,7 +157,7 @@ function PMA_exportData($db, $table, $crlf, $error_url, $sql_query) { while ($record = PMA_DBI_fetch_row($result)) { $buffer = ' <' . $table . '>' . $crlf; for ($i = 0; $i < $columns_cnt; $i++) { - if ( isset($record[$i]) && !is_null($record[$i])) { + if (isset($record[$i]) && !is_null($record[$i])) { $buffer .= ' <' . $columns[$i] . '>' . htmlspecialchars($record[$i]) . '' . $crlf; } diff --git a/libraries/export/yaml.php b/libraries/export/yaml.php index b33c78645..e5850ae9f 100644 --- a/libraries/export/yaml.php +++ b/libraries/export/yaml.php @@ -133,7 +133,7 @@ function PMA_exportData($db, $table, $crlf, $error_url, $sql_query) $cnt++; $buffer = $cnt . ":$crlf"; for ($i = 0; $i < $columns_cnt; $i++) { - if ( isset($record[$i]) && !is_null($record[$i])) { + if (isset($record[$i]) && !is_null($record[$i])) { $buffer .= ' ' . $columns[$i] . ': ' . htmlspecialchars($record[$i]) . $crlf; } } diff --git a/libraries/grab_globals.lib.php b/libraries/grab_globals.lib.php index b4dbf39b2..ccd0ad172 100644 --- a/libraries/grab_globals.lib.php +++ b/libraries/grab_globals.lib.php @@ -25,11 +25,11 @@ */ function PMA_gpc_extract($array, &$target, $sanitize = true) { - if ( ! is_array($array) ) { + if (! is_array($array)) { return false; } - if ( $sanitize ) { + if ($sanitize) { $valid_variables = preg_replace($GLOBALS['_import_blacklist'], '', array_keys($array)); $valid_variables = array_unique($valid_variables); @@ -37,16 +37,16 @@ function PMA_gpc_extract($array, &$target, $sanitize = true) $valid_variables = array_keys($array); } - foreach ( $valid_variables as $key ) { + foreach ($valid_variables as $key) { - if ( strlen($key) === 0 ) { + if (strlen($key) === 0) { continue; } - if ( is_array($array[$key]) ) { + if (is_array($array[$key])) { // there could be a variable coming from a cookie of // another application, with the same name as this array - unset( $target[$key] ); + unset($target[$key]); PMA_gpc_extract($array[$key], $target[$key], false); } else { diff --git a/libraries/header.inc.php b/libraries/header.inc.php index 20b9b2cb5..030ec13ed 100644 --- a/libraries/header.inc.php +++ b/libraries/header.inc.php @@ -180,46 +180,46 @@ if (empty($GLOBALS['is_header_sent'])) { ) ); $item = ''; - if ( $GLOBALS['cfg']['NavigationBarIconic'] ) { + if ($GLOBALS['cfg']['NavigationBarIconic']) { $separator = ' -' . "\n"; $item .= ' ' . "\n"; } else { $separator = ' - ' . "\n"; } - if ( $GLOBALS['cfg']['NavigationBarIconic'] !== true ) { + if ($GLOBALS['cfg']['NavigationBarIconic'] !== true) { $item .= '%4$s: '; } $item .= '%3$s' . "\n"; echo '
' . "\n"; - printf( $item, + printf($item, $GLOBALS['cfg']['DefaultTabServer'], PMA_generate_common_url(), htmlspecialchars($server_info), $GLOBALS['strServer'], - 's_host.png' ); + 's_host.png'); if (strlen($GLOBALS['db'])) { echo $separator; - printf( $item, + printf($item, $GLOBALS['cfg']['DefaultTabDatabase'], PMA_generate_common_url($GLOBALS['db']), htmlspecialchars($GLOBALS['db']), $GLOBALS['strDatabase'], - 's_db.png' ); + 's_db.png'); if (strlen($GLOBALS['table'])) { require_once './libraries/tbl_info.inc.php'; echo $separator; - printf( $item, + printf($item, $GLOBALS['cfg']['DefaultTabTable'], PMA_generate_common_url($GLOBALS['db'], $GLOBALS['table']), htmlspecialchars($GLOBALS['table']), (isset($GLOBALS['tbl_is_view']) && $GLOBALS['tbl_is_view'] ? $GLOBALS['strView'] : $GLOBALS['strTable']), - (isset($GLOBALS['tbl_is_view']) && $GLOBALS['tbl_is_view'] ? 'b_views' : 's_tbl') . '.png' ); + (isset($GLOBALS['tbl_is_view']) && $GLOBALS['tbl_is_view'] ? 'b_views' : 's_tbl') . '.png'); /** * Displays table comment @@ -245,12 +245,12 @@ if (empty($GLOBALS['is_header_sent'])) { // Get additional information about tables for tooltip is done // in libraries/db_info.inc.php only once if ($cfgRelation['commwork']) { - $comment = PMA_getComments( $GLOBALS['db'] ); + $comment = PMA_getComments($GLOBALS['db']); /** * Displays table comment */ - if ( is_array( $comment ) ) { + if (is_array($comment)) { echo '"' .htmlspecialchars(implode(' ', $comment)) diff --git a/libraries/header_printview.inc.php b/libraries/header_printview.inc.php index 0eb0ab300..f3530ee32 100644 --- a/libraries/header_printview.inc.php +++ b/libraries/header_printview.inc.php @@ -44,7 +44,7 @@ if ($text_dir == 'ltr') { <?php echo $strSQLResult; ?> - phpMyAdmin <?php echo PMA_VERSION ?> - + diff --git a/libraries/iconv_wrapper.lib.php b/libraries/iconv_wrapper.lib.php index 2e75eeb2d..6104e82d4 100644 --- a/libraries/iconv_wrapper.lib.php +++ b/libraries/iconv_wrapper.lib.php @@ -56,7 +56,7 @@ function PMA_aix_iconv_wrapper($in_charset, $out_charset, $str) { $using_translit = (!($translit_search === FALSE)); // Extract "plain" output character set name (without any transliteration argument) - $out_charset_plain = ( $using_translit ? substr($out_charset, 0, $translit_search) : $out_charset ); + $out_charset_plain = ($using_translit ? substr($out_charset, 0, $translit_search) : $out_charset); // Transform name of input character set (if found) if (array_key_exists(strtolower($in_charset), $gnu_iconv_to_aix_iconv_codepage_map)) { @@ -70,7 +70,7 @@ function PMA_aix_iconv_wrapper($in_charset, $out_charset, $str) { // Add transliteration argument again (exactly as specified by user) if used // Build the output character set name that we will use - $out_charset = ( $using_translit ? $out_charset_plain . substr($out_charset, $translit_search) : $out_charset_plain ); + $out_charset = ($using_translit ? $out_charset_plain . substr($out_charset, $translit_search) : $out_charset_plain); // NOTE: Transliteration not supported; we will use the "plain" output character set name $out_charset = $out_charset_plain; diff --git a/libraries/import/docsql.php b/libraries/import/docsql.php index c12556ec2..fd669980f 100644 --- a/libraries/import/docsql.php +++ b/libraries/import/docsql.php @@ -57,7 +57,7 @@ if ($data === TRUE && !$error && !$timeout_passed) { $qry = ' INSERT INTO ' . PMA_backquote($cfgRelation['db']) . '.' . PMA_backquote($cfgRelation['column_info']) . ' - ( db_name, table_name, column_name, ' . PMA_backquote('comment') . ' ) + (db_name, table_name, column_name, ' . PMA_backquote('comment') . ') VALUES ( \'' . PMA_sqlAddslashes($GLOBALS['db']) . '\', \'' . PMA_sqlAddslashes(trim($tab)) . '\', @@ -70,7 +70,7 @@ if ($data === TRUE && !$error && !$timeout_passed) { $qry = ' INSERT INTO ' . PMA_backquote($cfgRelation['db']) . '.' . PMA_backquote($cfgRelation['relation']) . ' - ( master_db, master_table, master_field, foreign_db, foreign_table, foreign_field) + (master_db, master_table, master_field, foreign_db, foreign_table, foreign_field) VALUES ( \'' . PMA_sqlAddslashes($GLOBALS['db']) . '\', \'' . PMA_sqlAddslashes(trim($tab)) . '\', diff --git a/libraries/import/sql.php b/libraries/import/sql.php index 2ee1b66f9..d286764c5 100644 --- a/libraries/import/sql.php +++ b/libraries/import/sql.php @@ -217,7 +217,7 @@ while (!($finished && $i >= $len) && !$error && !$timeout_passed) { } } // Change delimiter, if redefined, and skip it (don't send to server!) - if ((substr($buffer, $i, 9) == "DELIMITER") && ($buffer[$i + 9] <= ' ') && ($i<$len-11) && (!(strpos($buffer,"\n",$i+11)===FALSE) )) { + if ((substr($buffer, $i, 9) == "DELIMITER") && ($buffer[$i + 9] <= ' ') && ($i<$len-11) && (!(strpos($buffer,"\n",$i+11)===FALSE))) { $new_line_pos = strpos($buffer, "\n", $i + 10); $sql_delimiter = substr($buffer, $i+10, $new_line_pos - $i -10); $i= $new_line_pos + 1; diff --git a/libraries/mult_submits.inc.php b/libraries/mult_submits.inc.php index 9b7b7f279..71f79bc2c 100644 --- a/libraries/mult_submits.inc.php +++ b/libraries/mult_submits.inc.php @@ -8,13 +8,12 @@ /** * Prepares the work and runs some other scripts if required */ -if (!empty($submit_mult) - && ($submit_mult != $strWithChecked) - && ( ( isset($selected_db) && !empty($selected_db) ) - || ( isset($selected_tbl) && !empty($selected_tbl) ) - || ( isset($selected_fld) && !empty($selected_fld) ) - || !empty($rows_to_delete) - )) { +if (! empty($submit_mult) + && $submit_mult != $strWithChecked + && (! empty($selected_db) + || ! empty($selected_tbl) + || ! empty($selected_fld) + || ! empty($rows_to_delete))) { define('PMA_SUBMIT_MULT', 1); if (isset($selected_db) && !empty($selected_db)) { $selected = $selected_db; @@ -125,7 +124,7 @@ if (!empty($submit_mult) /** * Displays the confirmation form if required */ -if ( !empty($submit_mult) && !empty($what)) { +if (!empty($submit_mult) && !empty($what)) { $js_to_run = 'functions.js'; unset($message); if (strlen($table)) { @@ -257,7 +256,7 @@ if ( !empty($submit_mult) && !empty($what)) { echo '' . "\n"; echo '' . "\n"; echo '' . "\n"; - echo '' . "\n"; + echo '' . "\n"; echo '' . "\n"; } ?> @@ -375,7 +374,7 @@ elseif ($mult_btn == $strYes) { break; case 'primary_fld': - $sql_query .= (empty($sql_query) ? 'ALTER TABLE ' . PMA_backquote($table) . ( empty($primary) ? '' : ' DROP PRIMARY KEY,') . ' ADD PRIMARY KEY( ' : ', ') + $sql_query .= (empty($sql_query) ? 'ALTER TABLE ' . PMA_backquote($table) . (empty($primary) ? '' : ' DROP PRIMARY KEY,') . ' ADD PRIMARY KEY( ' : ', ') . PMA_backquote(urldecode($selected[$i])) . (($i == $selected_cnt-1) ? ');' : ''); break; diff --git a/libraries/mysql_charsets.lib.php b/libraries/mysql_charsets.lib.php index a390cb0b7..510246fd7 100644 --- a/libraries/mysql_charsets.lib.php +++ b/libraries/mysql_charsets.lib.php @@ -19,7 +19,7 @@ if (PMA_MYSQL_INT_VERSION >= 40100){ //$mysql_charsets_maxlen[$row['Charset']] = $row['Maxlen']; $mysql_charsets_descriptions[$row['Charset']] = $row['Description']; } - @PMA_DBI_free_result( $res ); + @PMA_DBI_free_result($res); $mysql_charsets_count = count($mysql_charsets); sort($mysql_charsets, SORT_STRING); @@ -42,8 +42,8 @@ if (PMA_MYSQL_INT_VERSION >= 40100){ $mysql_collations_available[$row['Collation']] = TRUE; $mysql_charsets_available[$row['Charset']] = !empty($mysql_charsets_available[$row['Charset']]) || !empty($mysql_collations_available[$row['Collation']]); } - @PMA_DBI_free_result( $res ); - unset( $res, $row ); + @PMA_DBI_free_result($res); + unset($res, $row); $mysql_collations_count = count($mysql_collations_flat); sort($mysql_collations_flat, SORT_STRING); @@ -51,7 +51,7 @@ if (PMA_MYSQL_INT_VERSION >= 40100){ sort($mysql_collations[$key], SORT_STRING); reset($mysql_collations[$key]); } - unset( $key, $value ); + unset($key, $value); define('PMA_CSDROPDOWN_COLLATION', 0); define('PMA_CSDROPDOWN_CHARSET', 1); @@ -114,24 +114,24 @@ if (PMA_MYSQL_INT_VERSION >= 40100){ * @param string $db name of db * @return string collation of $db */ - function PMA_getDbCollation( $db ) { - if ( PMA_MYSQL_INT_VERSION >= 50000 && $db == 'information_schema' ) { + function PMA_getDbCollation($db) { + if (PMA_MYSQL_INT_VERSION >= 50000 && $db == 'information_schema') { // We don't have to check the collation of the virtual // information_schema database: We know it! return 'utf8_general_ci'; } - if ( PMA_MYSQL_INT_VERSION >= 50006 ) { + if (PMA_MYSQL_INT_VERSION >= 50006) { // Since MySQL 5.0.6, we don't have to parse SHOW CREATE DATABASE anymore. return PMA_DBI_fetch_value('SELECT DEFAULT_COLLATION_NAME FROM information_schema.SCHEMATA WHERE SCHEMA_NAME = \'' . PMA_sqlAddSlashes($db) . '\' LIMIT 1;'); - } elseif ( PMA_MYSQL_INT_VERSION >= 40101 ) { + } elseif (PMA_MYSQL_INT_VERSION >= 40101) { // MySQL 4.1.0 does not support seperate charset settings // for databases. - PMA_DBI_select_db( $db ); + PMA_DBI_select_db($db); // the query does not work if this string is in double quotes // and MySQL is running in ANSI mode - $return = PMA_DBI_fetch_value( 'SHOW VARIABLES LIKE \'collation_database\'', 0, 1 ); - if ( isset( $GLOBALS['db'] ) && $db !== $GLOBALS['db'] ) { - PMA_DBI_select_db( $GLOBALS['db'] ); + $return = PMA_DBI_fetch_value('SHOW VARIABLES LIKE \'collation_database\'', 0, 1); + if (isset($GLOBALS['db']) && $db !== $GLOBALS['db']) { + PMA_DBI_select_db($GLOBALS['db']); } return $return; } @@ -139,7 +139,7 @@ if (PMA_MYSQL_INT_VERSION >= 40100){ } } else { - function PMA_getDbCollation( $db ) { return PMA_getServerCollation(); } + function PMA_getDbCollation($db) { return PMA_getServerCollation(); } } /** @@ -150,7 +150,7 @@ if (PMA_MYSQL_INT_VERSION >= 40100){ */ function PMA_getServerCollation() { return PMA_DBI_fetch_value( - 'SHOW VARIABLES LIKE \'collation_server\'', 0, 1 ); + 'SHOW VARIABLES LIKE \'collation_server\'', 0, 1); } /** @@ -164,7 +164,7 @@ function PMA_getServerCollation() { * @param string $collation MySQL collation string * @return string collation description */ -function PMA_getCollationDescr( $collation ) { +function PMA_getCollationDescr($collation) { static $collation_cache; if (!is_array($collation_cache)) { diff --git a/libraries/navigation_header.inc.php b/libraries/navigation_header.inc.php index f84920f3b..360c489bd 100644 --- a/libraries/navigation_header.inc.php +++ b/libraries/navigation_header.inc.php @@ -9,19 +9,19 @@ /** * */ -if ( empty( $query_url ) ) { - $db = ! isset( $db ) ? '' : $db; - $table = ! isset( $table ) ? '' : $table; - $query_url = PMA_generate_common_url( $db, $table ); +if (empty($query_url)) { + $db = ! isset($db) ? '' : $db; + $table = ! isset($table) ? '' : $table; + $query_url = PMA_generate_common_url($db, $table); } // display Logo, depending on $GLOBALS['cfg']['LeftDisplayLogo'] -if ( $GLOBALS['cfg']['LeftDisplayLogo'] ) { +if ($GLOBALS['cfg']['LeftDisplayLogo']) { $logo = 'phpMyAdmin'; - if ( @file_exists( $GLOBALS['pmaThemeImage'] . 'logo_left.png' ) ) { + if (@file_exists($GLOBALS['pmaThemeImage'] . 'logo_left.png')) { $logo = ''; - } elseif ( @file_exists( $GLOBALS['pmaThemeImage'] . 'pma_logo2.png' ) ) { + } elseif (@file_exists($GLOBALS['pmaThemeImage'] . 'pma_logo2.png')) { $logo = ''; } @@ -43,27 +43,27 @@ if ( $GLOBALS['cfg']['LeftDisplayLogo'] ) { ' - .( $GLOBALS['cfg']['MainPageIconic'] + .($GLOBALS['cfg']['MainPageIconic'] ? '' . $strHome . '' - : $strHome ) + : $strHome) .'' . "\n"; // if we have chosen server - if ( $server != 0 ) { + if ($server != 0) { // Logout for advanced authentication - if ( $GLOBALS['cfg']['Server']['auth_type'] != 'config' ) { + if ($GLOBALS['cfg']['Server']['auth_type'] != 'config') { echo ($GLOBALS['cfg']['MainPageIconic'] ? '' : ' - '); echo '' - .( $GLOBALS['cfg']['MainPageIconic'] + .($GLOBALS['cfg']['MainPageIconic'] ? '' . $strLogout . '' - : $strLogout ) + : $strLogout) .'' . "\n"; } // end if ($GLOBALS['cfg']['Server']['auth_type'] != 'config' - $anchor = 'querywindow.php?' . PMA_generate_common_url( $db, $table ); + $anchor = 'querywindow.php?' . PMA_generate_common_url($db, $table); if ($GLOBALS['cfg']['MainPageIconic']) { $query_frame_link_text = diff --git a/libraries/plugin_interface.lib.php b/libraries/plugin_interface.lib.php index c5aec14ea..6b53ee0a7 100644 --- a/libraries/plugin_interface.lib.php +++ b/libraries/plugin_interface.lib.php @@ -124,7 +124,7 @@ function PMA_pluginGetDefault($section, $opt) */ function PMA_pluginIsActive($section, $opt, $val) { - if ( ! empty($GLOBALS['timeout_passed']) && isset($_REQUEST[$opt])) { + if (! empty($GLOBALS['timeout_passed']) && isset($_REQUEST[$opt])) { if ($_REQUEST[$opt] == $val) { return ' checked="checked"'; } @@ -213,8 +213,8 @@ function PMA_pluginGetOneOption($section, $plugin_name, $id, &$opt) $ret .= ''; + . (isset($opt['size']) ? ' size="' . $opt['size'] . '"' : '') + . (isset($opt['len']) ? ' maxlength="' . $opt['len'] . '"' : '') . ' />'; $ret .= '
' . "\n"; } elseif ($opt['type'] == 'message_only') { $ret .= '
' . "\n"; diff --git a/libraries/server_links.inc.php b/libraries/server_links.inc.php index 321a68e29..96ad5bb1f 100644 --- a/libraries/server_links.inc.php +++ b/libraries/server_links.inc.php @@ -81,8 +81,8 @@ $tabs['import']['icon'] = 'b_import.png'; $tabs['import']['link'] = 'server_import.php'; $tabs['import']['text'] = $strImport; -echo PMA_getTabs( $tabs ); -unset( $tabs ); +echo PMA_getTabs($tabs); +unset($tabs); /** diff --git a/libraries/sql_query_form.lib.php b/libraries/sql_query_form.lib.php index 9941a4850..6f500253c 100644 --- a/libraries/sql_query_form.lib.php +++ b/libraries/sql_query_form.lib.php @@ -151,7 +151,7 @@ function PMA_sqlQueryForm($query = true, $display_tab = false, $delimiter = ';') // Bookmark Support if ($display_tab === 'full' || $display_tab === 'history') { - if (! empty( $GLOBALS['cfg']['Bookmark']) + if (! empty($GLOBALS['cfg']['Bookmark']) && $GLOBALS['cfg']['Bookmark']['db'] && $GLOBALS['cfg']['Bookmark']['table']) { PMA_sqlQueryFormBookmark(); @@ -200,7 +200,7 @@ function PMA_sqlQueryFormInsert($query = '', $is_querywindow = false, $delimiter // enable auto select text in textarea if ($GLOBALS['cfg']['TextareaAutoSelect']) { - $auto_sel = ' onfocus="selectContent( this, sql_box_locked, true )"'; + $auto_sel = ' onfocus="selectContent(this, sql_box_locked, true)"'; } else { $auto_sel = ''; } @@ -272,7 +272,7 @@ function PMA_sqlQueryFormInsert($query = '', $is_querywindow = false, $delimiter str_replace('%d', PMA_backquote($db), str_replace('%t', PMA_backquote($table), str_replace('%f', - implode(', ', $field_names ), + implode(', ', $field_names), $GLOBALS['cfg']['DefaultQueryTable']))); unset($field_names); } @@ -310,11 +310,11 @@ function PMA_sqlQueryFormInsert($query = '', $is_querywindow = false, $delimiter if (isset($field['Field']) && strlen($field['Field']) && isset($field['Comment'])) { echo ' title="' . htmlspecialchars($field['Comment']) . '"'; } - echo '>' . htmlspecialchars( $field['Field'] ) . '' . "\n"; + echo '>' . htmlspecialchars($field['Field']) . '' . "\n"; } echo '' . "\n" .'
' . "\n"; - if ( $GLOBALS['cfg']['PropertiesIconic'] ) { + if ($GLOBALS['cfg']['PropertiesIconic']) { echo '' . "\n"; @@ -414,7 +414,7 @@ function PMA_sqlQueryFormInsert($query = '', $is_querywindow = false, $delimiter */ function PMA_sqlQueryFormBookmark() { - $bookmark_list = PMA_listBookmarks($GLOBALS['db'], $GLOBALS['cfg']['Bookmark'] ); + $bookmark_list = PMA_listBookmarks($GLOBALS['db'], $GLOBALS['cfg']['Bookmark']); if (! $bookmark_list || count($bookmark_list) < 1) { return; } @@ -540,9 +540,9 @@ function PMA_sqlQueryFormUpload(){ echo '
'; - if ( PMA_MYSQL_INT_VERSION < 40100 + if (PMA_MYSQL_INT_VERSION < 40100 && $GLOBALS['cfg']['AllowAnywhereRecoding'] - && $GLOBALS['allow_recoding'] ) { + && $GLOBALS['allow_recoding']) { echo $GLOBALS['strCharsetOfFile'] . "\n" . '' . "\n"; diff --git a/libraries/tbl_common.php b/libraries/tbl_common.php index 1c259a6a0..75dab272a 100644 --- a/libraries/tbl_common.php +++ b/libraries/tbl_common.php @@ -14,7 +14,7 @@ require_once './libraries/bookmark.lib.php'; // Check parameters PMA_checkParameters(array('db', 'table')); -if ( PMA_MYSQL_INT_VERSION >= 50002 && $db === 'information_schema' ) { +if (PMA_MYSQL_INT_VERSION >= 50002 && $db === 'information_schema') { $db_is_information_schema = true; } else { $db_is_information_schema = false; @@ -32,8 +32,8 @@ $url_params['table'] = $table; /** * Defines the urls to return to in case of error in a sql statement */ -$err_url_0 = $cfg['DefaultTabDatabase'] . PMA_generate_common_url( array( 'db' => $db, ) ); -$err_url = $cfg['DefaultTabTable'] . PMA_generate_common_url( $url_params ); +$err_url_0 = $cfg['DefaultTabDatabase'] . PMA_generate_common_url(array('db' => $db,)); +$err_url = $cfg['DefaultTabTable'] . PMA_generate_common_url($url_params); /** diff --git a/libraries/tbl_indexes.lib.php b/libraries/tbl_indexes.lib.php index 62ee73d9e..ee59d8370 100644 --- a/libraries/tbl_indexes.lib.php +++ b/libraries/tbl_indexes.lib.php @@ -145,7 +145,7 @@ function PMA_extract_indexes(&$ret_keys, &$indexes, &$indexes_info, &$indexes_da $prev_index = ''; foreach ($ret_keys as $row) { - if ($row['Key_name'] != $prev_index ){ + if ($row['Key_name'] != $prev_index){ $indexes[] = $row['Key_name']; $prev_index = $row['Key_name']; } @@ -198,7 +198,7 @@ function PMA_show_indexes($table, &$indexes, &$indexes_info, &$indexes_data, if ($display_html) { $row_span = ' rowspan="' . count($indexes_info[$index_name]['Sequences']) . '" '; - echo '
' . "\n"; + echo ' ' . "\n"; echo ' ' . "\n"; @@ -267,11 +267,11 @@ function PMA_show_indexes($table, &$indexes, &$indexes_info, &$indexes_data, if ($display_html) { if ($row_no > 0) { - echo ' ' . "\n"; + echo ' ' . "\n"; } - if ( isset($indexes_data[$index_name][$seq_index]['Sub_part']) - && strlen($indexes_data[$index_name][$seq_index]['Sub_part']) ) { + if (isset($indexes_data[$index_name][$seq_index]['Sub_part']) + && strlen($indexes_data[$index_name][$seq_index]['Sub_part'])) { echo ' ' . "\n"; echo '
' . "\n" @@ -321,7 +321,7 @@ class PMA_StorageEngine_innodb extends PMA_StorageEngine */ function getPage($id) { - if ( ! array_key_exists( $id, $this->getInfoPages() ) ) { + if (! array_key_exists($id, $this->getInfoPages())) { return false; } diff --git a/libraries/export/htmlexcel.php b/libraries/export/htmlexcel.php index 71b212d28..b380cd52e 100644 --- a/libraries/export/htmlexcel.php +++ b/libraries/export/htmlexcel.php @@ -71,7 +71,7 @@ xmlns="http://www.w3.org/TR/REC-html40"> - + diff --git a/libraries/export/htmlword.php b/libraries/export/htmlword.php index 70ec09967..94d0add9c 100644 --- a/libraries/export/htmlword.php +++ b/libraries/export/htmlword.php @@ -64,7 +64,7 @@ xmlns="http://www.w3.org/TR/REC-html40"> - + '); } @@ -324,10 +324,10 @@ function PMA_exportStructure($db, $table, $crlf, $error_url, $do_relation = fals $schema_insert .= '
' . (isset($res_rel[$field_name]) ? htmlspecialchars($res_rel[$field_name]['foreign_table'] . ' (' . $res_rel[$field_name]['foreign_field'] . ')') : '') . '' . ( isset($comments[$field_name]) ? htmlspecialchars($comments[$field_name]) : '') . '' . (isset($comments[$field_name]) ? htmlspecialchars($comments[$field_name]) : '') . '' . ( isset($mime_map[$field_name]) ? htmlspecialchars(str_replace('_', '/', $mime_map[$field_name]['mimetype'])) : '') . '' . (isset($mime_map[$field_name]) ? htmlspecialchars(str_replace('_', '/', $mime_map[$field_name]['mimetype'])) : '') . '
' . "\n" . ' ' . htmlspecialchars($index_name) . "\n" . '
' . $col_name . '' . "\n" . ' ' . $indexes_data[$index_name][$seq_index]['Sub_part'] . "\n" diff --git a/libraries/tbl_info.inc.php b/libraries/tbl_info.inc.php index cda254ae3..670b1a5d7 100644 --- a/libraries/tbl_info.inc.php +++ b/libraries/tbl_info.inc.php @@ -51,15 +51,15 @@ $table_info_result = PMA_DBI_query( if ($table_info_result && PMA_DBI_num_rows($table_info_result) > 0) { $showtable = PMA_DBI_fetch_assoc($table_info_result); PMA_DBI_free_result($table_info_result); - unset( $table_info_result ); + unset($table_info_result); if (!isset($showtable['Type']) && isset($showtable['Engine'])) { $showtable['Type'] =& $showtable['Engine']; } // MySQL < 5.0.13 returns "view", >= 5.0.13 returns "VIEW" - if ( PMA_MYSQL_INT_VERSION >= 50000 && !isset($showtable['Type']) - && isset($showtable['Comment']) - && strtoupper($showtable['Comment']) == 'VIEW' ) { + if (PMA_MYSQL_INT_VERSION >= 50000 && !isset($showtable['Type']) + && isset($showtable['Comment']) + && strtoupper($showtable['Comment']) == 'VIEW') { $tbl_is_view = true; $tbl_type = $GLOBALS['strView']; $show_comment = null; @@ -82,9 +82,9 @@ if ($table_info_result && PMA_DBI_num_rows($table_info_result) > 0) { ? '' : $showtable['Collation']; - if ( null === $showtable['Rows'] ) { - $showtable['Rows'] = PMA_Table::countRecords( $GLOBALS['db'], - $showtable['Name'], true, true ); + if (null === $showtable['Rows']) { + $showtable['Rows'] = PMA_Table::countRecords($GLOBALS['db'], + $showtable['Name'], true, true); } $table_info_num_rows = isset($showtable['Rows']) ? $showtable['Rows'] : 0; $auto_increment = isset($showtable['Auto_increment']) @@ -98,14 +98,14 @@ if ($table_info_result && PMA_DBI_num_rows($table_info_result) > 0) { // export create options by its name as variables into gloabel namespace // f.e. pack_keys=1 becomes available as $pack_keys with value of '1' unset($pack_keys); - foreach ( $create_options as $each_create_option ) { + foreach ($create_options as $each_create_option) { $each_create_option = explode('=', $each_create_option); - if ( isset( $each_create_option[1] ) ) { + if (isset($each_create_option[1])) { $$each_create_option[0] = $each_create_option[1]; } } // we need explicit DEFAULT value here (different from '0') $pack_keys = (!isset($pack_keys) || strlen($pack_keys) == 0) ? 'DEFAULT' : $pack_keys; - unset( $create_options, $each_create_option ); + unset($create_options, $each_create_option); } // end if ?> diff --git a/libraries/tbl_links.inc.php b/libraries/tbl_links.inc.php index 3691b6046..330007834 100644 --- a/libraries/tbl_links.inc.php +++ b/libraries/tbl_links.inc.php @@ -31,8 +31,8 @@ $url_params['table'] = $table; /** * Defines the urls to return to in case of error in a sql statement */ -$err_url_0 = $cfg['DefaultTabDatabase'] . PMA_generate_common_url( array( 'db' => $db, ) ); -$err_url = $cfg['DefaultTabTable'] . PMA_generate_common_url( $url_params ); +$err_url_0 = $cfg['DefaultTabDatabase'] . PMA_generate_common_url(array('db' => $db,)); +$err_url = $cfg['DefaultTabTable'] . PMA_generate_common_url($url_params); /** * Displays headers @@ -62,7 +62,7 @@ $tabs['search']['icon'] = 'b_search.png'; $tabs['search']['text'] = $strSearch; $tabs['search']['link'] = 'tbl_select.php'; -if ( ! (isset($db_is_information_schema) && $db_is_information_schema) ) { +if (! (isset($db_is_information_schema) && $db_is_information_schema)) { $tabs['insert']['icon'] = 'b_insrow.png'; $tabs['insert']['link'] = 'tbl_change.php'; $tabs['insert']['text'] = $strInsert; @@ -77,7 +77,7 @@ $tabs['export']['text'] = $strExport; * Don't display "Import", "Operations" and "Empty" * for views and information_schema */ -if ( ! $tbl_is_view && ! (isset($db_is_information_schema) && $db_is_information_schema )) { +if (! $tbl_is_view && ! (isset($db_is_information_schema) && $db_is_information_schema)) { $tabs['import']['icon'] = 'b_tblimport.png'; $tabs['import']['link'] = 'tbl_import.php'; $tabs['import']['text'] = $strImport; @@ -105,7 +105,7 @@ if ( ! $tbl_is_view && ! (isset($db_is_information_schema) && $db_is_information /** * no drop in information_schema */ -if ( ! (isset($db_is_information_schema) && $db_is_information_schema) ) { +if (! (isset($db_is_information_schema) && $db_is_information_schema)) { $tabs['drop']['icon'] = 'b_deltbl.png'; $tabs['drop']['link'] = 'sql.php'; $tabs['drop']['text'] = $strDrop; @@ -125,8 +125,8 @@ if ($table_info_num_rows == 0 && !$tbl_is_view) { $tabs['search']['warning'] = $strTableIsEmpty; } -echo PMA_getTabs( $tabs ); -unset( $tabs ); +echo PMA_getTabs($tabs); +unset($tabs); /** * Displays a message diff --git a/libraries/tbl_properties.inc.php b/libraries/tbl_properties.inc.php index c4807192c..eeea295f7 100644 --- a/libraries/tbl_properties.inc.php +++ b/libraries/tbl_properties.inc.php @@ -179,7 +179,7 @@ if (isset($field_fulltext) && is_array($field_fulltext)) { } } -for ( $i = 0 ; $i <= $num_fields; $i++ ) { +for ($i = 0 ; $i <= $num_fields; $i++) { $submit_null = FALSE; if (isset($regenerate) && $regenerate == TRUE) { // An error happened with previous inputs, so we will restore the data @@ -377,7 +377,7 @@ for ( $i = 0 ; $i <= $num_fields; $i++ ) { $attribute = 'ON UPDATE CURRENT_TIMESTAMP'; } if ((isset($row['Field']) && isset($analyzed_sql[0]['create_table_fields'][$row['Field']]['default_current_timestamp'])) - || (isset($submit_default_current_timestamp) && $submit_default_current_timestamp) ) { + || (isset($submit_default_current_timestamp) && $submit_default_current_timestamp)) { $default_current_timestamp = TRUE; } else { $default_current_timestamp = FALSE; @@ -559,26 +559,26 @@ for ( $i = 0 ; $i <= $num_fields; $i++ ) { } } // end for -if ( is_array( $content_cells ) && is_array( $header_cells ) ) { +if (is_array($content_cells) && is_array($header_cells)) { // last row is for javascript insert - $empty_row = array_pop( $content_cells ); + $empty_row = array_pop($content_cells); echo ''; - if ( $display_type == 'horizontal' ) { + if ($display_type == 'horizontal') { ?> - + '; + foreach ($content_cells as $content_row) { + echo ''; $odd_row = ! $odd_row; - if ( is_array( $content_row ) ) { + if (is_array($content_row)) { foreach ($content_row as $content_row_val) { ?> @@ -590,14 +590,14 @@ if ( is_array( $content_cells ) && is_array( $header_cells ) ) { } else { $i = 0; $odd_row = true; - foreach ( $header_cells as $header_val ) { - echo ''; + foreach ($header_cells as $header_val) { + echo ''; $odd_row = ! $odd_row; ?> ' . $content_row_val . ''; } ?> @@ -630,10 +630,10 @@ var odd_row = ; function addField() { var new_fields = document.getElementById('added_fields').value; var new_field_container = document.getElementById('table_columns'); - var new_field = ''; + var new_field = ''; var i = 0; - for ( i = 0; i < new_fields; i++ ) { - if ( odd_row ) { + for (i = 0; i < new_fields; i++) { + if (odd_row) { new_field_container.innerHTML += '' + new_field + ''; } else { new_field_container.innerHTML += '' + new_field + ''; @@ -658,7 +658,7 @@ if ($action == 'tbl_create.php') { = 40100 ) { + if (PMA_MYSQL_INT_VERSION >= 40100) { echo ' ' . "\n" . ' ' . "\n"; } @@ -673,7 +673,7 @@ if ($action == 'tbl_create.php') { = 40100 ) { + if (PMA_MYSQL_INT_VERSION >= 40100) { echo ' ' . "\n" . ' ' - : '' ) - . ( $dbstats ? $strDatabasesStats : $strDatabases ) . "\n" + : '') + . ($dbstats ? $strDatabasesStats : $strDatabases) . "\n" .'' . "\n"; /** @@ -224,9 +224,9 @@ if ($databases_count > 0) { . ($sort_by == 'SCHEMA_NAME' ? ' ' . ($sort_order == 'asc' ? $strAscending : $strDescending) . '' . "\n" : '') . ' ' . "\n"; $table_columns = 3; - foreach ( $column_order as $stat_name => $stat ) { - if ( array_key_exists( $stat_name, $first_database ) ) { - if ( $stat['format'] === 'byte' ) { + foreach ($column_order as $stat_name => $stat) { + if (array_key_exists($stat_name, $first_database)) { + if ($stat['format'] === 'byte') { $table_columns += 2; $colspan = ' colspan="2"'; } else { @@ -243,7 +243,7 @@ if ($databases_count > 0) { } } if ($is_superuser) { - echo ' ' . "\n"; } echo '' . "\n" @@ -252,10 +252,10 @@ if ($databases_count > 0) { $odd_row = true; foreach ($databases as $current) { - echo '' . "\n"; + echo '' . "\n"; $odd_row = ! $odd_row; - if ( $is_superuser || $cfg['AllowUserDropDatabase'] ) { + if ($is_superuser || $cfg['AllowUserDropDatabase']) { echo ' ' . "\n"; } echo ' ' . "\n"; - foreach ( $column_order as $stat_name => $stat ) { - if ( array_key_exists( $stat_name, $current ) ) { - if ( is_numeric( $stat['footer'] ) ) { + foreach ($column_order as $stat_name => $stat) { + if (array_key_exists($stat_name, $current)) { + if (is_numeric($stat['footer'])) { $column_order[$stat_name]['footer'] += $current[$stat_name]; } - if ( $stat['format'] === 'byte' ) { - list( $value, $unit ) = PMA_formatByteDown( $current[$stat_name], 3, 1 ); - } elseif ( $stat['format'] === 'number' ) { - $value = PMA_formatNumber( $current[$stat_name], 0 ); + if ($stat['format'] === 'byte') { + list($value, $unit) = PMA_formatByteDown($current[$stat_name], 3, 1); + } elseif ($stat['format'] === 'number') { + $value = PMA_formatNumber($current[$stat_name], 0); } else { - $value = htmlentities( $current[$stat_name], 0 ); + $value = htmlentities($current[$stat_name], 0); } echo ' ' . "\n"; - if ( $stat['format'] === 'byte' ) { + if ($stat['format'] === 'byte') { echo ' ' . "\n"; } } @@ -300,42 +300,42 @@ if ($databases_count > 0) { if ($is_superuser) { echo ' ' . "\n"; } echo '' . "\n"; - } // end foreach ( $databases as $key => $current ) + } // end foreach ($databases as $key => $current) unset($current, $odd_row); echo '' . "\n"; - if ( $is_superuser || $cfg['AllowUserDropDatabase'] ) { + if ($is_superuser || $cfg['AllowUserDropDatabase']) { echo ' ' . "\n"; } echo ' ' . "\n"; - foreach ( $column_order as $stat_name => $stat ) { - if ( array_key_exists( $stat_name, $first_database ) ) { - if ( $stat['format'] === 'byte' ) { - list( $value, $unit ) = PMA_formatByteDown( $stat['footer'], 3, 1 ); - } elseif ( $stat['format'] === 'number' ) { - $value = PMA_formatNumber( $stat['footer'], 0 ); + foreach ($column_order as $stat_name => $stat) { + if (array_key_exists($stat_name, $first_database)) { + if ($stat['format'] === 'byte') { + list($value, $unit) = PMA_formatByteDown($stat['footer'], 3, 1); + } elseif ($stat['format'] === 'number') { + $value = PMA_formatNumber($stat['footer'], 0); } else { - $value = htmlentities( $stat['footer'], 0 ); + $value = htmlentities($stat['footer'], 0); } echo ' ' . "\n"; - if ( $stat['format'] === 'byte' ) { + if ($stat['format'] === 'byte') { echo ' ' . "\n"; } } } - if ( $is_superuser ) { + if ($is_superuser) { echo ' ' . "\n"; } echo '' . "\n"; @@ -346,16 +346,16 @@ if ($databases_count > 0) { if ($is_superuser || $cfg['AllowUserDropDatabase']) { $common_url_query = PMA_generate_common_url() . '&sort_by=' . $sort_by . '&sort_order=' . $sort_order . '&dbstats=' . $dbstats; echo '' . $strWithChecked . '' . "\n" - . '' . "\n" + . '' . "\n" . ' ' . $strCheckAll . ' / ' . "\n" - . '' . "\n" + . '' . "\n" . ' ' . $strUncheckAll . '' . "\n" . '' . $strWithChecked . '' . "\n"; - PMA_buttonOrImage( 'drop_selected_dbs', 'mult_submit', 'drop_selected_dbs', $strDrop, 'b_deltbl.png' ); + PMA_buttonOrImage('drop_selected_dbs', 'mult_submit', 'drop_selected_dbs', $strDrop, 'b_deltbl.png'); } echo '' . "\n" + $dt_table .= '' . "\n" . ' ' . "\n" . ' ' . "\n" . ' ' . "\n"; @@ -196,9 +196,9 @@ if ( empty($_REQUEST['engine']) echo '

' . "\n" . ($GLOBALS['cfg']['MainPageIconic'] ? '' : '' ) + .' width="16" height="16" alt="" />' : '') . ' ' . htmlspecialchars($engine_plugin->getTitle()) . "\n" - . ' ' . PMA_showMySQLDocu( '', $engine_plugin->getMysqlHelpPage() ) . "\n" + . ' ' . PMA_showMySQLDocu('', $engine_plugin->getMysqlHelpPage()) . "\n" . '

' . "\n\n"; if (PMA_MYSQL_INT_VERSION >= 40102) { echo '

' . "\n" @@ -215,7 +215,7 @@ if ( empty($_REQUEST['engine']) echo ' ' . $strServerTabVariables . '' . "\n"; } else { echo ' ' + . PMA_generate_common_url(array('engine' => $_REQUEST['engine'])) . '">' . $strServerTabVariables . '' . "\n"; } foreach ($infoPages as $current => $label) { @@ -225,7 +225,7 @@ if ( empty($_REQUEST['engine']) } else { echo ' ' . htmlspecialchars($label) . '' . "\n"; } } diff --git a/server_privileges.php b/server_privileges.php index 28f156bbb..9efd8f1d2 100644 --- a/server_privileges.php +++ b/server_privileges.php @@ -30,9 +30,9 @@ if (isset($pred_tablename) && strlen($pred_tablename)) { } // check if given $dbanem is a wildcard or not -if ( isset( $dbname ) ) { - //if ( preg_match( '/\\\\(?:_|%)/i', $dbname ) ) { - if ( preg_match( '/(? FALSE, @@ -314,7 +314,7 @@ function PMA_displayPrivTable($db = '*', $table = '*', $submit = TRUE, $indent = unset($res, $row1); } // t a b l e - s p e c i f i c p r i v i l e g e s - if ( ! empty( $columns ) ) { + if (! empty($columns)) { $res = PMA_DBI_query( 'SELECT `Column_name`, `Column_priv`' .' FROM `mysql`.`columns_priv`' @@ -323,7 +323,7 @@ function PMA_displayPrivTable($db = '*', $table = '*', $submit = TRUE, $indent = .' AND ' . PMA_convert_using('`Host`') .' = ' . PMA_convert_using($hostname, 'quoted') .' AND ' . PMA_convert_using('`Db`') - .' = ' . PMA_convert_using( PMA_unescape_mysql_wildcards( $db ), 'quoted') + .' = ' . PMA_convert_using(PMA_unescape_mysql_wildcards($db), 'quoted') .' AND ' . PMA_convert_using('`Table_name`') .' = ' . PMA_convert_using($table, 'quoted') . ';'); @@ -334,7 +334,7 @@ function PMA_displayPrivTable($db = '*', $table = '*', $submit = TRUE, $indent = } } PMA_DBI_free_result($res); - unset( $res, $row1, $current ); + unset($res, $row1, $current); echo $spaces . '' . "\n" . $spaces . '' . "\n" @@ -476,13 +476,13 @@ function PMA_displayPrivTable($db = '*', $table = '*', $submit = TRUE, $indent = . $spaces . '

' . "\n" . $spaces . ' ' . "\n" . $spaces . ' ' . ($db == '*' ? $GLOBALS['strGlobalPrivileges'] : ($table == '*' ? $GLOBALS['strDbPrivileges'] : $GLOBALS['strTblPrivileges'])) . "\n" - . $spaces . ' ( ' . $GLOBALS['strCheckAll'] . ' /' . "\n" - . $spaces . ' ' . $GLOBALS['strUncheckAll'] . ' )' . "\n" + . $spaces . ' (' . $GLOBALS['strCheckAll'] . ' /' . "\n" + . $spaces . ' ' . $GLOBALS['strUncheckAll'] . ')' . "\n" . $spaces . ' ' . "\n" . $spaces . '

' . $GLOBALS['strEnglishPrivileges'] . '

' . "\n" . $spaces . '
' . "\n" . $spaces . ' ' . $GLOBALS['strData'] . '' . "\n"; - foreach ( $privTable[0] as $priv ) + foreach ($privTable[0] as $priv) { echo $spaces . '
' . "\n" . $spaces . ' ' . "\n" @@ -492,7 +492,7 @@ function PMA_displayPrivTable($db = '*', $table = '*', $submit = TRUE, $indent = echo $spaces . '
' . "\n" . $spaces . '
' . "\n" . $spaces . ' ' . $GLOBALS['strStructure'] . '' . "\n"; - foreach ( $privTable[1] as $priv ) + foreach ($privTable[1] as $priv) { echo $spaces . '
' . "\n" . $spaces . ' ' . "\n" @@ -502,7 +502,7 @@ function PMA_displayPrivTable($db = '*', $table = '*', $submit = TRUE, $indent = echo $spaces . '
' . "\n" . $spaces . '
' . "\n" . $spaces . ' ' . $GLOBALS['strAdministration'] . '' . "\n"; - foreach ( $privTable[2] as $priv ) + foreach ($privTable[2] as $priv) { echo $spaces . '
' . "\n" . $spaces . ' ' . "\n" @@ -562,8 +562,8 @@ function PMA_displayPrivTable($db = '*', $table = '*', $submit = TRUE, $indent = * * @return void */ -function PMA_displayLoginInformationFields($mode = 'new', $indent = 0 ) { - $spaces = str_repeat( ' ', $indent); +function PMA_displayLoginInformationFields($mode = 'new', $indent = 0) { + $spaces = str_repeat(' ', $indent); // Get user/host name lengths $fields_info = PMA_DBI_get_fields('mysql', 'user'); @@ -586,7 +586,7 @@ function PMA_displayLoginInformationFields($mode = 'new', $indent = 0 ) { } unset($fields_info); - if ( isset( $GLOBALS['username'] ) && strlen( $GLOBALS['username'] ) === 0 ) { + if (isset($GLOBALS['username']) && strlen($GLOBALS['username']) === 0) { $GLOBALS['pred_username'] = 'any'; } echo $spaces . '
' . "\n" @@ -650,7 +650,7 @@ function PMA_displayLoginInformationFields($mode = 'new', $indent = 0 ) { . $spaces . ' ' . "\n" . $spaces . ' ' . "\n" . $spaces . '' . "\n" - . $spaces . '' . "\n" + . $spaces . '' . "\n" . $spaces . '
' . "\n" . $spaces . '
' . "\n" . $spaces . '
 ' . $strCollation . ':   ' . "\n" . PMA_generateCharsetDropdownBox(PMA_CSDROPDOWN_COLLATION, 'tbl_collation', null, (isset($tbl_collation) ? $tbl_collation : null), FALSE, 3) @@ -691,10 +691,10 @@ if ($action == 'tbl_create.php') { - ' ); ?> + '); ?> + onclick="return checkFormElementInRange(this.form, 'added_fields', '', 1)" /> @@ -709,10 +709,10 @@ if ($action == 'tbl_create.php') { if ($cfgRelation['commwork'] && $cfgRelation['mimework'] && $cfg['BrowseMIME']) { echo '

3 ' . $strMIME_transformation_options_note . '

'; echo '

'; - printf( $strMIME_transformation_note, + printf($strMIME_transformation_note, '', - '' ); + ''); echo '

'; } ?> diff --git a/libraries/zip.lib.php b/libraries/zip.lib.php index eb62a9120..2d377cc08 100644 --- a/libraries/zip.lib.php +++ b/libraries/zip.lib.php @@ -145,14 +145,14 @@ class zipfile $cdrec .= pack('V', $crc); // crc32 $cdrec .= pack('V', $c_len); // compressed filesize $cdrec .= pack('V', $unc_len); // uncompressed filesize - $cdrec .= pack('v', strlen($name) ); // length of filename - $cdrec .= pack('v', 0 ); // extra field length - $cdrec .= pack('v', 0 ); // file comment length - $cdrec .= pack('v', 0 ); // disk number start - $cdrec .= pack('v', 0 ); // internal file attributes - $cdrec .= pack('V', 32 ); // external file attributes - 'archive' bit set + $cdrec .= pack('v', strlen($name)); // length of filename + $cdrec .= pack('v', 0); // extra field length + $cdrec .= pack('v', 0); // file comment length + $cdrec .= pack('v', 0); // disk number start + $cdrec .= pack('v', 0); // internal file attributes + $cdrec .= pack('V', 32); // external file attributes - 'archive' bit set - $cdrec .= pack('V', $this -> old_offset ); // relative offset of local header + $cdrec .= pack('V', $this -> old_offset); // relative offset of local header $this -> old_offset += strlen($fr); $cdrec .= $name; diff --git a/pdf_pages.php b/pdf_pages.php index 70394a361..4deef20d0 100644 --- a/pdf_pages.php +++ b/pdf_pages.php @@ -356,7 +356,7 @@ foreach ($array_sh_page AS $key => $temp_sh_page) { $reset_draginit .= ' document.edcoord.elements["c_table_' . $i . '[y]"].value = "' . (15 * $i) . '"' . "\n"; $local_query = 'SHOW FIELDS FROM ' - . PMA_backquote($temp_sh_page['table_name'] ) + . PMA_backquote($temp_sh_page['table_name']) . ' FROM ' . PMA_backquote($db); $fields_rs = PMA_DBI_query($local_query); unset($local_query); diff --git a/phpinfo.php b/phpinfo.php index 7ce16b547..56a4c9cda 100644 --- a/phpinfo.php +++ b/phpinfo.php @@ -8,14 +8,14 @@ /** * Gets core libraries and defines some variables */ -define( 'PMA_MINIMUM_COMMON', true ); +define('PMA_MINIMUM_COMMON', true); require_once './libraries/common.inc.php'; /** * Displays PHP information */ -if ( $GLOBALS['cfg']['ShowPhpInfo'] ) { +if ($GLOBALS['cfg']['ShowPhpInfo']) { phpinfo(); } ?> diff --git a/phpmyadmin.css.php b/phpmyadmin.css.php index c47ba856e..543ad5664 100644 --- a/phpmyadmin.css.php +++ b/phpmyadmin.css.php @@ -15,7 +15,7 @@ require_once './libraries/sqlparser.lib.php'; // MSIE 6 (at least some unpatched versions) has problems loading CSS // when zlib_compression is on if (PMA_USR_BROWSER_AGENT == 'IE' && PMA_USR_BROWSER_VER == '6' - && (ini_get('zlib.output_compression')) ) { + && (ini_get('zlib.output_compression'))) { ini_set('zlib.output_compression', 'Off'); } diff --git a/pmd_common.php b/pmd_common.php index 4ba84212a..23f285512 100644 --- a/pmd_common.php +++ b/pmd_common.php @@ -131,7 +131,7 @@ function get_script_contr() while ($val = @PMA_DBI_fetch_row($alltab_rs)) { $row = PMA_getForeigners($GLOBALS['db'], $val[0], '', 'internal'); //echo "
internal ".$GLOBALS['db']." - ".$val[0]." - "; - //print_r($row ); + //print_r($row); if ($row !== false) { foreach ($row as $field => $value) { $con['C_NAME'][$i] = ''; @@ -144,7 +144,7 @@ function get_script_contr() } $row = PMA_getForeigners($GLOBALS['db'], $val[0], '', 'innodb'); //echo "
INNO "; - //print_r($row ); + //print_r($row); if ($row !== false) { foreach ($row as $field => $value) { $con['C_NAME'][$i] = ''; diff --git a/pmd_general.php b/pmd_general.php index dce1d9672..4ebc29d03 100644 --- a/pmd_general.php +++ b/pmd_general.php @@ -44,7 +44,7 @@ echo ' var strLang = Array(); strLang["strModifications"] = "' . PMA_escapeJsString($strModifications) . '"; strLang["strRelationDeleted"] = "' . PMA_escapeJsString($strRelationDeleted) . '"; - strLang["strInnoDBRelationAdded"] = "' . PMA_escapeJsString($strInnoDBRelationAdded ). '"; + strLang["strInnoDBRelationAdded"] = "' . PMA_escapeJsString($strInnoDBRelationAdded). '"; strLang["strGeneralRelationFeat:strDisabled"] = "' . PMA_escapeJsString($strGeneralRelationFeat . ' : ' . $strDisabled) . '"; strLang["strInternalRelationAdded"] = "' . PMA_escapeJsString($strInternalRelationAdded) . '"; strLang["strErrorRelationAdded"] = "' . PMA_escapeJsString($strErrorRelationAdded) . '"; diff --git a/pmd_pdf.php b/pmd_pdf.php index ca9f6e120..20b946443 100644 --- a/pmd_pdf.php +++ b/pmd_pdf.php @@ -10,7 +10,7 @@ * */ include_once 'pmd_common.php'; -if ( ! isset($scale)) { +if (! isset($scale)) { $no_die_save_pos = 1; include_once 'pmd_save_pos.php'; } diff --git a/pmd_relation_new.php b/pmd_relation_new.php index 6ec0b6ea5..2f2cf96f9 100644 --- a/pmd_relation_new.php +++ b/pmd_relation_new.php @@ -82,7 +82,7 @@ if ($type_T1 == 'INNODB' and $type_T2 == 'INNODB') { . '\'' . PMA_sqlAddslashes($T1) . '\',' . '\'' . PMA_sqlAddslashes($F1) . '\')'; - if (PMA_query_as_cu( $q , false, PMA_DBI_QUERY_STORE)) { + if (PMA_query_as_cu($q , false, PMA_DBI_QUERY_STORE)) { PMD_return(1, 'strInternalRelationAdded'); } else { PMD_return(0, 'strErrorRelationAdded'); diff --git a/pmd_save_pos.php b/pmd_save_pos.php index 649bcf30d..e0b312e89 100644 --- a/pmd_save_pos.php +++ b/pmd_save_pos.php @@ -22,7 +22,7 @@ while ($tab_name = @PMA_DBI_fetch_row($alltab_rs)) { } } -if ( ! $seen_pmd_table) { +if (! $seen_pmd_table) { PMD_err_sav(); } diff --git a/scripts/setup.php b/scripts/setup.php index 8fa45e52d..9b8590ed6 100644 --- a/scripts/setup.php +++ b/scripts/setup.php @@ -14,7 +14,7 @@ */ // Grab phpMyAdmin version and PMA_dl function -define( 'PMA_MINIMUM_COMMON', TRUE ); +define('PMA_MINIMUM_COMMON', TRUE); chdir('..'); require_once './libraries/common.inc.php'; @@ -54,7 +54,7 @@ if ($eoltype == 'dos') { $crlf = "\n"; } -if (isset($_POST['configuration']) && $action != 'clear' ) { +if (isset($_POST['configuration']) && $action != 'clear') { // Grab previous configuration, if it should not be cleared $configuration = unserialize($_POST['configuration']); } else { @@ -1229,17 +1229,17 @@ function get_server_selection($cfg) { * @return mixed FALSE on failure, new config array on success */ function load_config($config_file) { - if ( file_exists( $config_file ) ) { + if (file_exists($config_file)) { $success_apply_user_config = FALSE; - $old_error_reporting = error_reporting( 0 ); - if ( function_exists( 'file_get_contents' ) ) { + $old_error_reporting = error_reporting(0); + if (function_exists('file_get_contents')) { $success_apply_user_config = eval('?>' . trim(file_get_contents($config_file))); } else { $success_apply_user_config = eval('?>' . trim(implode("\n", file($config_file)))); } - error_reporting( $old_error_reporting ); - unset( $old_error_reporting ); + error_reporting($old_error_reporting); + unset($old_error_reporting); if ($success_apply_user_config === FALSE) { message('error', 'Error while parsing configuration file!'); } elseif (!isset($cfg) || count($cfg) == 0) { @@ -1360,7 +1360,7 @@ switch ($action) { message('error', 'Empty signon URL while using signon authentication method!'); $err = TRUE; } - if ( isset($new_server['pmadb']) && strlen($new_server['pmadb'])) { + if (isset($new_server['pmadb']) && strlen($new_server['pmadb'])) { // Just use defaults, should be okay for most users $pmadb = array(); $pmadb['bookmarktable'] = 'pma_bookmark'; @@ -1879,7 +1879,7 @@ switch ($action) { break; } - $version_local = version_to_int( $PMA_Config_Setup->get('PMA_VERSION') ); + $version_local = version_to_int($PMA_Config_Setup->get('PMA_VERSION')); if ($version_local === FALSE) { message('error', 'Unparsable version string.'); break; @@ -1907,7 +1907,7 @@ switch ($action) { case '': message('notice', 'You want to configure phpMyAdmin using web interface. Please note that this only allows basic setup, please read documentation to see full description of all configuration directives.', 'Welcome'); - if ( $PMA_Config_Setup->get( 'PMA_PHP_INT_VERSION' ) < 40100) { + if ($PMA_Config_Setup->get('PMA_PHP_INT_VERSION') < 40100) { message('warning', 'Please upgrade to PHP 4.1.0, it is required for phpMyAdmin.', 'Too old PHP'); } @@ -1994,9 +1994,9 @@ echo get_action('load', 'Load', '', !$fail_dir); echo get_action('clear', 'Clear'); echo get_action('seteol', 'Change end of line', ''); echo '' . "\n\n"; diff --git a/server_binlog.php b/server_binlog.php index 413f26a58..7ba706f5d 100644 --- a/server_binlog.php +++ b/server_binlog.php @@ -106,7 +106,7 @@ if (empty($_REQUEST['dontlimitchars'])) { * Displays the sub-page heading */ echo '

' . "\n" - . ($GLOBALS['cfg']['MainPageIconic'] ? '' : '' ) + . ($GLOBALS['cfg']['MainPageIconic'] ? '' : '') . ' ' . $GLOBALS['strBinaryLog'] . "\n" . '

' . "\n"; diff --git a/server_collations.php b/server_collations.php index cea97a2a1..f815d6ac3 100644 --- a/server_collations.php +++ b/server_collations.php @@ -8,8 +8,8 @@ /** * requirements */ -if ( ! defined( 'PMA_NO_VARIABLES_IMPORT' ) ) { - define( 'PMA_NO_VARIABLES_IMPORT', true ); +if (! defined('PMA_NO_VARIABLES_IMPORT')) { + define('PMA_NO_VARIABLES_IMPORT', true); } require_once './libraries/common.inc.php'; @@ -85,7 +85,7 @@ foreach ($mysql_charsets as $current_charset) { foreach ($mysql_collations[$current_charset] as $current_collation) { $i++; echo '
' . ($cfg['PropertiesIconic'] ? ' ' : $strAction ) . "\n" + echo ' ' . ($cfg['PropertiesIconic'] ? ' ' : $strAction) . "\n" . '
' . "\n"; if ($current['SCHEMA_NAME'] != 'mysql' && (PMA_MYSQL_INT_VERSION < 50002 || $current['SCHEMA_NAME'] != 'information_schema')) { echo ' ' . "\n"; @@ -265,33 +265,33 @@ if ($databases_count > 0) { echo ' ' . "\n" - . ' ' . "\n" + . ' ' . "\n" . ' ' . htmlspecialchars($current['SCHEMA_NAME']) . "\n" . ' ' . "\n" . ' '; - if ( isset( $stat['description_function'] ) ) { - echo ''; + if (isset($stat['description_function'])) { + echo ''; } echo $value; - if ( isset( $stat['description_function'] ) ) { + if (isset($stat['description_function'])) { echo ''; } echo '' . $unit . '' . "\n" . ' '. "\n" - . ' ' .($cfg['PropertiesIconic'] ? ' ' .$strCheckPrivs . ' ' : $strCheckPrivs ). "\n" + . ' ' .($cfg['PropertiesIconic'] ? ' ' .$strCheckPrivs . ' ' : $strCheckPrivs). "\n" . '
 ' . $strTotalUC . ': ' . $databases_count . ''; - if ( isset( $stat['description_function'] ) ) { - echo ''; + if (isset($stat['description_function'])) { + echo ''; } echo $value; - if ( isset( $stat['description_function'] ) ) { + if (isset($stat['description_function'])) { echo ''; } echo '' . $unit . ' 
' . "\n"; if (!empty($variables[$var]['desc'])) { $dt_table .= ' ' . PMA_showHint($details['desc']) . "\n"; } $dt_table .= ' ' - . htmlspecialchars( empty($details['title']) - ? $var : $details['title'] ) . "\n" + . htmlspecialchars(empty($details['title']) + ? $var : $details['title']) . "\n" . ' '; switch ($details['type']) { @@ -131,8 +131,8 @@ function PMA_generateEngineDetails($variables, $like = null) { /** * Did the user request information about a certain storage engine? */ -if ( empty($_REQUEST['engine']) - || empty($mysql_storage_engines[$_REQUEST['engine']]) ) { +if (empty($_REQUEST['engine']) + || empty($mysql_storage_engines[$_REQUEST['engine']])) { /** * Displays the sub-page heading @@ -140,7 +140,7 @@ if ( empty($_REQUEST['engine']) echo '

' . "\n" . ($GLOBALS['cfg']['MainPageIconic'] ? '' : '' ) + .' width="16" height="16" alt="" />' : '') . "\n" . $strStorageEngines . "\n" . '

' . "\n"; @@ -171,7 +171,7 @@ if ( empty($_REQUEST['engine']) : '') . '">' . "\n" . '
' . "\n" + . PMA_generate_common_url(array('engine' => $engine)) . '">' . "\n" . ' ' . htmlspecialchars($details['Engine']) . "\n" . ' ' . "\n" . '
'; foreach ($array_initials as $tmp_initial => $initial_was_found) { @@ -1443,12 +1443,12 @@ if ( empty( $adduser ) && ( ! isset( $checkprivs ) || ! strlen($checkprivs) ) ) if (isset($initial) || isset($showall) || PMA_DBI_num_rows($res) < 50) { - while ( $row = PMA_DBI_fetch_assoc( $res ) ) { - $row['privs'] = PMA_extractPrivInfo( $row, true ); + while ($row = PMA_DBI_fetch_assoc($res)) { + $row['privs'] = PMA_extractPrivInfo($row, true); $db_rights[$row['User']][$row['Host']] = $row; } - @PMA_DBI_free_result( $res ); - unset( $res ); + @PMA_DBI_free_result($res); + unset($res); echo '
' . "\n" . PMA_generate_common_hidden_inputs('', '', 1) @@ -1459,7 +1459,7 @@ if ( empty( $adduser ) && ( ! isset( $checkprivs ) || ! strlen($checkprivs) ) ) . '
' . "\n" . ' ' . "\n" . ' ' . "\n" + . PMA_showHint($GLOBALS['strEnglishPrivileges']) . '' . "\n" . ' ' . "\n" . ' ' . ($GLOBALS['cfg']['PropertiesIconic'] ? '' : '') . "\n"; echo ' ' . "\n"; @@ -1467,13 +1467,13 @@ if ( empty( $adduser ) && ( ! isset( $checkprivs ) || ! strlen($checkprivs) ) ) echo ' ' . "\n"; $odd_row = true; $index_checkbox = -1; - foreach ( $db_rights as $user ) { + foreach ($db_rights as $user) { $index_checkbox++; - ksort( $user ); - foreach ( $user as $host ) { + ksort($user); + foreach ($user as $host) { $index_checkbox++; - echo ' ' . "\n" - . ' ' . "\n" + echo ' ' . "\n" + . ' ' . "\n" . ' ' . "\n" . ' ' . "\n"; echo ' ' . "\n" . ' ' . "\n" . ' ' . "\n" . ' ' . "\n" . ' ' . "\n"; $odd_row = ! $odd_row; } } - unset( $user, $host, $odd_row ); + unset($user, $host, $odd_row); echo '
' . $GLOBALS['strHost'] . '' . $GLOBALS['strPassword'] . '' . $GLOBALS['strGlobalPrivileges'] . ' ' - . PMA_showHint( $GLOBALS['strEnglishPrivileges'] ) . '' . $GLOBALS['strGrantOption'] . '' . $GLOBALS['strAction'] . '
' . htmlspecialchars($host['Host']) . ''; @@ -1491,41 +1491,41 @@ if ( empty( $adduser ) && ( ! isset( $checkprivs ) || ! strlen($checkprivs) ) ) } // end switch echo '' . "\n" - . ' ' . implode( ',' . "\n" . ' ', $host['privs'] ) . "\n" + . ' ' . implode(',' . "\n" . ' ', $host['privs']) . "\n" . ' ' . ($host['Grant_priv'] == 'Y' ? $GLOBALS['strYes'] : $GLOBALS['strNo']) . ''; - printf( $link_edit, urlencode( $host['User'] ), - urlencode( $host['Host'] ), '', '' ); + printf($link_edit, urlencode($host['User']), + urlencode($host['Host']), '', ''); echo '
' . "\n" .'' . $GLOBALS['strWithChecked'] . '' . "\n" .'' + .' onclick="if (markAllRows(\'usersForm\')) return false;">' . $GLOBALS['strCheckAll'] . '' . "\n" .'/' . "\n" .'' + .' onclick="if (unMarkAllRows(\'usersForm\')) return false;">' . $GLOBALS['strUncheckAll'] . '' . "\n"; // add/delete user fieldset echo '
' . "\n" . ' ' . "\n" - . ($GLOBALS['cfg']['PropertiesIconic'] ? ' ' . "\n" : '' ) + . ($GLOBALS['cfg']['PropertiesIconic'] ? ' ' . "\n" : '') . ' ' . $GLOBALS['strAddUser'] . '' . "\n" . '
' . "\n" . '
' . ' ' . "\n" - . ($GLOBALS['cfg']['PropertiesIconic'] ? ' ' . "\n" : '' ) + . ($GLOBALS['cfg']['PropertiesIconic'] ? ' ' . "\n" : '') . ' ' . $GLOBALS['strRemoveSelectedUsers'] . '' . "\n" . ' ' . "\n"; @@ -1548,7 +1548,7 @@ if ( empty( $adduser ) && ( ! isset( $checkprivs ) || ! strlen($checkprivs) ) ) . '
' . "\n"; } else { echo ' ' . "\n" - . '( ' . $GLOBALS['strRevokeAndDelete'] . ' )
' . "\n"; + . '(' . $GLOBALS['strRevokeAndDelete'] . ')
' . "\n"; } echo ' ' . "\n" @@ -1564,7 +1564,7 @@ if ( empty( $adduser ) && ( ! isset( $checkprivs ) || ! strlen($checkprivs) ) ) unset ($row); echo '
' . "\n" . ' ' . "\n" - . ($GLOBALS['cfg']['PropertiesIconic'] ? ' ' . "\n" : '' ) + . ($GLOBALS['cfg']['PropertiesIconic'] ? ' ' . "\n" : '') . ' ' . $GLOBALS['strAddUser'] . '' . "\n" . '
' . "\n"; } // end if (display overview) @@ -1580,27 +1580,27 @@ if ( empty( $adduser ) && ( ! isset( $checkprivs ) || ! strlen($checkprivs) ) ) // A user was selected -> display the user's properties echo '

' . "\n" - . ($GLOBALS['cfg']['PropertiesIconic'] ? '' : '' ) + . ($GLOBALS['cfg']['PropertiesIconic'] ? '' : '') . $GLOBALS['strUser'] . ' \'' . htmlspecialchars($username) . '\'@\'' . htmlspecialchars($hostname) . '\'' . "\n"; - if ( isset( $dbname ) && strlen($dbname) ) { - if ( $dbname_is_wildcard ) { + if (isset($dbname) && strlen($dbname)) { + if ($dbname_is_wildcard) { echo ' - ' . $GLOBALS['strDatabases']; } else { echo ' - ' . $GLOBALS['strDatabase']; } $url_dbname = urlencode(str_replace('\_', '_', $dbname)); echo ' ' . htmlspecialchars($dbname) . '' . "\n"; - if ( isset( $tablename ) && strlen($tablename) ) { + if (isset($tablename) && strlen($tablename)) { echo ' - ' . $GLOBALS['strTable'] . ' ' . htmlspecialchars($tablename) . '' . "\n"; } unset($url_dbname); } echo ' : ' . $GLOBALS['strEditPrivileges'] . '

' . "\n"; $res = PMA_DBI_query('SELECT \'foo\' FROM `mysql`.`user` WHERE ' . PMA_convert_using('User') . ' = ' . PMA_convert_using(PMA_sqlAddslashes($username), 'quoted') . ' AND ' . PMA_convert_using('Host') . ' = ' . PMA_convert_using($hostname, 'quoted') . ';', null, PMA_DBI_QUERY_STORE); - $user_does_not_exists = (PMA_DBI_num_rows( $res ) < 1); + $user_does_not_exists = (PMA_DBI_num_rows($res) < 1); PMA_DBI_free_result($res); unset($res); - if ( $user_does_not_exists ) { + if ($user_does_not_exists) { echo $GLOBALS['strUserNotFound']; PMA_displayLoginInformationFields(); //require_once './libraries/footer.inc.php'; @@ -1609,18 +1609,18 @@ if ( empty( $adduser ) && ( ! isset( $checkprivs ) || ! strlen($checkprivs) ) ) . PMA_generate_common_hidden_inputs('', '', 3) . '' . "\n" . '' . "\n"; - if ( isset( $dbname ) && strlen($dbname) ) { + if (isset($dbname) && strlen($dbname)) { echo '' . "\n"; - if ( isset( $tablename ) && strlen($tablename) ) { + if (isset($tablename) && strlen($tablename)) { echo ' ' . "\n"; } } - PMA_displayPrivTable((( ! isset( $dbname ) || ! strlen($dbname) ) ? '*' : $dbname), - ((( ! isset( $dbname ) || ! strlen($dbname) ) || ( ! isset( $tablename ) || ! strlen($tablename) )) ? '*' : $tablename), + PMA_displayPrivTable(((! isset($dbname) || ! strlen($dbname)) ? '*' : $dbname), + (((! isset($dbname) || ! strlen($dbname)) || (! isset($tablename) || ! strlen($tablename))) ? '*' : $tablename), TRUE, 3); echo '' . "\n"; - if ( ( ! isset( $tablename ) || ! strlen($tablename) ) && empty( $dbname_is_wildcard ) ) { + if ((! isset($tablename) || ! strlen($tablename)) && empty($dbname_is_wildcard)) { // no table name was given, display all table specific rights // but only if $dbname contains no wildcards @@ -1631,13 +1631,13 @@ if ( empty( $adduser ) && ( ! isset( $checkprivs ) || ! strlen($checkprivs) ) ) . '' . "\n" . '' . "\n" . '
' . "\n" - . '' . (( ! isset( $dbname ) || ! strlen($dbname) ) ? $GLOBALS['strDbPrivileges'] : $GLOBALS['strTblPrivileges']) . '' . "\n" + . '' . ((! isset($dbname) || ! strlen($dbname)) ? $GLOBALS['strDbPrivileges'] : $GLOBALS['strTblPrivileges']) . '' . "\n" . '' . "\n" . '' . "\n" - . '' . "\n" + . '' . "\n" . ' ' . "\n" . ' ' . "\n" - . ' ' . "\n" + . ' ' . "\n" . ' ' . "\n" . '' . "\n" . '' . "\n" @@ -1654,7 +1654,7 @@ if ( empty( $adduser ) && ( ! isset( $checkprivs ) || ! strlen($checkprivs) ) ) // we also want privielgs for this user not in table `db` but in other table $tables = PMA_DBI_fetch_result('SHOW TABLES FROM `mysql`;'); - if ( ( ! isset( $dbname ) || ! strlen($dbname) ) ) { + if ((! isset($dbname) || ! strlen($dbname))) { // no db name given, so we want all privs for the given user @@ -1663,8 +1663,8 @@ if ( empty( $adduser ) && ( ! isset( $checkprivs ) || ! strlen($checkprivs) ) ) ); $db_rights_sqls = array(); - foreach ( $tables_to_search_for_users as $table_search_in ) { - if ( in_array( $table_search_in, $tables ) ) { + foreach ($tables_to_search_for_users as $table_search_in) { + if (in_array($table_search_in, $tables)) { $db_rights_sqls[] = ' SELECT DISTINCT `Db` FROM `mysql`.`' . $table_search_in . '` @@ -1675,48 +1675,48 @@ if ( empty( $adduser ) && ( ! isset( $checkprivs ) || ! strlen($checkprivs) ) ) $user_defaults = array( 'Db' => '', 'Grant_priv' => 'N', - 'privs' => array( 'USAGE' ), + 'privs' => array('USAGE'), 'Table_privs' => true, ); // for the rights $db_rights = array(); - if ( PMA_MYSQL_INT_VERSION >= 40000 ) { - $db_rights_sql = '(' . implode( ') UNION (', $db_rights_sqls ) . ')' + if (PMA_MYSQL_INT_VERSION >= 40000) { + $db_rights_sql = '(' . implode(') UNION (', $db_rights_sqls) . ')' .' ORDER BY `Db` ASC'; - $db_rights_result = PMA_DBI_query( $db_rights_sql ); + $db_rights_result = PMA_DBI_query($db_rights_sql); - while ( $db_rights_row = PMA_DBI_fetch_assoc( $db_rights_result ) ) { - $db_rights_row = array_merge( $user_defaults, $db_rights_row ); + while ($db_rights_row = PMA_DBI_fetch_assoc($db_rights_result)) { + $db_rights_row = array_merge($user_defaults, $db_rights_row); // only Db names in the table `mysql`.`db` uses wildcards // as we are in the db specific rights display we want // all db names escaped, also from other sources $db_rights_row['Db'] = PMA_escape_mysql_wildcards( - $db_rights_row['Db'] ); + $db_rights_row['Db']); $db_rights[$db_rights_row['Db']] = $db_rights_row; } } else { - foreach ( $db_rights_sqls as $db_rights_sql ) { - $db_rights_result = PMA_DBI_query( $db_rights_sql ); + foreach ($db_rights_sqls as $db_rights_sql) { + $db_rights_result = PMA_DBI_query($db_rights_sql); - while ( $db_rights_row = PMA_DBI_fetch_assoc( $db_rights_result ) ) { - $db_rights_row = array_merge( $user_defaults, $db_rights_row ); + while ($db_rights_row = PMA_DBI_fetch_assoc($db_rights_result)) { + $db_rights_row = array_merge($user_defaults, $db_rights_row); $db_rights[$db_rights_row['Db']] = $db_rights_row; } } } - PMA_DBI_free_result( $db_rights_result ); - unset( $db_rights_sql, $db_rights_sqls, $db_rights_result, $db_rights_row ); + PMA_DBI_free_result($db_rights_result); + unset($db_rights_sql, $db_rights_sqls, $db_rights_result, $db_rights_row); $sql_query = 'SELECT * FROM `mysql`.`db`' . $user_host_condition . ' ORDER BY `Db` ASC'; - $res = PMA_DBI_query( $sql_query ); + $res = PMA_DBI_query($sql_query); $sql_query = ''; - while ( $row = PMA_DBI_fetch_assoc( $res ) ) { - if ( isset( $db_rights[$row['Db']] ) ) { - $db_rights[$row['Db']] = array_merge( $db_rights[$row['Db']], $row ); + while ($row = PMA_DBI_fetch_assoc($res)) { + if (isset($db_rights[$row['Db']])) { + $db_rights[$row['Db']] = array_merge($db_rights[$row['Db']], $row); } else { $db_rights[$row['Db']] = $row; } @@ -1724,8 +1724,8 @@ if ( empty( $adduser ) && ( ! isset( $checkprivs ) || ! strlen($checkprivs) ) ) // so we can drop this db rights $db_rights[$row['Db']]['can_delete'] = true; } - PMA_DBI_free_result( $res ); - unset( $row, $res ); + PMA_DBI_free_result($res); + unset($row, $res); } else { @@ -1734,15 +1734,15 @@ if ( empty( $adduser ) && ( ! isset( $checkprivs ) || ! strlen($checkprivs) ) ) $user_host_condition .= ' AND ' . PMA_convert_using('`Db`') - .' LIKE ' . PMA_convert_using( $dbname, 'quoted' ); + .' LIKE ' . PMA_convert_using($dbname, 'quoted'); $tables_to_search_for_users = array( 'columns_priv', ); $db_rights_sqls = array(); - foreach ( $tables_to_search_for_users as $table_search_in ) { - if ( in_array( $table_search_in, $tables ) ) { + foreach ($tables_to_search_for_users as $table_search_in) { + if (in_array($table_search_in, $tables)) { $db_rights_sqls[] = ' SELECT DISTINCT `Table_name` FROM `mysql`.`' . $table_search_in . '` @@ -1753,35 +1753,35 @@ if ( empty( $adduser ) && ( ! isset( $checkprivs ) || ! strlen($checkprivs) ) ) $user_defaults = array( 'Table_name' => '', 'Grant_priv' => 'N', - 'privs' => array( 'USAGE' ), + 'privs' => array('USAGE'), 'Column_priv' => true, ); // for the rights $db_rights = array(); - if ( PMA_MYSQL_INT_VERSION >= 40000 ) { - $db_rights_sql = '(' . implode( ') UNION (', $db_rights_sqls ) . ')' + if (PMA_MYSQL_INT_VERSION >= 40000) { + $db_rights_sql = '(' . implode(') UNION (', $db_rights_sqls) . ')' .' ORDER BY `Table_name` ASC'; - $db_rights_result = PMA_DBI_query( $db_rights_sql ); + $db_rights_result = PMA_DBI_query($db_rights_sql); - while ( $db_rights_row = PMA_DBI_fetch_assoc( $db_rights_result ) ) { - $db_rights_row = array_merge( $user_defaults, $db_rights_row ); + while ($db_rights_row = PMA_DBI_fetch_assoc($db_rights_result)) { + $db_rights_row = array_merge($user_defaults, $db_rights_row); $db_rights[$db_rights_row['Table_name']] = $db_rights_row; } } else { - foreach ( $db_rights_sqls as $db_rights_sql ) { - $db_rights_result = PMA_DBI_query( $db_rights_sql ); + foreach ($db_rights_sqls as $db_rights_sql) { + $db_rights_result = PMA_DBI_query($db_rights_sql); - while ( $db_rights_row = PMA_DBI_fetch_assoc( $db_rights_result ) ) { - $db_rights_row = array_merge( $user_defaults, $db_rights_row ); + while ($db_rights_row = PMA_DBI_fetch_assoc($db_rights_result)) { + $db_rights_row = array_merge($user_defaults, $db_rights_row); $db_rights[$db_rights_row['Table_name']] = $db_rights_row; } } } - PMA_DBI_free_result( $db_rights_result ); - unset( $db_rights_sql, $db_rights_sqls, $db_rights_result, $db_rights_row ); + PMA_DBI_free_result($db_rights_result); + unset($db_rights_sql, $db_rights_sqls, $db_rights_result, $db_rights_row); $sql_query = 'SELECT `Table_name`,' @@ -1791,58 +1791,58 @@ if ( empty( $adduser ) && ( ! isset( $checkprivs ) || ! strlen($checkprivs) ) ) .' FROM `mysql`.`tables_priv`' . $user_host_condition .' ORDER BY `Table_name` ASC;'; - $res = PMA_DBI_query( $sql_query ); + $res = PMA_DBI_query($sql_query); $sql_query = ''; - while ( $row = PMA_DBI_fetch_assoc( $res ) ) { - if ( isset( $db_rights[$row['Table_name']] ) ) { - $db_rights[$row['Table_name']] = array_merge( $db_rights[$row['Table_name']], $row ); + while ($row = PMA_DBI_fetch_assoc($res)) { + if (isset($db_rights[$row['Table_name']])) { + $db_rights[$row['Table_name']] = array_merge($db_rights[$row['Table_name']], $row); } else { $db_rights[$row['Table_name']] = $row; } } - PMA_DBI_free_result( $res ); - unset( $row, $res ); + PMA_DBI_free_result($res); + unset($row, $res); } - ksort( $db_rights ); + ksort($db_rights); // display rows - if ( count( $db_rights ) < 1 ) { + if (count($db_rights) < 1) { echo '' . "\n" . ' ' . "\n" . '' . "\n"; } else { $odd_row = true; $found_rows = array(); - //while ( $row = PMA_DBI_fetch_assoc( $res ) ) { - foreach ( $db_rights as $row ) { - $found_rows[] = ( ! isset( $dbname ) || ! strlen($dbname) ) ? $row['Db'] : $row['Table_name']; + //while ($row = PMA_DBI_fetch_assoc($res)) { + foreach ($db_rights as $row) { + $found_rows[] = (! isset($dbname) || ! strlen($dbname)) ? $row['Db'] : $row['Table_name']; - echo '' . "\n" - . ' ' . "\n" + echo '' . "\n" + . ' ' . "\n" . ' ' . "\n" - . ' ' . "\n" + . ' ' . "\n" . ' ' . "\n" . ' ' . "\n" . ' ' . "\n" . '' . "\n"; @@ -1853,16 +1853,16 @@ if ( empty( $adduser ) && ( ! isset( $checkprivs ) || ! strlen($checkprivs) ) ) echo '' . "\n" . '
' . (( ! isset( $dbname ) || ! strlen($dbname) ) ? $GLOBALS['strDatabase'] : $GLOBALS['strTable']) . '
' . ((! isset($dbname) || ! strlen($dbname)) ? $GLOBALS['strDatabase'] : $GLOBALS['strTable']) . '' . $GLOBALS['strPrivileges'] . '' . $GLOBALS['strGrantOption'] . '' . (( ! isset( $dbname ) || ! strlen($dbname) ) ? $GLOBALS['strTblPrivileges'] : $GLOBALS['strColumnPrivileges']) . '' . ((! isset($dbname) || ! strlen($dbname)) ? $GLOBALS['strTblPrivileges'] : $GLOBALS['strColumnPrivileges']) . '' . $GLOBALS['strAction'] . '
' . $GLOBALS['strNone'] . '
' . htmlspecialchars(( ! isset( $dbname ) || ! strlen($dbname) ) ? $row['Db'] : $row['Table_name']) . '
' . htmlspecialchars((! isset($dbname) || ! strlen($dbname)) ? $row['Db'] : $row['Table_name']) . '' . "\n" . ' ' . join(',' . "\n" . ' ', PMA_extractPrivInfo($row, TRUE)) . "\n" . ' ' . (((( ! isset( $dbname ) || ! strlen($dbname) ) && $row['Grant_priv'] == 'Y') || (isset($dbname) && strlen($dbname) && in_array('Grant', explode(',', $row['Table_priv'])))) ? $GLOBALS['strYes'] : $GLOBALS['strNo']) . '' . ((((! isset($dbname) || ! strlen($dbname)) && $row['Grant_priv'] == 'Y') || (isset($dbname) && strlen($dbname) && in_array('Grant', explode(',', $row['Table_priv'])))) ? $GLOBALS['strYes'] : $GLOBALS['strNo']) . ''; - if ( ! empty( $row['Table_privs'] ) || ! empty ( $row['Column_priv'] ) ) { + if (! empty($row['Table_privs']) || ! empty ($row['Column_priv'])) { echo $GLOBALS['strYes']; } else { echo $GLOBALS['strNo']; } echo ''; - printf( $link_edit, urlencode( $username ), - urlencode( $hostname ), - urlencode( ( ! isset( $dbname ) || ! strlen($dbname) ) ? $row['Db'] : $dbname ), - urlencode( ( ! isset( $dbname ) || ! strlen($dbname) ) ? '' : $row['Table_name'] ) ); + printf($link_edit, urlencode($username), + urlencode($hostname), + urlencode((! isset($dbname) || ! strlen($dbname)) ? $row['Db'] : $dbname), + urlencode((! isset($dbname) || ! strlen($dbname)) ? '' : $row['Table_name'])); echo ''; - if ( ! empty( $row['can_delete'] ) || isset( $row['Table_name'] ) && strlen($row['Table_name']) ) { - printf( $link_revoke, urlencode( $username ), - urlencode( $hostname ), - urlencode( ( ! isset( $dbname ) || ! strlen($dbname) ) ? $row['Db'] : $dbname ), - urlencode( ( ! isset( $dbname ) || ! strlen($dbname) ) ? '' : $row['Table_name'] ) ); + if (! empty($row['can_delete']) || isset($row['Table_name']) && strlen($row['Table_name'])) { + printf($link_revoke, urlencode($username), + urlencode($hostname), + urlencode((! isset($dbname) || ! strlen($dbname)) ? $row['Db'] : $dbname), + urlencode((! isset($dbname) || ! strlen($dbname)) ? '' : $row['Table_name'])); } echo '
' . "\n"; - if ( ! isset( $dbname ) || ! strlen($dbname) ) { + if (! isset($dbname) || ! strlen($dbname)) { // no database name was give, display select db - if ( ! empty( $found_rows ) ) { + if (! empty($found_rows)) { $pred_db_array = array_diff( - PMA_DBI_fetch_result( 'SHOW DATABASES;' ), - $found_rows ); + PMA_DBI_fetch_result('SHOW DATABASES;'), + $found_rows); } else { - $pred_db_array =PMA_DBI_fetch_result( 'SHOW DATABASES;' ); + $pred_db_array =PMA_DBI_fetch_result('SHOW DATABASES;'); } echo ' ' . "\n"; @@ -1870,14 +1870,14 @@ if ( empty( $adduser ) && ( ! isset( $checkprivs ) || ! strlen($checkprivs) ) ) echo ' ' . "\n"; } echo ' ' . "\n" - .PMA_showHint( $GLOBALS['strEscapeWildcards'] ); + .PMA_showHint($GLOBALS['strEscapeWildcards']); } else { echo ' ' . "\n" . ' ' . "\n"; @@ -1889,7 +1889,7 @@ if ( empty( $adduser ) && ( ! isset( $checkprivs ) || ! strlen($checkprivs) ) ) } } PMA_DBI_free_result($res); - unset( $res, $row ); + unset($res, $row); if (!empty($pred_tbl_array)) { echo ' ' . "\n" @@ -1944,7 +1944,7 @@ if ( empty( $adduser ) && ( ! isset( $checkprivs ) || ! strlen($checkprivs) ) ) . '' . "\n" . '
' . "\n" . ' ' . $GLOBALS['strChangeCopyUser'] . '' . "\n"; - PMA_displayLoginInformationFields('change', 3 ); + PMA_displayLoginInformationFields('change', 3); echo '
' . "\n" . ' ' . $GLOBALS['strChangeCopyMode'] . '' . "\n" . '