diff --git a/import.php b/import.php index 2a4f4e15e7..78f238730c 100644 --- a/import.php +++ b/import.php @@ -77,7 +77,7 @@ if (! empty($sql_query)) { $ajax_reload['table_name'] = PMA_Util::unQuote($rename_table_names[2]); $ajax_reload['reload'] = true; } - + $sql_query = ''; } elseif (! empty($sql_localfile)) { // run SQL file on server @@ -565,7 +565,7 @@ if (strlen($sql_query) <= $GLOBALS['cfg']['MaxCharactersInDisplayedSQL']) { // There was an error? if (isset($my_die)) { - foreach ($my_die AS $key => $die) { + foreach ($my_die as $key => $die) { PMA_Util::mysqlDie( $die['error'], $die['sql'], '', $err_url, $error ); diff --git a/libraries/Config.class.php b/libraries/Config.class.php index dfb24e38d2..8c4ddee607 100644 --- a/libraries/Config.class.php +++ b/libraries/Config.class.php @@ -612,7 +612,7 @@ class PMA_Config } else { $link = 'https://api.github.com/repos/phpmyadmin/phpmyadmin/git/commits/' . $hash; - $is_found = $this->checkHTTP($link, !$commit); + $is_found = $this->checkHTTP($link, ! $commit); switch($is_found) { case false: $is_remote_commit = false; @@ -721,7 +721,7 @@ class PMA_Config } $ch = curl_init($link); curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 0); - curl_setopt($ch, CURLOPT_NOBODY, !$get_body); + curl_setopt($ch, CURLOPT_NOBODY, ! $get_body); curl_setopt($ch, CURLOPT_HEADER, 1); curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 0); diff --git a/libraries/DisplayResults.class.php b/libraries/DisplayResults.class.php index 073df10a46..ab2f8206d0 100644 --- a/libraries/DisplayResults.class.php +++ b/libraries/DisplayResults.class.php @@ -2656,7 +2656,7 @@ class PMA_DisplayResults /** - * Get the values for one data row + * Get the values for one data row * * @param integer &$dt_result the link id associated to the query * which results have to be displayed @@ -2696,8 +2696,8 @@ class PMA_DisplayResults $row_info = $this->_getRowInfoForSpecialLinks($row, $col_order); - for ($currentColumn = 0; - $currentColumn < $this->__get('fields_cnt'); + for ($currentColumn = 0; + $currentColumn < $this->__get('fields_cnt'); ++$currentColumn) { // assign $i with appropriate column order @@ -3462,7 +3462,7 @@ class PMA_DisplayResults /** - * Get the combined classes for a column + * Get the combined classes for a column * * @param string $grid_edit_class the class for all editable columns * @param string $not_null_class the class for not null columns @@ -4036,7 +4036,7 @@ class PMA_DisplayResults list($col_order, $col_visib) = $this->_getColumnParams($analyzed_sql); // Prepares data - foreach ($vertical_display['desc'] AS $j => $val) { + foreach ($vertical_display['desc'] as $j => $val) { // assign appropriate key with current column order $key = $col_order ? $col_order[$j] : $j; diff --git a/libraries/Index.class.php b/libraries/Index.class.php index 152b155475..8621955080 100644 --- a/libraries/Index.class.php +++ b/libraries/Index.class.php @@ -661,7 +661,8 @@ class PMA_Index . ''; if (PMA_MYSQL_INT_VERSION > 50500 - && $column->getSeqInIndex() == 1) { + && $column->getSeqInIndex() == 1 + ) { $r .= '' . htmlspecialchars($index->getComments()) . ''; } diff --git a/libraries/Theme.class.php b/libraries/Theme.class.php index bf1ee8f6f8..9f2f640e6e 100644 --- a/libraries/Theme.class.php +++ b/libraries/Theme.class.php @@ -374,7 +374,7 @@ class PMA_Theme global $cfg; $css_string = ''; - foreach ($cfg['SQP']['fmtColor'] AS $key => $col) { + foreach ($cfg['SQP']['fmtColor'] as $key => $col) { $css_string .= $this->buildSQPCssRule('syntax_' . $key, 'color', $col); } diff --git a/libraries/bookmark.lib.php b/libraries/bookmark.lib.php index 9f3d52f4f0..46ac78a6e3 100644 --- a/libraries/bookmark.lib.php +++ b/libraries/bookmark.lib.php @@ -122,9 +122,9 @@ function PMA_Bookmark_get($db, $id, $id_field = 'id', $action_bookmark_all = fal . '.' . PMA_Util::backquote($cfgBookmark['table']) . ' WHERE dbase = \'' . PMA_Util::sqlAddSlashes($db) . '\''; - if (!$action_bookmark_all) { + if (! $action_bookmark_all) { $query .= ' AND (user = \'' . PMA_Util::sqlAddSlashes($cfgBookmark['user']) . '\''; - if (!$exact_user_match) { + if (! $exact_user_match) { $query .= ' OR user = \'\''; } $query .= ')'; diff --git a/libraries/common.inc.php b/libraries/common.inc.php index 5e0976827d..c26acc3cdb 100644 --- a/libraries/common.inc.php +++ b/libraries/common.inc.php @@ -907,14 +907,14 @@ if (! defined('PMA_MINIMUM_COMMON')) { } // end if // is root allowed? - if (!$cfg['Server']['AllowRoot'] && $cfg['Server']['user'] == 'root') { + if (! $cfg['Server']['AllowRoot'] && $cfg['Server']['user'] == 'root') { $allowDeny_forbidden = true; PMA_log_user($cfg['Server']['user'], 'root-denied'); $auth_plugin->authFails(); } // is a login without password allowed? - if (!$cfg['Server']['AllowNoPassword'] && $cfg['Server']['password'] == '') { + if (! $cfg['Server']['AllowNoPassword'] && $cfg['Server']['password'] == '') { $login_without_password_is_forbidden = true; PMA_log_user($cfg['Server']['user'], 'empty-denied'); $auth_plugin->authFails(); diff --git a/libraries/config/ConfigFile.class.php b/libraries/config/ConfigFile.class.php index 82ba052df8..db431b2471 100644 --- a/libraries/config/ConfigFile.class.php +++ b/libraries/config/ConfigFile.class.php @@ -423,7 +423,7 @@ class ConfigFile $dsn = $this->getValue("$path/extension") . '://'; if ($this->getValue("$path/auth_type") == 'config') { $dsn .= $this->getValue("$path/user"); - if (!$this->getValue("$path/nopassword")) { + if (! $this->getValue("$path/nopassword")) { $dsn .= ':***'; } $dsn .= '@'; diff --git a/libraries/config/Form.class.php b/libraries/config/Form.class.php index d82e66b69e..b06be3f043 100644 --- a/libraries/config/Form.class.php +++ b/libraries/config/Form.class.php @@ -105,7 +105,7 @@ class Form } $keys[] = is_bool($value[$i]) ? (int)$value[$i] : $value[$i]; } - if (!$has_string_keys) { + if (! $has_string_keys) { $value = array_combine($keys, $value); } } diff --git a/libraries/config/FormDisplay.class.php b/libraries/config/FormDisplay.class.php index ee86f5384d..686eb29736 100644 --- a/libraries/config/FormDisplay.class.php +++ b/libraries/config/FormDisplay.class.php @@ -172,7 +172,7 @@ class FormDisplay foreach ($errors as $path => $error_list) { $work_path = array_search($path, $this->_systemPaths); // field error - if (!$work_path) { + if (! $work_path) { // form error, fix path $work_path = $path; } @@ -219,7 +219,7 @@ class FormDisplay break; } } - if (!$is_new_server) { + if (! $is_new_server) { $this->_validate(); } @@ -274,7 +274,7 @@ class FormDisplay PMA_displayFormBottom(); // if not already done, send strings used for valdiation to JavaScript - if (!$js_lang_sent) { + if (! $js_lang_sent) { $js_lang_sent = true; $js_lang = array(); foreach ($this->_jsLangStrings as $strName => $strValue) { diff --git a/libraries/config/FormDisplay.tpl.php b/libraries/config/FormDisplay.tpl.php index 064ff0dbfc..13b5090bc7 100644 --- a/libraries/config/FormDisplay.tpl.php +++ b/libraries/config/FormDisplay.tpl.php @@ -30,7 +30,7 @@ function PMA_displayFormTop($action = null, $method = 'post', $hidden_fields = n echo ''; // we do validation on page refresh when browser remembers field values, // add a field with known value which will be used for checks - if (!$has_check_page_refresh) { + if (! $has_check_page_refresh) { $has_check_page_refresh = true; echo '' . "\n"; @@ -352,7 +352,7 @@ function PMA_displayGroupHeader($header_text) global $_FormDisplayGroup; $_FormDisplayGroup++; - if (!$header_text) { + if (! $header_text) { return; } $colspan = defined('PMA_SETUP') diff --git a/libraries/config/validate.lib.php b/libraries/config/validate.lib.php index cd03b6bed9..6079b544ed 100644 --- a/libraries/config/validate.lib.php +++ b/libraries/config/validate.lib.php @@ -114,10 +114,10 @@ function PMA_config_validate($validator_id, &$values, $isPostSource) if (is_array($r)) { foreach ($r as $key => $error_list) { // skip empty values if $isPostSource is false - if (!$isPostSource && empty($error_list)) { + if (! $isPostSource && empty($error_list)) { continue; } - if (!isset($result[$key])) { + if (! isset($result[$key])) { $result[$key] = array(); } $result[$key] = array_merge($result[$key], (array)$error_list); @@ -210,7 +210,7 @@ function test_db_connection( if ($extension == 'drizzle') { while (1) { $drizzle = @drizzle_create(); - if (!$drizzle) { + if (! $drizzle) { $error = __('Could not initialize Drizzle connection library'); break; } @@ -219,7 +219,7 @@ function test_db_connection( : @drizzle_con_add_tcp( $drizzle, $host, $port, $user, $pass, null, 0 ); - if (!$conn) { + if (! $conn) { $error = __('Could not connect to Drizzle server'); drizzle_free($drizzle); break; @@ -227,7 +227,7 @@ function test_db_connection( // connection object is set up but we have to send some query // to actually connect $res = @drizzle_query($conn, 'SELECT 1'); - if (!$res) { + if (! $res) { $error = __('Could not connect to Drizzle server'); } else { drizzle_result_free($res); @@ -238,14 +238,14 @@ function test_db_connection( } } else if ($extension == 'mysql') { $conn = @mysql_connect($host . $socket . $port, $user, $pass); - if (!$conn) { + if (! $conn) { $error = __('Could not connect to MySQL server'); } else { mysql_close($conn); } } else { $conn = @mysqli_connect($host, $user, $pass, null, $port, $socket); - if (!$conn) { + if (! $conn) { $error = __('Could not connect to MySQL server'); } else { mysqli_close($conn); @@ -299,7 +299,7 @@ function validate_server($path, $values) $error = true; } - if (!$error && $values['Servers/1/auth_type'] == 'config') { + if (! $error && $values['Servers/1/auth_type'] == 'config') { $password = $values['Servers/1/nopassword'] ? null : $values['Servers/1/password']; $test = test_db_connection( @@ -351,7 +351,7 @@ function validate_pmadb($path, $values) = __('Empty phpMyAdmin control user password while using pmadb'); $error = true; } - if (!$error) { + if (! $error) { $test = test_db_connection( $values['Servers/1/extension'], $values['Servers/1/connect_type'], $values['Servers/1/host'], $values['Servers/1/port'], @@ -474,8 +474,8 @@ function test_number( } if (intval($values[$path]) != $values[$path] - || (!$allow_neg && $values[$path] < 0) - || (!$allow_zero && $values[$path] == 0) + || (! $allow_neg && $values[$path] < 0) + || (! $allow_zero && $values[$path] == 0) || $values[$path] > $max_value ) { return $error_string; diff --git a/libraries/database_interface.lib.php b/libraries/database_interface.lib.php index 0a43ce44a1..b6334abb84 100644 --- a/libraries/database_interface.lib.php +++ b/libraries/database_interface.lib.php @@ -612,7 +612,7 @@ function PMA_DBI_get_tables_full($database, $table = false, $each_tables = apc_fetch($cacheKey); } - if (!$each_tables) { + if (! $each_tables) { $each_tables = PMA_DBI_fetch_result($sql, 'Name', null, $link); } @@ -855,7 +855,7 @@ function PMA_DBI_get_databases_full($database = null, $force_stats = false, * cause MySQL does not support natural ordering, we have to do it afterward */ $limit = ''; - if (!$GLOBALS['cfg']['NaturalOrder']) { + if (! $GLOBALS['cfg']['NaturalOrder']) { if ($limit_count) { $limit = ' LIMIT ' . $limit_count . ' OFFSET ' . $limit_offset; } @@ -1313,7 +1313,7 @@ function PMA_DBI_get_columns($database, $table, $column = null, $full = false, $has_pk_candidates = true; } } - if (!$has_pk && $has_pk_candidates) { + if (! $has_pk && $has_pk_candidates) { // check whether we can promote some unique index to PRI $sql = " SELECT i.index_name, p.column_name diff --git a/libraries/dbi/drizzle-wrappers.lib.php b/libraries/dbi/drizzle-wrappers.lib.php index 430a78d97f..ba560f71f9 100644 --- a/libraries/dbi/drizzle-wrappers.lib.php +++ b/libraries/dbi/drizzle-wrappers.lib.php @@ -298,7 +298,7 @@ class PMA_DrizzleResult */ public function getColumns() { - if (!$this->_columns) { + if (! $this->_columns) { $this->_readColumns(); } return $this->_columns; @@ -324,7 +324,7 @@ class PMA_DrizzleResult */ private function _transformResultRow(&$row, $fetchMode) { - if (!$row) { + if (! $row) { return; } @@ -354,7 +354,7 @@ class PMA_DrizzleResult { // read column names on first fetch, only buffered results // allow for reading it later - if (!$this->_columns) { + if (! $this->_columns) { $this->_readColumns(); } if ($fetchMode === null) { diff --git a/libraries/dbi/drizzle.dbi.lib.php b/libraries/dbi/drizzle.dbi.lib.php index 093e5d624b..f4384c531c 100644 --- a/libraries/dbi/drizzle.dbi.lib.php +++ b/libraries/dbi/drizzle.dbi.lib.php @@ -108,14 +108,14 @@ function PMA_DBI_connect($user, $password, $is_controluser = false, $client_flags |= DRIZZLE_CAPABILITIES_SSL; } - if (!$server) { + if (! $server) { $link = @PMA_DBI_real_connect( $drizzle, $cfg['Server']['host'], $server_port, $server_socket, $user, $password, false, $client_flags ); // Retry with empty password if we're allowed to if ($link == false && isset($cfg['Server']['nopassword']) - && $cfg['Server']['nopassword'] && !$is_controluser + && $cfg['Server']['nopassword'] && ! $is_controluser ) { $link = @PMA_DBI_real_connect( $drizzle, $cfg['Server']['host'], $server_port, $server_socket, diff --git a/libraries/dbi/mysql.dbi.lib.php b/libraries/dbi/mysql.dbi.lib.php index 6a7e15df5f..a04c2f9082 100644 --- a/libraries/dbi/mysql.dbi.lib.php +++ b/libraries/dbi/mysql.dbi.lib.php @@ -129,14 +129,14 @@ function PMA_DBI_connect( $client_flags |= MYSQL_CLIENT_SSL; } - if (!$server) { + if (! $server) { $link = PMA_DBI_real_connect( $cfg['Server']['host'] . $server_port . $server_socket, $user, $password, empty($client_flags) ? null : $client_flags ); // Retry with empty password if we're allowed to - if (empty($link) && $cfg['Server']['nopassword'] && !$is_controluser) { + if (empty($link) && $cfg['Server']['nopassword'] && ! $is_controluser) { $link = PMA_DBI_real_connect( $cfg['Server']['host'] . $server_port . $server_socket, $user, '', empty($client_flags) ? null : $client_flags diff --git a/libraries/dbi/mysqli.dbi.lib.php b/libraries/dbi/mysqli.dbi.lib.php index 5f08d69981..55a3d47762 100644 --- a/libraries/dbi/mysqli.dbi.lib.php +++ b/libraries/dbi/mysqli.dbi.lib.php @@ -161,7 +161,7 @@ function PMA_DBI_connect( $client_flags |= MYSQLI_CLIENT_SSL; } - if (!$server) { + if (! $server) { $return_value = @PMA_DBI_real_connect( $link, $cfg['Server']['host'], @@ -175,7 +175,7 @@ function PMA_DBI_connect( // Retry with empty password if we're allowed to if ($return_value == false && isset($cfg['Server']['nopassword']) && $cfg['Server']['nopassword'] - && !$is_controluser + && ! $is_controluser ) { $return_value = @PMA_DBI_real_connect( $link, diff --git a/libraries/mult_submits.inc.php b/libraries/mult_submits.inc.php index 181bfc1aa3..24368d945a 100644 --- a/libraries/mult_submits.inc.php +++ b/libraries/mult_submits.inc.php @@ -127,7 +127,7 @@ if (! empty($submit_mult) case 'change': PMA_displayHtmlForColumnChange($db, $table, $selected, $action); // execution stops here but PMA_Response correctly finishes - // the rendering + // the rendering exit; case 'browse': // this should already be handled by tbl_structure.php @@ -165,7 +165,7 @@ if (!empty($submit_mult) && !empty($what)) { } $selected_cnt = count($selected); $i = 0; - foreach ($selected AS $idx => $sval) { + foreach ($selected as $idx => $sval) { switch ($what) { case 'row_delete': $full_query .= 'DELETE FROM ' . PMA_Util::backquote($db) . '.' . PMA_Util::backquote($table) @@ -503,7 +503,7 @@ if (!empty($submit_mult) && !empty($what)) { PMA_DBI_select_db($db); } $result = PMA_DBI_query($a_query); - + if ($query_type == 'drop_db') { PMA_clearTransformations($selected[$i]); } elseif ($query_type == 'drop_tbl') { @@ -511,7 +511,7 @@ if (!empty($submit_mult) && !empty($what)) { } else if ($query_type == 'drop_fld') { PMA_clearTransformations($db, $table, $selected[$i]); } - + } // end if } // end for diff --git a/libraries/mysql_charsets.lib.php b/libraries/mysql_charsets.lib.php index 45c48afe34..d0a73cec4d 100644 --- a/libraries/mysql_charsets.lib.php +++ b/libraries/mysql_charsets.lib.php @@ -80,7 +80,7 @@ if (! PMA_Util::cacheExists('mysql_charsets', true)) { } sort($mysql_collations_flat, SORT_STRING); - foreach ($mysql_collations AS $key => $value) { + foreach ($mysql_collations as $key => $value) { sort($mysql_collations[$key], SORT_STRING); reset($mysql_collations[$key]); } diff --git a/libraries/operations.lib.php b/libraries/operations.lib.php index 5c45607488..7a15495402 100644 --- a/libraries/operations.lib.php +++ b/libraries/operations.lib.php @@ -1361,11 +1361,11 @@ function PMA_getHtmlForReferentialIntegrityCheck($foreign, $url_params) $html_output .= '