diff --git a/db_datadict.php b/db_datadict.php index caf5e1da17..b7a253255f 100644 --- a/db_datadict.php +++ b/db_datadict.php @@ -126,7 +126,8 @@ foreach ($tables as $table) { $show_create_table = PMA_DBI_fetch_value( 'SHOW CREATE TABLE ' . PMA_backquote($db) . '.' . PMA_backquote($table), - 0, 1); + 0, 1 + ); $analyzed_sql = PMA_SQP_analyze(PMA_SQP_parse($show_create_table)); } diff --git a/db_operations.php b/db_operations.php index 145141d37d..a98107dae4 100644 --- a/db_operations.php +++ b/db_operations.php @@ -186,8 +186,9 @@ if (strlen($db) && (! empty($db_rename) || ! empty($db_copy))) { if (! PMA_Table::moveCopy( $db, $each_table, $newname, $each_table, - isset($this_what) ? $this_what : 'data', $move, 'db_copy') - ) { + isset($this_what) ? $this_what : 'data', + $move, 'db_copy' + )) { $_error = true; // $sql_query is filled by PMA_Table::moveCopy() $sql_query = $back . $sql_query; @@ -279,8 +280,10 @@ if (strlen($db) && (! empty($db_rename) || ! empty($db_copy))) { $get_fields = array('user', 'label', 'query'); $where_fields = array('dbase' => $db); $new_fields = array('dbase' => $newname); - PMA_Table::duplicateInfo('bookmarkwork', 'bookmark', $get_fields, - $where_fields, $new_fields); + PMA_Table::duplicateInfo( + 'bookmarkwork', 'bookmark', $get_fields, + $where_fields, $new_fields + ); } if (! $_error && $move) { @@ -565,8 +568,10 @@ echo __('Remove database'); } echo ' ' . "\n" . ' ' . "\n" - . PMA_generateCharsetDropdownBox(PMA_CSDROPDOWN_COLLATION, - 'db_collation', 'select_db_collation', $db_collation, false, 3) + . PMA_generateCharsetDropdownBox( + PMA_CSDROPDOWN_COLLATION, 'db_collation', + 'select_db_collation', $db_collation, false, 3 + ) . '' . '
' . ' ' . "\n" - .'' . "\n" - .'' . "\n"; + . '
' . "\n" - .sprintf(__('Search results for "%s" %s:'), - $searched, $option_str) . "\n" - .'
' . "\n" + . '' . "\n"; $num_search_result_total = 0; $odd_row = true; @@ -224,8 +226,10 @@ if (isset($_REQUEST['submit_search'])) { $sql_query .= $newsearchsqls['select_count']; echo '' - .'\n"; + . '\n"; if ($res_cnt > 0) { $this_url_params['sql_query'] = $newsearchsqls['select_fields']; @@ -238,7 +242,7 @@ if (isset($_REQUEST['submit_search'])) { ?>  ' . "\n" .'' . "\n"; }// end if else @@ -249,8 +253,10 @@ if (isset($_REQUEST['submit_search'])) { echo '
' . "\n" + . sprintf( + __('Search results for "%s" %s:'), + $searched, $option_str + ) . "\n" + . '
' . sprintf(_ngettext('%1$s match inside table %2$s', '%1$s matches inside table %2$s', $res_cnt), $res_cnt, - htmlspecialchars($each_table)) . "' . sprintf( + _ngettext('%1$s match inside table %2$s', '%1$s matches inside table %2$s', $res_cnt), + $res_cnt, htmlspecialchars($each_table) + ) . "  
' . "\n"; if (count($tables_selected) > 1) { - echo '

' . sprintf(_ngettext('Total: %s match', 'Total: %s matches', $num_search_result_total), - $num_search_result_total) . '

' . "\n"; + echo '

' . sprintf( + _ngettext('Total: %s match', 'Total: %s matches', $num_search_result_total), + $num_search_result_total + ) . '

' . "\n"; } } // end 1. diff --git a/import_status.php b/import_status.php index 71dda3e49f..33af5355c1 100644 --- a/import_status.php +++ b/import_status.php @@ -7,7 +7,7 @@ /* PHP 5.4 stores upload progress data only in the default session. * After calling session_name(), we won't find the progress data anymore. - + * The bug should be somewhere in * https://github.com/php/php-src/blob/master/ext/session/session.c#L2342 @@ -21,14 +21,15 @@ */ if (version_compare(PHP_VERSION, '5.4.0', '>=') - && ini_get('session.upload_progress.enabled')) { + && ini_get('session.upload_progress.enabled') +) { if (!isset($_POST['session_upload_progress'])) { $sessionupload = array(); $prefix = ini_get('session.upload_progress.prefix'); session_start(); - foreach($_SESSION as $key => $value) { + foreach ($_SESSION as $key => $value) { // only copy session-prefixed data if (substr($key, 0, strlen($prefix)) == $prefix) { $sessionupload[$key] = $value; @@ -50,8 +51,10 @@ if (version_compare(PHP_VERSION, '5.4.0', '>=') } $ch = curl_init($url); curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); - curl_setopt($ch, CURLOPT_POSTFIELDS, - 'session_upload_progress=' . rawurlencode(serialize($sessionupload))); + curl_setopt( + $ch, CURLOPT_POSTFIELDS, + 'session_upload_progress=' . rawurlencode(serialize($sessionupload)) + ); curl_setopt($ch, CURLOPT_COOKIE, $headers['Cookie']); curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, 3); curl_setopt($ch, CURLOPT_TIMEOUT, 3); @@ -75,7 +78,7 @@ if (isset($_POST['session_upload_progress'])) { // then write sessionupload back into the loaded session $sessionupload = unserialize($_POST['session_upload_progress']); - foreach($sessionupload as $key => $value) { + foreach ($sessionupload as $key => $value) { $_SESSION[$key] = $value; } } diff --git a/js/messages.php b/js/messages.php index a4efcb4661..eab572caa6 100644 --- a/js/messages.php +++ b/js/messages.php @@ -401,7 +401,8 @@ PMA_printJsValue( ); /* l10n: Display text for current month link in calendar */ PMA_printJsValue("$.datepicker.regional['']['currentText']", __('Today')); -PMA_printJsValue("$.datepicker.regional['']['monthNames']", +PMA_printJsValue( + "$.datepicker.regional['']['monthNames']", array( __('January'), __('February'), @@ -414,8 +415,11 @@ PMA_printJsValue("$.datepicker.regional['']['monthNames']", __('September'), __('October'), __('November'), - __('December'))); -PMA_printJsValue("$.datepicker.regional['']['monthNamesShort']", + __('December') + ) +); +PMA_printJsValue( + "$.datepicker.regional['']['monthNamesShort']", array( /* l10n: Short month name */ __('Jan'), @@ -440,8 +444,11 @@ PMA_printJsValue("$.datepicker.regional['']['monthNamesShort']", /* l10n: Short month name */ __('Nov'), /* l10n: Short month name */ - __('Dec'))); -PMA_printJsValue("$.datepicker.regional['']['dayNames']", + __('Dec') + ) +); +PMA_printJsValue( + "$.datepicker.regional['']['dayNames']", array( __('Sunday'), __('Monday'), @@ -449,8 +456,11 @@ PMA_printJsValue("$.datepicker.regional['']['dayNames']", __('Wednesday'), __('Thursday'), __('Friday'), - __('Saturday'))); -PMA_printJsValue("$.datepicker.regional['']['dayNamesShort']", + __('Saturday') + ) +); +PMA_printJsValue( + "$.datepicker.regional['']['dayNamesShort']", array( /* l10n: Short week day name */ __('Sun'), @@ -465,8 +475,11 @@ PMA_printJsValue("$.datepicker.regional['']['dayNamesShort']", /* l10n: Short week day name */ __('Fri'), /* l10n: Short week day name */ - __('Sat'))); -PMA_printJsValue("$.datepicker.regional['']['dayNamesMin']", + __('Sat') + ) +); +PMA_printJsValue( + "$.datepicker.regional['']['dayNamesMin']", array( /* l10n: Minimal week day name */ __('Su'), @@ -481,7 +494,9 @@ PMA_printJsValue("$.datepicker.regional['']['dayNamesMin']", /* l10n: Minimal week day name */ __('Fr'), /* l10n: Minimal week day name */ - __('Sa'))); + __('Sa') + ) +); /* l10n: Column header for week of the year in calendar */ PMA_printJsValue("$.datepicker.regional['']['weekHeader']", __('Wk')); diff --git a/libraries/Config.class.php b/libraries/Config.class.php index 8dd39d188c..dbb1b2fc61 100644 --- a/libraries/Config.class.php +++ b/libraries/Config.class.php @@ -730,10 +730,11 @@ class PMA_Config PMA_fatalError( sprintf( function_exists('__') - ? __('Existing configuration file (%s) is not readable.') - : 'Existing configuration file (%s) is not readable.', - $this->getSource()) - ); + ? __('Existing configuration file (%s) is not readable.') + : 'Existing configuration file (%s) is not readable.', + $this->getSource() + ) + ); return false; } } diff --git a/libraries/Table.class.php b/libraries/Table.class.php index 9a66300815..7774c824f4 100644 --- a/libraries/Table.class.php +++ b/libraries/Table.class.php @@ -194,7 +194,8 @@ class PMA_Table "SELECT TABLE_NAME FROM information_schema.VIEWS WHERE TABLE_SCHEMA = '" . PMA_sqlAddSlashes($db) . "' - AND TABLE_NAME = '" . PMA_sqlAddSlashes($table) . "'"); + AND TABLE_NAME = '" . PMA_sqlAddSlashes($table) . "'" + ); return $result ? true : false; } @@ -368,8 +369,11 @@ class PMA_Table $query = PMA_backquote($name) . ' ' . $type; if ($length != '' - && !preg_match('@^(DATE|DATETIME|TIME|TINYBLOB|TINYTEXT|BLOB|TEXT|' - . 'MEDIUMBLOB|MEDIUMTEXT|LONGBLOB|LONGTEXT|SERIAL|BOOLEAN|UUID)$@i', $type)) { + && ! preg_match( + '@^(DATE|DATETIME|TIME|TINYBLOB|TINYTEXT|BLOB|TEXT|' + . 'MEDIUMBLOB|MEDIUMTEXT|LONGBLOB|LONGTEXT|SERIAL|BOOLEAN|UUID)$@i', $type + ) + ) { $query .= '(' . $length . ')'; } @@ -1534,8 +1538,12 @@ class PMA_Table // there is no $table_create_time, or // supplied $table_create_time is older than current create time, // so don't save - return PMA_Message::error(sprintf( - __('Cannot save UI property "%s". The changes made will not be persistent after you refresh this page. Please check if the table structure has been changed.'), $property)); + return PMA_Message::error( + sprintf( + __('Cannot save UI property "%s". The changes made will not be persistent after you refresh this page. Please check if the table structure has been changed.'), + $property + ) + ); } } // save the value diff --git a/libraries/Theme.class.php b/libraries/Theme.class.php index aefe8e6544..abfb0d8736 100644 --- a/libraries/Theme.class.php +++ b/libraries/Theme.class.php @@ -143,7 +143,8 @@ class PMA_Theme } else { trigger_error( sprintf(__('No valid image path for theme %s found!'), $this->getName()), - E_USER_ERROR); + E_USER_ERROR + ); return false; } } @@ -339,9 +340,9 @@ class PMA_Theme echo '

'; echo ''; + . 'href="index.php'. PMA_generate_common_url( + array('set_theme' => $this->getId()) + ) . '">'; if (@file_exists($this->getPath() . '/screen.png')) { // if screen exists then output diff --git a/libraries/Theme_Manager.class.php b/libraries/Theme_Manager.class.php index 8e7f89dc3c..135994f041 100644 --- a/libraries/Theme_Manager.class.php +++ b/libraries/Theme_Manager.class.php @@ -151,7 +151,8 @@ class PMA_Theme_Manager __('Theme %s not found!'), htmlspecialchars($theme) ), - E_USER_ERROR); + E_USER_ERROR + ); return false; } @@ -197,8 +198,11 @@ class PMA_Theme_Manager */ function setThemeCookie() { - $GLOBALS['PMA_Config']->setCookie($this->getThemeCookieName(), $this->theme->id, - $this->theme_default); + $GLOBALS['PMA_Config']->setCookie( + $this->getThemeCookieName(), + $this->theme->id, + $this->theme_default + ); // force a change of a dummy session variable to avoid problems // with the caching of phpmyadmin.css.php $GLOBALS['PMA_Config']->set('theme-update', $this->theme->id); @@ -214,9 +218,12 @@ class PMA_Theme_Manager { if (! is_dir($folder)) { trigger_error( - sprintf(__('Theme path not found for theme %s!'), - htmlspecialchars($folder)), - E_USER_ERROR); + sprintf( + __('Theme path not found for theme %s!'), + htmlspecialchars($folder) + ), + E_USER_ERROR + ); return false; } @@ -252,7 +259,8 @@ class PMA_Theme_Manager } else { trigger_error( 'phpMyAdmin-ERROR: cannot open themes folder: ' . $this->getThemesPath(), - E_USER_WARNING); + E_USER_WARNING + ); return false; } // end check for themes directory diff --git a/libraries/auth/cookie.auth.lib.php b/libraries/auth/cookie.auth.lib.php index 0b65e26b7d..3e8d407e4f 100644 --- a/libraries/auth/cookie.auth.lib.php +++ b/libraries/auth/cookie.auth.lib.php @@ -526,8 +526,9 @@ function PMA_auth_set_user() // Duration = one month for username $GLOBALS['PMA_Config']->setCookie( 'pmaUser-' . $GLOBALS['server'], - PMA_blowfish_encrypt($cfg['Server']['user'], - PMA_get_blowfish_secret()) + PMA_blowfish_encrypt( + $cfg['Server']['user'], PMA_get_blowfish_secret() + ) ); // Duration = as configured diff --git a/libraries/config/config_functions.lib.php b/libraries/config/config_functions.lib.php index 5ac2176aa6..7f13a5ccac 100644 --- a/libraries/config/config_functions.lib.php +++ b/libraries/config/config_functions.lib.php @@ -43,7 +43,8 @@ function PMA_lang_name($canonical_path, $type = 'name', $default = 'key') $lang_key = str_replace( array('Servers/1/', '/'), array('Servers/', '_'), - $canonical_path) . '_' . $type; + $canonical_path + ) . '_' . $type; return isset($GLOBALS["strConfig$lang_key"]) ? ($type == 'desc' ? PMA_lang($lang_key) : $GLOBALS["strConfig$lang_key"]) : ($default == 'key' ? $lang_key : $default); diff --git a/libraries/config/validate.lib.php b/libraries/config/validate.lib.php index e995c0e50f..4d7f92dca6 100644 --- a/libraries/config/validate.lib.php +++ b/libraries/config/validate.lib.php @@ -300,9 +300,11 @@ function validate_pmadb($path, $values) $error = true; } if (!$error) { - $test = test_db_connection($values['Servers/1/extension'], $values['Servers/1/connect_type'], + $test = test_db_connection( + $values['Servers/1/extension'], $values['Servers/1/connect_type'], $values['Servers/1/host'], $values['Servers/1/port'], $values['Servers/1/socket'], - $values['Servers/1/controluser'], $values['Servers/1/controlpass'], 'Server_pmadb'); + $values['Servers/1/controluser'], $values['Servers/1/controlpass'], 'Server_pmadb' + ); if ($test !== true) { $result = array_merge($result, $test); } diff --git a/libraries/display_export.lib.php b/libraries/display_export.lib.php index fb6eb1841e..f21a71bc9d 100644 --- a/libraries/display_export.lib.php +++ b/libraries/display_export.lib.php @@ -233,8 +233,11 @@ if (isset($_GET['sql_query'])) { } $message = new PMA_Message(__('This value is interpreted using %1$sstrftime%2$s, so you can use time formatting strings. Additionally the following transformations will happen: %3$s. Other text will be kept as is. See the %4$sFAQ%5$s for details.')); - $message->addParam('', false); + $message->addParam( + '', + false + ); $message->addParam('', false); $message->addParam($trans); $message->addParam('', false); @@ -250,17 +253,26 @@ if (isset($_GET['sql_query'])) { echo htmlspecialchars($_GET['filename_template']); } else { if ($export_type == 'database') { - echo htmlspecialchars($GLOBALS['PMA_Config']->getUserValue( - 'pma_db_filename_template', - $GLOBALS['cfg']['Export']['file_template_database'])); + echo htmlspecialchars( + $GLOBALS['PMA_Config']->getUserValue( + 'pma_db_filename_template', + $GLOBALS['cfg']['Export']['file_template_database'] + ) + ); } elseif ($export_type == 'table') { - echo htmlspecialchars($GLOBALS['PMA_Config']->getUserValue( - 'pma_table_filename_template', - $GLOBALS['cfg']['Export']['file_template_table'])); + echo htmlspecialchars( + $GLOBALS['PMA_Config']->getUserValue( + 'pma_table_filename_template', + $GLOBALS['cfg']['Export']['file_template_table'] + ) + ); } else { - echo htmlspecialchars($GLOBALS['PMA_Config']->getUserValue( - 'pma_server_filename_template', - $GLOBALS['cfg']['Export']['file_template_server'])); + echo htmlspecialchars( + $GLOBALS['PMA_Config']->getUserValue( + 'pma_server_filename_template', + $GLOBALS['cfg']['Export']['file_template_server'] + ) + ); } } echo '"'; diff --git a/libraries/engines/innodb.lib.php b/libraries/engines/innodb.lib.php index ece7adbaac..a4f17b94f5 100644 --- a/libraries/engines/innodb.lib.php +++ b/libraries/engines/innodb.lib.php @@ -156,12 +156,13 @@ class PMA_StorageEngine_innodb extends PMA_StorageEngine . ' ' . "\n" . ' ' . "\n" . ' ' . __('Total') . "\n" - . ' : ' . PMA_formatNumber( - $status['Innodb_buffer_pool_pages_total'], 0) + . ' : ' . PMA_formatNumber($status['Innodb_buffer_pool_pages_total'], 0) . ' ' . __('pages') . ' / ' - . join(' ', - PMA_formatByteDown($status['Innodb_buffer_pool_pages_total'] * $status['Innodb_page_size'])) . "\n" + . join( + ' ', + PMA_formatByteDown($status['Innodb_buffer_pool_pages_total'] * $status['Innodb_page_size']) + ) . "\n" . ' ' . "\n" . ' ' . "\n" . ' ' . "\n" @@ -300,12 +301,12 @@ class PMA_StorageEngine_innodb extends PMA_StorageEngine } /** - * - * Gets the InnoDB plugin version number - * http://www.innodb.com/products/innodb_plugin + * + * Gets the InnoDB plugin version number + * http://www.innodb.com/products/innodb_plugin * (do not confuse this with phpMyAdmin's storage engine plugins!) * - * @return string the version number, or empty if not running as a plugin + * @return string the version number, or empty if not running as a plugin */ function getInnodbPluginVersion() { @@ -313,13 +314,13 @@ class PMA_StorageEngine_innodb extends PMA_StorageEngine } /** - * - * Gets the InnoDB file format + * + * Gets the InnoDB file format * (works only for the InnoDB plugin) - * http://www.innodb.com/products/innodb_plugin + * http://www.innodb.com/products/innodb_plugin * (do not confuse this with phpMyAdmin's storage engine plugins!) * - * @return string the InnoDB file format + * @return string the InnoDB file format */ function getInnodbFileFormat() { @@ -327,13 +328,13 @@ class PMA_StorageEngine_innodb extends PMA_StorageEngine } /** - * - * Verifies if this server supports the innodb_file_per_table feature + * + * Verifies if this server supports the innodb_file_per_table feature * (works only for the InnoDB plugin) - * http://www.innodb.com/products/innodb_plugin + * http://www.innodb.com/products/innodb_plugin * (do not confuse this with phpMyAdmin's storage engine plugins!) * - * @return boolean whether this feature is supported or not + * @return boolean whether this feature is supported or not */ function supportsFilePerTable() { diff --git a/libraries/export/codegen.php b/libraries/export/codegen.php index 40111ffef8..2635da3fe0 100644 --- a/libraries/export/codegen.php +++ b/libraries/export/codegen.php @@ -312,17 +312,20 @@ if (isset($plugin_list)) { if ($result) { while ($row = PMA_DBI_fetch_row($result)) { $tablePropertie = new TableProperty($row); - if ($tablePropertie->isPK()) - $lines[] = $tablePropertie->formatXml('' - . ' ' . "\n" + if ($tablePropertie->isPK()) { + $lines[] = $tablePropertie->formatXml( + ' ' . "\n" . ' ' . "\n" . ' ' . "\n" - . ' '); - else - $lines[] = $tablePropertie->formatXml('' - . ' ' . "\n" + . ' ' + ); + } else { + $lines[] = $tablePropertie->formatXml( + ' ' . "\n" . ' ' . "\n" - . ' '); + . ' ' + ); + } } PMA_DBI_free_result($result); } diff --git a/libraries/export/htmlword.php b/libraries/export/htmlword.php index 91c04cfb6b..c93d10b7a5 100644 --- a/libraries/export/htmlword.php +++ b/libraries/export/htmlword.php @@ -56,16 +56,18 @@ if (isset($plugin_list)) { function PMA_exportHeader() { global $charset_of_file; - return PMA_exportOutputHandler(' + return PMA_exportOutputHandler( + ' - - - - - - '); + + + + + + ' + ); } /** diff --git a/libraries/export/xml.php b/libraries/export/xml.php index ac469181c7..bc877d55c7 100644 --- a/libraries/export/xml.php +++ b/libraries/export/xml.php @@ -142,12 +142,13 @@ if (isset($plugin_list)) { if ($export_struct) { if (PMA_DRIZZLE) { - $result = PMA_DBI_fetch_result(" - SELECT + $result = PMA_DBI_fetch_result( + "SELECT 'utf8' AS DEFAULT_CHARACTER_SET_NAME, DEFAULT_COLLATION_NAME FROM data_dictionary.SCHEMAS - WHERE SCHEMA_NAME = '" . PMA_sqlAddSlashes($db) . "'"); + WHERE SCHEMA_NAME = '" . PMA_sqlAddSlashes($db) . "'" + ); } else { $result = PMA_DBI_fetch_result('SELECT `DEFAULT_CHARACTER_SET_NAME`, `DEFAULT_COLLATION_NAME` FROM `information_schema`.`SCHEMATA` WHERE `SCHEMA_NAME` = \''.PMA_sqlAddSlashes($db).'\' LIMIT 1'); } diff --git a/libraries/footer.inc.php b/libraries/footer.inc.php index 4a4a4b233c..cae572b247 100644 --- a/libraries/footer.inc.php +++ b/libraries/footer.inc.php @@ -23,11 +23,14 @@ if (! defined('PHPMYADMIN')) { * for PMA_setHistory() */ if (! PMA_isValid($_REQUEST['no_history']) && empty($GLOBALS['error_message']) - && ! empty($GLOBALS['sql_query'])) { - PMA_setHistory(PMA_ifSetOr($GLOBALS['db'], ''), + && ! empty($GLOBALS['sql_query']) +) { + PMA_setHistory( + PMA_ifSetOr($GLOBALS['db'], ''), PMA_ifSetOr($GLOBALS['table'], ''), $GLOBALS['cfg']['Server']['user'], - $GLOBALS['sql_query']); + $GLOBALS['sql_query'] + ); } if ($GLOBALS['error_handler']->hasDisplayErrors()) { diff --git a/libraries/rte/rte_export.lib.php b/libraries/rte/rte_export.lib.php index 53944c6a45..4d31822bfe 100644 --- a/libraries/rte/rte_export.lib.php +++ b/libraries/rte/rte_export.lib.php @@ -78,7 +78,8 @@ function PMA_RTN_handleExport() $export_data = PMA_DBI_get_definition( $db, $_GET['item_type'], - $_GET['item_name']); + $_GET['item_name'] + ); PMA_RTE_handleExport($_GET['item_name'], $export_data); } } diff --git a/libraries/rte/rte_list.lib.php b/libraries/rte/rte_list.lib.php index 22a396f625..f277bdd991 100644 --- a/libraries/rte/rte_list.lib.php +++ b/libraries/rte/rte_list.lib.php @@ -130,9 +130,11 @@ function PMA_RTN_getRowForList($routine, $rowclass = '') { global $ajax_class, $url_query, $db, $titles; - $sql_drop = sprintf('DROP %s IF EXISTS %s', - $routine['ROUTINE_TYPE'], - PMA_backquote($routine['SPECIFIC_NAME'])); + $sql_drop = sprintf( + 'DROP %s IF EXISTS %s', + $routine['ROUTINE_TYPE'], + PMA_backquote($routine['SPECIFIC_NAME']) + ); $type_link = "item_type={$routine['ROUTINE_TYPE']}"; $retval = " \n"; diff --git a/libraries/schema/Dia_Relation_Schema.class.php b/libraries/schema/Dia_Relation_Schema.class.php index 89a54f9d70..882cb06d0e 100644 --- a/libraries/schema/Dia_Relation_Schema.class.php +++ b/libraries/schema/Dia_Relation_Schema.class.php @@ -136,13 +136,13 @@ class PMA_DIA extends XMLWriter - '); - $this->endElement(); - $this->startElement('dia:layer'); - $this->writeAttribute('name', 'Background'); - $this->writeAttribute('visible', 'true'); - $this->writeAttribute('active', 'true'); - + ' + ); + $this->endElement(); + $this->startElement('dia:layer'); + $this->writeAttribute('name', 'Background'); + $this->writeAttribute('visible', 'true'); + $this->writeAttribute('active', 'true'); } /** diff --git a/libraries/tbl_info.inc.php b/libraries/tbl_info.inc.php index 6d520bd553..00f807ec5e 100644 --- a/libraries/tbl_info.inc.php +++ b/libraries/tbl_info.inc.php @@ -79,8 +79,9 @@ if ($showtable) { : $showtable['Collation']; if (null === $showtable['Rows']) { - $showtable['Rows'] = PMA_Table::countRecords($GLOBALS['db'], - $showtable['Name'], true); + $showtable['Rows'] = PMA_Table::countRecords( + $GLOBALS['db'], $showtable['Name'], true + ); } $table_info_num_rows = isset($showtable['Rows']) ? $showtable['Rows'] : 0; $row_format = isset($showtable['Row_format']) ? $showtable['Row_format'] : ''; diff --git a/libraries/tbl_properties.inc.php b/libraries/tbl_properties.inc.php index 284b190f8b..90aa6bfca4 100644 --- a/libraries/tbl_properties.inc.php +++ b/libraries/tbl_properties.inc.php @@ -126,10 +126,12 @@ if ($cfgRelation['mimework'] && $cfg['BrowseMIME']) { $available_mime = PMA_getAvailableMIMEtypes(); $hint = '
' . - sprintf(__('For a list of available transformation options and their MIME type transformations, click on %stransformation descriptions%s'), + sprintf( + __('For a list of available transformation options and their MIME type transformations, click on %stransformation descriptions%s'), '
', - ''); + '' + ); $header_cells[] = __('MIME type'); @@ -382,7 +384,8 @@ for ($i = 0; $i < $num_fields; $i++) { $tmp_collation = empty($row['Collation']) ? null : $row['Collation']; $content_cells[$i][$ci] = PMA_generateCharsetDropdownBox( PMA_CSDROPDOWN_COLLATION, 'field_collation[' . $i . ']', - 'field_' . $i . '_' . ($ci - $ci_offset), $tmp_collation, false); + 'field_' . $i . '_' . ($ci - $ci_offset), $tmp_collation, false + ); unset($tmp_collation); $ci++; @@ -670,15 +673,20 @@ if ($action == 'tbl_create.php') {     diff --git a/navigation.php b/navigation.php index 0c1a135eb7..60abf80870 100644 --- a/navigation.php +++ b/navigation.php @@ -381,8 +381,10 @@ function PMA_displayDbList($ext_dblist, $offset, $count) printf($href_left, $element_counter, $common_url_query); printf($img_plus, $element_counter); } else { - printf($href_left, $element_counter, - PMA_generate_common_url() . $url_dbgroup); + printf( + $href_left, $element_counter, + PMA_generate_common_url() . $url_dbgroup + ); printf($img_minus, $element_counter); } echo ''; @@ -514,12 +516,15 @@ function PMA_displayTableList($tables, $visible = false, $element_counter++; echo '

  • ' . "\n"; if ($visible - && ((isset($_REQUEST['tbl_group']) - && (strpos($_REQUEST['tbl_group'], $group) === 0 + && ((isset($_REQUEST['tbl_group']) + && (strpos($_REQUEST['tbl_group'], $group) === 0 || strpos($_REQUEST['tbl_group'], $sep . $group) !== false)) - || strpos($GLOBALS['table'], $group) === 0)) { - printf($href_left, $element_counter, - $GLOBALS['common_url_query'] . '&tbl_group=' . $tab_group_full); + || strpos($GLOBALS['table'], $group) === 0) + ) { + printf( + $href_left, $element_counter, + $GLOBALS['common_url_query'] . '&tbl_group=' . $tab_group_full + ); printf($img_minus, $element_counter); } else { printf($href_left, $element_counter, $common_url_query); @@ -551,13 +556,15 @@ function PMA_displayTableList($tables, $visible = false, unset($table['tab' . $sep . 'group']); unset($table['tab' . $sep . 'count']); - if ($visible && - ((isset($_REQUEST['tbl_group']) + if ($visible + && ((isset($_REQUEST['tbl_group']) && (strpos($_REQUEST['tbl_group'], $group) === 0 || strpos($_REQUEST['tbl_group'], $sep . $group) !== false)) - || strpos($GLOBALS['table'], $group) === 0)) { - PMA_displayTableList($table, true, - $tab_group_full . $group, $table_db); + || strpos($GLOBALS['table'], $group) === 0) + ) { + PMA_displayTableList( + $table, true, $tab_group_full . $group, $table_db + ); } else { PMA_displayTableList($table, false, '', $table_db); } diff --git a/pmd_general.php b/pmd_general.php index a142b762e3..3887df3fdf 100644 --- a/pmd_general.php +++ b/pmd_general.php @@ -317,8 +317,10 @@ for ($i = 0; $i < count($GLOBALS['PMD']["TABLE_NAME"]); $i++) { ?>.png" alt="*" /> diff --git a/pmd_pdf.php b/pmd_pdf.php index e1794f8c54..d2e318cb85 100644 --- a/pmd_pdf.php +++ b/pmd_pdf.php @@ -44,16 +44,18 @@ if (isset($mode)) { if ('import' == $mode) { PMA_query_as_controluser( - 'UPDATE ' . $pma_table . ',' . $pmd_table . - ' SET ' . $pmd_table . '.`x`= ' . $pma_table . '.`x` * '. $scale_q . ', - ' . $pmd_table . '.`y`= ' . $pma_table . '.`y` * '. $scale_q .' - WHERE - ' . $pmd_table . '.`db_name`=' . $pma_table . '.`db_name` - AND - ' . $pmd_table . '.`table_name` = ' . $pma_table . '.`table_name` - AND - ' . $pmd_table . '.`db_name`=\''. PMA_sqlAddSlashes($db) .'\' - AND pdf_page_number = ' . $pdf_page_number_q . ';', true, PMA_DBI_QUERY_STORE); + 'UPDATE ' . $pma_table . ',' . $pmd_table . + ' SET ' . $pmd_table . '.`x`= ' . $pma_table . '.`x` * '. $scale_q . ', + ' . $pmd_table . '.`y`= ' . $pma_table . '.`y` * '. $scale_q .' + WHERE + ' . $pmd_table . '.`db_name`=' . $pma_table . '.`db_name` + AND + ' . $pmd_table . '.`table_name` = ' . $pma_table . '.`table_name` + AND + ' . $pmd_table . '.`db_name`=\''. PMA_sqlAddSlashes($db) .'\' + AND pdf_page_number = ' . $pdf_page_number_q . ';', + true, PMA_DBI_QUERY_STORE + ); } } @@ -77,9 +79,11 @@ echo '
    ' . __('Import/Export coordinates for PDF schema') . ' 0) { echo '

    ' . __('Page') . ':'; diff --git a/pmd_save_pos.php b/pmd_save_pos.php index 1e81a55297..c7d682f574 100644 --- a/pmd_save_pos.php +++ b/pmd_save_pos.php @@ -19,20 +19,25 @@ if (! $cfgRelation['designerwork']) { foreach ($t_x as $key => $value) { $KEY = empty($IS_AJAX) ? urldecode($key) : $key; // table name decode (post PDF exp/imp) list($DB,$TAB) = explode(".", $KEY); - PMA_query_as_controluser('DELETE FROM ' . PMA_backquote($GLOBALS['cfgRelation']['db']) . '.' . PMA_backquote($GLOBALS['cfgRelation']['designer_coords']) . ' - WHERE `db_name` = \'' . PMA_sqlAddSlashes($DB) . '\' - AND `table_name` = \'' . PMA_sqlAddSlashes($TAB) . '\'', true, PMA_DBI_QUERY_STORE); + PMA_query_as_controluser( + 'DELETE FROM ' . PMA_backquote($GLOBALS['cfgRelation']['db']) . '.' . PMA_backquote($GLOBALS['cfgRelation']['designer_coords']) + . ' WHERE `db_name` = \'' . PMA_sqlAddSlashes($DB) . '\'' + . ' AND `table_name` = \'' . PMA_sqlAddSlashes($TAB) . '\'', + true, PMA_DBI_QUERY_STORE + ); - PMA_query_as_controluser('INSERT INTO ' . PMA_backquote($GLOBALS['cfgRelation']['db']) . '.' . PMA_backquote($GLOBALS['cfgRelation']['designer_coords']) . ' - (db_name, table_name, x, y, v, h) - VALUES (' - . '\'' . PMA_sqlAddSlashes($DB) . '\', ' - . '\'' . PMA_sqlAddSlashes($TAB) . '\', ' - . '\'' . PMA_sqlAddSlashes($t_x[$key]) . '\', ' - . '\'' . PMA_sqlAddSlashes($t_y[$key]) . '\', ' - . '\'' . PMA_sqlAddSlashes($t_v[$key]) . '\', ' - . '\'' . PMA_sqlAddSlashes($t_h[$key]) . '\'' - . ')', true, PMA_DBI_QUERY_STORE); + PMA_query_as_controluser( + 'INSERT INTO ' . PMA_backquote($GLOBALS['cfgRelation']['db']) . '.' . PMA_backquote($GLOBALS['cfgRelation']['designer_coords']) + . ' (db_name, table_name, x, y, v, h)' + . ' VALUES (' + . '\'' . PMA_sqlAddSlashes($DB) . '\', ' + . '\'' . PMA_sqlAddSlashes($TAB) . '\', ' + . '\'' . PMA_sqlAddSlashes($t_x[$key]) . '\', ' + . '\'' . PMA_sqlAddSlashes($t_y[$key]) . '\', ' + . '\'' . PMA_sqlAddSlashes($t_v[$key]) . '\', ' + . '\'' . PMA_sqlAddSlashes($t_h[$key]) . '\')', + true, PMA_DBI_QUERY_STORE + ); } //---------------------------------------------------------------------------- diff --git a/prefs_forms.php b/prefs_forms.php index 08f2ec6e79..6ae7adf6d8 100644 --- a/prefs_forms.php +++ b/prefs_forms.php @@ -42,8 +42,10 @@ if (isset($_POST['revert'])) { $form_display->fixErrors(); // redirect $url_params = array('form' => $form_param); - PMA_sendHeaderLocation($cfg['PmaAbsoluteUri'] . 'prefs_forms.php' - . PMA_generate_common_url($url_params, '&')); + PMA_sendHeaderLocation( + $cfg['PmaAbsoluteUri'] . 'prefs_forms.php' + . PMA_generate_common_url($url_params, '&') + ); exit; } @@ -56,8 +58,10 @@ if ($form_display->process(false) && !$form_display->hasErrors()) { // reload config $GLOBALS['PMA_Config']->loadUserPreferences(); $hash = ltrim(filter_input(INPUT_POST, 'tab_hash'), '#'); - PMA_userprefs_redirect($forms, $old_settings, 'prefs_forms.php', array( - 'form' => $form_param), $hash); + PMA_userprefs_redirect( + $forms, $old_settings, 'prefs_forms.php', + array('form' => $form_param), $hash + ); exit; } else { $error = $result; diff --git a/prefs_manage.php b/prefs_manage.php index e765955af6..89e468507f 100644 --- a/prefs_manage.php +++ b/prefs_manage.php @@ -31,17 +31,21 @@ if (isset($_POST['submit_export']) && filter_input(INPUT_POST, 'export_type') == } else if (isset($_POST['submit_get_json'])) { $settings = PMA_load_userprefs(); header('Content-Type: application/json'); - echo json_encode(array( - 'prefs' => json_encode($settings['config_data']), - 'mtime' => $settings['mtime'])); + echo json_encode( + array( + 'prefs' => json_encode($settings['config_data']), + 'mtime' => $settings['mtime'] + ) + ); return; } else if (isset($_POST['submit_import'])) { // load from JSON file $json = ''; if (filter_input(INPUT_POST, 'import_type') == 'text_file' - && isset($_FILES['import_file']) - && $_FILES['import_file']['error'] == UPLOAD_ERR_OK - && is_uploaded_file($_FILES['import_file']['tmp_name'])) { + && isset($_FILES['import_file']) + && $_FILES['import_file']['error'] == UPLOAD_ERR_OK + && is_uploaded_file($_FILES['import_file']['tmp_name']) + ) { // read JSON from uploaded file $open_basedir = @ini_get('open_basedir'); $file_to_unlink = ''; diff --git a/setup/frames/index.inc.php b/setup/frames/index.inc.php index cf762a1ec3..c5d4f8359c 100644 --- a/setup/frames/index.inc.php +++ b/setup/frames/index.inc.php @@ -47,8 +47,10 @@ $config_writable = false; $config_exists = false; check_config_rw($config_readable, $config_writable, $config_exists); if (!$config_writable || !$config_readable) { - messages_set('error', 'config_rw', __('Cannot load or save configuration'), - PMA_lang(__('Please create web server writable folder [em]config[/em] in phpMyAdmin top level directory as described in [a@Documentation.html#setup_script]documentation[/a]. Otherwise you will be only able to download or display it.'))); + messages_set( + 'error', 'config_rw', __('Cannot load or save configuration'), + PMA_lang(__('Please create web server writable folder [em]config[/em] in phpMyAdmin top level directory as described in [a@Documentation.html#setup_script]documentation[/a]. Otherwise you will be only able to download or display it.')) + ); } // // Check https connection @@ -90,13 +92,15 @@ if (!$is_https) { @@ -115,10 +119,13 @@ messages_show_html(); // // Display server list // -display_form_top('index.php', 'get', array( - 'page' => 'servers', - 'mode' => 'add' -)); +display_form_top( + 'index.php', 'get', + array( + 'page' => 'servers', + 'mode' => 'add' + ) +); ?>

    getServerCount() > 0): ?> @@ -185,8 +192,10 @@ foreach ($all_languages as $each_lang_key => $each_lang) { $lang_name = PMA_langName($each_lang); $opts['values'][$each_lang_key] = $lang_name; } -display_input('DefaultLang', __('Default language'), '', 'select', - $cf->getValue('DefaultLang'), true, $opts); +display_input( + 'DefaultLang', __('Default language'), '', 'select', + $cf->getValue('DefaultLang'), true, $opts +); // Display server list $opts = array( @@ -209,8 +218,10 @@ if ($cf->getServerCount() > 0) { $opts['values']['1'] = __('- none -'); $opts['values_escaped'] = true; } -display_input('ServerDefault', __('Default server'), '', 'select', - $cf->getValue('ServerDefault'), true, $opts); +display_input( + 'ServerDefault', __('Default server'), '', 'select', + $cf->getValue('ServerDefault'), true, $opts +); // Display EOL list $opts = array( @@ -219,8 +230,10 @@ $opts = array( 'win' => 'Windows (\r\n)'), 'values_escaped' => true); $eol = PMA_ifSetOr($_SESSION['eol'], (PMA_IS_WINDOWS ? 'win' : 'unix')); -display_input('eol', __('End of line'), '', 'select', - $eol, true, $opts); +display_input( + 'eol', __('End of line'), '', 'select', + $eol, true, $opts +); ?> diff --git a/setup/lib/common.inc.php b/setup/lib/common.inc.php index 69cfea4205..c547521ac6 100644 --- a/setup/lib/common.inc.php +++ b/setup/lib/common.inc.php @@ -31,20 +31,23 @@ restore_error_handler(); // Save current language in a cookie, required since we use PMA_MINIMUM_COMMON $GLOBALS['PMA_Config']->setCookie('pma_lang', $GLOBALS['lang']); -ConfigFile::getInstance()->setPersistKeys(array( - 'DefaultLang', - 'ServerDefault', - 'UploadDir', - 'SaveDir', - 'Servers/1/verbose', - 'Servers/1/host', - 'Servers/1/port', - 'Servers/1/socket', - 'Servers/1/extension', - 'Servers/1/connect_type', - 'Servers/1/auth_type', - 'Servers/1/user', - 'Servers/1/password')); +ConfigFile::getInstance()->setPersistKeys( + array( + 'DefaultLang', + 'ServerDefault', + 'UploadDir', + 'SaveDir', + 'Servers/1/verbose', + 'Servers/1/host', + 'Servers/1/port', + 'Servers/1/socket', + 'Servers/1/extension', + 'Servers/1/connect_type', + 'Servers/1/auth_type', + 'Servers/1/user', + 'Servers/1/password' + ) +); // allows for redirection even after sending some data ob_start(); diff --git a/setup/lib/index.lib.php b/setup/lib/index.lib.php index 47edc59eb7..ebda5fb59e 100644 --- a/setup/lib/index.lib.php +++ b/setup/lib/index.lib.php @@ -99,9 +99,11 @@ function PMA_version_check() $connection_timeout = 3; $url = 'http://phpmyadmin.net/home_page/version.php'; - $context = stream_context_create(array( - 'http' => array( - 'timeout' => $connection_timeout))); + $context = stream_context_create( + array( + 'http' => array('timeout' => $connection_timeout) + ) + ); $data = @file_get_contents($url, null, $context); if ($data === false) { if (function_exists('curl_init')) { @@ -116,7 +118,8 @@ function PMA_version_check() 'error', $message_id, __('Version check'), - __('Neither URL wrapper nor CURL is available. Version check is not possible.')); + __('Neither URL wrapper nor CURL is available. Version check is not possible.') + ); return; } } @@ -126,7 +129,8 @@ function PMA_version_check() 'error', $message_id, __('Version check'), - __('Reading of version failed. Maybe you\'re offline or the upgrade server does not respond.')); + __('Reading of version failed. Maybe you\'re offline or the upgrade server does not respond.') + ); return; } @@ -146,7 +150,8 @@ function PMA_version_check() 'error', $message_id, __('Version check'), - __('Got invalid version string from server')); + __('Got invalid version string from server') + ); return; } @@ -156,7 +161,8 @@ function PMA_version_check() 'error', $message_id, __('Version check'), - __('Unparsable version string')); + __('Unparsable version string') + ); return; } @@ -167,20 +173,23 @@ function PMA_version_check() 'notice', $message_id, __('Version check'), - sprintf(__('A newer version of phpMyAdmin is available and you should consider upgrading. The newest version is %s, released on %s.'), $version, $date)); + sprintf(__('A newer version of phpMyAdmin is available and you should consider upgrading. The newest version is %s, released on %s.'), $version, $date) + ); } else { if ($version_local % 100 == 0) { messages_set( 'notice', $message_id, __('Version check'), - PMA_sanitize(sprintf(__('You are using Git version, run [kbd]git pull[/kbd] :-)[br]The latest stable version is %s, released on %s.'), $version, $date))); + PMA_sanitize(sprintf(__('You are using Git version, run [kbd]git pull[/kbd] :-)[br]The latest stable version is %s, released on %s.'), $version, $date)) + ); } else { messages_set( 'notice', $message_id, __('Version check'), - __('No newer stable version is available')); + __('No newer stable version is available') + ); } } } @@ -219,7 +228,8 @@ function version_to_int($version) 'notice', 'version_match', __('Version check'), - 'Unknown version part: ' . htmlspecialchars($matches[6])); + 'Unknown version part: ' . htmlspecialchars($matches[6]) + ); $added = 0; break; } @@ -318,7 +328,8 @@ function perform_config_checks() 'notice', "Servers/$i/ssl", $title, - __('You should use SSL connections if your database server supports it.')); + __('You should use SSL connections if your database server supports it.') + ); } // @@ -331,7 +342,8 @@ function perform_config_checks() 'notice', "Servers/$i/extension", $title, - __('You should use mysqli for performance reasons.')); + __('You should use mysqli for performance reasons.') + ); } // @@ -339,15 +351,17 @@ function perform_config_checks() // warn about full user credentials if 'auth_type' is 'config' // if ($cf->getValue("Servers/$i/auth_type") == 'config' - && $cf->getValue("Servers/$i/user") != '' - && $cf->getValue("Servers/$i/password") != '') { + && $cf->getValue("Servers/$i/user") != '' + && $cf->getValue("Servers/$i/password") != '' + ) { $title = PMA_lang(PMA_lang_name('Servers/1/auth_type')) . " ($server_name)"; messages_set( 'notice', "Servers/$i/auth_type", $title, - PMA_lang($strServerAuthConfigMsg, $i) . ' ' . - PMA_lang($strSecurityInfoMsg, $i)); + PMA_lang($strServerAuthConfigMsg, $i) . ' ' + . PMA_lang($strSecurityInfoMsg, $i) + ); } // @@ -356,14 +370,16 @@ function perform_config_checks() // serious security flaw // if ($cf->getValue("Servers/$i/AllowRoot") - && $cf->getValue("Servers/$i/AllowNoPassword")) { + && $cf->getValue("Servers/$i/AllowNoPassword") + ) { $title = PMA_lang(PMA_lang_name('Servers/1/AllowNoPassword')) . " ($server_name)"; messages_set( 'notice', "Servers/$i/AllowNoPassword", $title, - __('You allow for connecting to the server without a password.') . ' ' . - PMA_lang($strSecurityInfoMsg, $i)); + __('You allow for connecting to the server without a password.') . ' ' + . PMA_lang($strSecurityInfoMsg, $i) + ); } } @@ -378,7 +394,8 @@ function perform_config_checks() 'notice', 'blowfish_secret_created', PMA_lang(PMA_lang_name('blowfish_secret')), - $strBlowfishSecretMsg); + $strBlowfishSecretMsg + ); } else { $blowfish_warnings = array(); // check length @@ -398,7 +415,8 @@ function perform_config_checks() 'error', 'blowfish_warnings' . count($blowfish_warnings), PMA_lang(PMA_lang_name('blowfish_secret')), - implode('
    ', $blowfish_warnings)); + implode('
    ', $blowfish_warnings) + ); } } } @@ -412,7 +430,8 @@ function perform_config_checks() 'notice', 'ForceSSL', PMA_lang(PMA_lang_name('ForceSSL')), - PMA_lang($strForceSSLNotice)); + PMA_lang($strForceSSLNotice) + ); } // @@ -424,7 +443,8 @@ function perform_config_checks() 'notice', 'AllowArbitraryServer', PMA_lang(PMA_lang_name('AllowArbitraryServer')), - PMA_lang($strAllowArbitraryServerWarning)); + PMA_lang($strAllowArbitraryServerWarning) + ); } // @@ -432,7 +452,8 @@ function perform_config_checks() // value greater than session.gc_maxlifetime will cause random session invalidation after that time // if ($cf->getValue('LoginCookieValidity') > 1440 - || $cf->getValue('LoginCookieValidity') > ini_get('session.gc_maxlifetime')) { + || $cf->getValue('LoginCookieValidity') > ini_get('session.gc_maxlifetime') + ) { $message_type = $cf->getValue('LoginCookieValidity') > ini_get('session.gc_maxlifetime') ? 'error' : 'notice'; @@ -440,7 +461,8 @@ function perform_config_checks() $message_type, 'LoginCookieValidity', PMA_lang(PMA_lang_name('LoginCookieValidity')), - PMA_lang($strLoginCookieValidityWarning)); + PMA_lang($strLoginCookieValidityWarning) + ); } // @@ -452,7 +474,8 @@ function perform_config_checks() 'notice', 'LoginCookieValidity', PMA_lang(PMA_lang_name('LoginCookieValidity')), - PMA_lang($strLoginCookieValidityWarning2)); + PMA_lang($strLoginCookieValidityWarning2) + ); } // @@ -465,7 +488,8 @@ function perform_config_checks() 'error', 'LoginCookieValidity', PMA_lang(PMA_lang_name('LoginCookieValidity')), - PMA_lang($strLoginCookieValidityWarning3)); + PMA_lang($strLoginCookieValidityWarning3) + ); } // @@ -477,7 +501,8 @@ function perform_config_checks() 'notice', 'SaveDir', PMA_lang(PMA_lang_name('SaveDir')), - PMA_lang($strDirectoryNotice)); + PMA_lang($strDirectoryNotice) + ); } // @@ -489,7 +514,8 @@ function perform_config_checks() 'notice', 'TempDir', PMA_lang(PMA_lang_name('TempDir')), - PMA_lang($strDirectoryNotice)); + PMA_lang($strDirectoryNotice) + ); } // @@ -497,12 +523,14 @@ function perform_config_checks() // requires zlib functions // if ($cf->getValue('GZipDump') - && (@!function_exists('gzopen') || @!function_exists('gzencode'))) { + && (@!function_exists('gzopen') || @!function_exists('gzencode')) + ) { messages_set( 'error', 'GZipDump', PMA_lang(PMA_lang_name('GZipDump')), - PMA_lang($strGZipDumpWarning, 'gzencode')); + PMA_lang($strGZipDumpWarning, 'gzencode') + ); } // @@ -510,7 +538,8 @@ function perform_config_checks() // requires bzip2 functions // if ($cf->getValue('BZipDump') - && (!@function_exists('bzopen') || !@function_exists('bzcompress'))) { + && (!@function_exists('bzopen') || !@function_exists('bzcompress')) + ) { $functions = @function_exists('bzopen') ? '' : 'bzopen'; @@ -521,7 +550,8 @@ function perform_config_checks() 'error', 'BZipDump', PMA_lang(PMA_lang_name('BZipDump')), - PMA_lang($strBZipDumpWarning, $functions)); + PMA_lang($strBZipDumpWarning, $functions) + ); } // @@ -533,7 +563,8 @@ function perform_config_checks() 'error', 'ZipDump_import', PMA_lang(PMA_lang_name('ZipDump')), - PMA_lang($strZipDumpImportWarning, 'zip_open')); + PMA_lang($strZipDumpImportWarning, 'zip_open') + ); } // @@ -545,7 +576,8 @@ function perform_config_checks() 'error', 'ZipDump_export', PMA_lang(PMA_lang_name('ZipDump')), - PMA_lang($strZipDumpExportWarning, 'gzcompress')); + PMA_lang($strZipDumpExportWarning, 'gzcompress') + ); } } ?> diff --git a/tbl_addfield.php b/tbl_addfield.php index e706f789a4..a80c37942f 100644 --- a/tbl_addfield.php +++ b/tbl_addfield.php @@ -167,16 +167,20 @@ if (isset($_REQUEST['do_save_data'])) { // Update comment table for mime types [MIME] if (isset($_REQUEST['field_mimetype']) - && is_array($_REQUEST['field_mimetype']) - && $cfg['BrowseMIME']) { + && is_array($_REQUEST['field_mimetype']) + && $cfg['BrowseMIME'] + ) { foreach ($_REQUEST['field_mimetype'] as $fieldindex => $mimetype) { if (isset($_REQUEST['field_name'][$fieldindex]) - && strlen($_REQUEST['field_name'][$fieldindex])) { - PMA_setMIME($db, $table, + && strlen($_REQUEST['field_name'][$fieldindex]) + ) { + PMA_setMIME( + $db, $table, $_REQUEST['field_name'][$fieldindex], $mimetype, $_REQUEST['field_transformation'][$fieldindex], - $_REQUEST['field_transformation_options'][$fieldindex]); + $_REQUEST['field_transformation_options'][$fieldindex] + ); } } } diff --git a/tbl_create.php b/tbl_create.php index ca4b41182b..918e11d714 100644 --- a/tbl_create.php +++ b/tbl_create.php @@ -241,8 +241,10 @@ if (isset($_REQUEST['do_save_data'])) { $tbl_url_params['table'] = $table; $is_show_stats = $cfg['ShowStats']; - $tbl_stats_result = PMA_DBI_query('SHOW TABLE STATUS FROM ' - . PMA_backquote($db) . ' LIKE \'' . PMA_sqlAddSlashes($table, true) . '\';'); + $tbl_stats_result = PMA_DBI_query( + 'SHOW TABLE STATUS FROM ' . PMA_backquote($db) + . ' LIKE \'' . PMA_sqlAddSlashes($table, true) . '\';' + ); $tbl_stats = PMA_DBI_fetch_assoc($tbl_stats_result); PMA_DBI_free_result($tbl_stats_result); unset($tbl_stats_result); diff --git a/tbl_get_field.php b/tbl_get_field.php index 962738cc38..ab802d7e22 100644 --- a/tbl_get_field.php +++ b/tbl_get_field.php @@ -16,8 +16,10 @@ PMA_checkParameters(array('db', 'table', 'where_clause', 'transform_key')); /* Select database */ if (!PMA_DBI_select_db($db)) { - PMA_mysqlDie(sprintf(__('\'%s\' database does not exist.'), htmlspecialchars($db)), - '', ''); + PMA_mysqlDie( + sprintf(__('\'%s\' database does not exist.'), htmlspecialchars($db)), + '', '' + ); } /* Check if table exists */ diff --git a/tbl_indexes.php b/tbl_indexes.php index 1bdfde81c8..c127652b28 100644 --- a/tbl_indexes.php +++ b/tbl_indexes.php @@ -17,8 +17,9 @@ require_once 'libraries/tbl_common.php'; $fields = array(); foreach (PMA_DBI_get_columns_full($db, $table) as $row) { if (preg_match('@^(set|enum)\((.+)\)$@i', $row['Type'], $tmp)) { - $tmp[2] = substr(preg_replace('@([^,])\'\'@', '\\1\\\'', - ',' . $tmp[2]), 1); + $tmp[2] = substr( + preg_replace('@([^,])\'\'@', '\\1\\\'', ',' . $tmp[2]), 1 + ); $fields[$row['Field']] = $tmp[1] . '(' . str_replace(',', ', ', $tmp[2]) . ')'; } else { $fields[$row['Field']] = $row['Type']; diff --git a/tbl_move_copy.php b/tbl_move_copy.php index 687294f289..1d966daca9 100644 --- a/tbl_move_copy.php +++ b/tbl_move_copy.php @@ -47,8 +47,10 @@ if (PMA_isValid($_REQUEST['new_name'])) { } $result = false; } else { - $result = PMA_Table::moveCopy($db, $table, $_REQUEST['target_db'], $_REQUEST['new_name'], - $_REQUEST['what'], isset($_REQUEST['submit_move']), 'one_table'); + $result = PMA_Table::moveCopy( + $db, $table, $_REQUEST['target_db'], $_REQUEST['new_name'], + $_REQUEST['what'], isset($_REQUEST['submit_move']), 'one_table' + ); if (isset($_REQUEST['submit_move'])) { $message = PMA_Message::success(__('Table %s has been moved to %s.')); diff --git a/tbl_printview.php b/tbl_printview.php index bfbaa6ca23..6d7b62cdc9 100644 --- a/tbl_printview.php +++ b/tbl_printview.php @@ -108,7 +108,8 @@ foreach ($the_tables as $key => $table) { $show_create_table = PMA_DBI_fetch_value( 'SHOW CREATE TABLE ' . PMA_backquote($db) . '.' . PMA_backquote($table), - 0, 1); + 0, 1 + ); $analyzed_sql = PMA_SQP_analyze(PMA_SQP_parse($show_create_table)); // Check if we can use Relations diff --git a/tbl_relation.php b/tbl_relation.php index 80f7e17004..d58a7b2001 100644 --- a/tbl_relation.php +++ b/tbl_relation.php @@ -521,18 +521,22 @@ if (count($columns) > 0) { // For ON DELETE and ON UPDATE, the default action // is RESTRICT as per MySQL doc; however, a SHOW CREATE TABLE // won't display the clause if it's set as RESTRICT. - PMA_generate_dropdown('ON DELETE', + PMA_generate_dropdown( + 'ON DELETE', 'on_delete[' . $myfield_md5 . ']', $options_array, - isset($existrel_foreign[$myfield]['on_delete']) ? $existrel_foreign[$myfield]['on_delete']: 'RESTRICT'); + isset($existrel_foreign[$myfield]['on_delete']) ? $existrel_foreign[$myfield]['on_delete']: 'RESTRICT' + ); echo '' . "\n" .'' . "\n"; - PMA_generate_dropdown('ON UPDATE', + PMA_generate_dropdown( + 'ON UPDATE', 'on_update[' . $myfield_md5 . ']', $options_array, - isset($existrel_foreign[$myfield]['on_update']) ? $existrel_foreign[$myfield]['on_update']: 'RESTRICT'); + isset($existrel_foreign[$myfield]['on_update']) ? $existrel_foreign[$myfield]['on_update']: 'RESTRICT' + ); echo '' . "\n"; } else { echo __('No index defined!'); diff --git a/tbl_structure.php b/tbl_structure.php index a7af132ad9..fc193e74e4 100644 --- a/tbl_structure.php +++ b/tbl_structure.php @@ -137,8 +137,9 @@ $fields = (array) PMA_DBI_get_columns($db, $table, null, true); // in MySQL 4.0.25 and 5.0.21, http://bugs.mysql.com/20910). $show_create_table = PMA_DBI_fetch_value( - 'SHOW CREATE TABLE ' . PMA_backquote($db) . '.' . PMA_backquote($table), - 0, 1); + 'SHOW CREATE TABLE ' . PMA_backquote($db) . '.' . PMA_backquote($table), + 0, 1 +); $analyzed_sql = PMA_SQP_analyze(PMA_SQP_parse($show_create_table)); /** @@ -193,7 +194,7 @@ $i = 0; echo '"table" />'; } ?> - @@ -209,7 +210,7 @@ $i = 0; -
    - @@ -689,8 +690,10 @@ if (! $tbl_is_view && ! $db_is_information_schema && 'ARCHIVE' != $tbl_storage_
    '); + echo sprintf( + __('Create an index on  %s columns'), + '' + ); ?> diff --git a/tbl_tracking.php b/tbl_tracking.php index ae0f0388a8..47a9301554 100644 --- a/tbl_tracking.php +++ b/tbl_tracking.php @@ -171,11 +171,13 @@ if (isset($_REQUEST['submit_create_version'])) { $tracking_set = rtrim($tracking_set, ','); if (PMA_Tracker::createVersion($GLOBALS['db'], $GLOBALS['table'], $_REQUEST['version'], $tracking_set )) { - $msg = PMA_Message::success(sprintf( - __('Version %1$s was created, tracking for %2$s is active.'), - htmlspecialchars($_REQUEST['version']), - htmlspecialchars($GLOBALS['db'] . '.' . $GLOBALS['table']) - )); + $msg = PMA_Message::success( + sprintf( + __('Version %1$s was created, tracking for %2$s is active.'), + htmlspecialchars($_REQUEST['version']), + htmlspecialchars($GLOBALS['db'] . '.' . $GLOBALS['table']) + ) + ); $msg->display(); } } @@ -183,11 +185,13 @@ if (isset($_REQUEST['submit_create_version'])) { // Deactivate tracking if (isset($_REQUEST['submit_deactivate_now'])) { if (PMA_Tracker::deactivateTracking($GLOBALS['db'], $GLOBALS['table'], $_REQUEST['version'])) { - $msg = PMA_Message::success(sprintf( - __('Tracking for %1$s was deactivated at version %2$s.'), - htmlspecialchars($GLOBALS['db'] . '.' . $GLOBALS['table']), - htmlspecialchars($_REQUEST['version']) - )); + $msg = PMA_Message::success( + sprintf( + __('Tracking for %1$s was deactivated at version %2$s.'), + htmlspecialchars($GLOBALS['db'] . '.' . $GLOBALS['table']), + htmlspecialchars($_REQUEST['version']) + ) + ); $msg->display(); } } @@ -195,11 +199,13 @@ if (isset($_REQUEST['submit_deactivate_now'])) { // Activate tracking if (isset($_REQUEST['submit_activate_now'])) { if (PMA_Tracker::activateTracking($GLOBALS['db'], $GLOBALS['table'], $_REQUEST['version'])) { - $msg = PMA_Message::success(sprintf( - __('Tracking for %1$s was activated at version %2$s.'), - htmlspecialchars($GLOBALS['db'] . '.' . $GLOBALS['table']), - htmlspecialchars($_REQUEST['version']) - )); + $msg = PMA_Message::success( + sprintf( + __('Tracking for %1$s was activated at version %2$s.'), + htmlspecialchars($GLOBALS['db'] . '.' . $GLOBALS['table']), + htmlspecialchars($_REQUEST['version']) + ) + ); $msg->display(); } } @@ -207,7 +213,7 @@ if (isset($_REQUEST['submit_activate_now'])) { // Export as SQL execution if (isset($_REQUEST['report_export']) && $_REQUEST['export_type'] == 'execution') { foreach ($entries as $entry) { - $sql_result = PMA_DBI_query( "/*NOTRACK*/\n" . $entry['statement'] ); + $sql_result = PMA_DBI_query("/*NOTRACK*/\n" . $entry['statement']); } $msg = PMA_Message::success(__('SQL statements executed.')); $msg->display(); diff --git a/test/Environment_test.php b/test/Environment_test.php index 5a155191a3..5098ebc301 100644 --- a/test/Environment_test.php +++ b/test/Environment_test.php @@ -18,8 +18,10 @@ class Environment_test extends PHPUnit_Framework_TestCase { public function testPhpVersion() { - $this->assertTrue(version_compare('5.2', phpversion(), '<='), - 'phpMyAdmin requires PHP 5.2 or above'); + $this->assertTrue( + version_compare('5.2', phpversion(), '<='), + 'phpMyAdmin requires PHP 5.2 or above' + ); } public function testMySQL() diff --git a/test/PMA_showHint_test.php b/test/PMA_showHint_test.php index 8a3da9f4d9..f0d1deec55 100644 --- a/test/PMA_showHint_test.php +++ b/test/PMA_showHint_test.php @@ -54,8 +54,13 @@ class PMA_showHint_test extends PHPUnit_Framework_TestCase $GLOBALS['footnotes'][$key]['nr'] = $nr; $GLOBALS['footnotes'][$key]['instance'] = $instance; - $this->assertEquals(sprintf('%d', - $nr, $instance + 1, $nr), PMA_showHint('test')); + $this->assertEquals( + sprintf( + '%d', + $nr, $instance + 1, $nr + ), + PMA_showHint('test') + ); } /** @@ -69,8 +74,10 @@ class PMA_showHint_test extends PHPUnit_Framework_TestCase $GLOBALS['footnotes'][$key]['nr'] = $nr; $GLOBALS['footnotes'][$key]['instance'] = $instance; - $this->assertEquals(sprintf('[sup]%d[/sup]', $nr), - PMA_showHint('test', true)); + $this->assertEquals( + sprintf('[sup]%d[/sup]', $nr), + PMA_showHint('test', true) + ); } /** @@ -124,8 +131,10 @@ class PMA_showHint_test extends PHPUnit_Framework_TestCase $nr = 1; $instance = 1; - $oMock = $this->getMock('PMA_Message', - array('setMessage', 'setNumber', 'getHash', 'getLevel')); + $oMock = $this->getMock( + 'PMA_Message', + array('setMessage', 'setNumber', 'getHash', 'getLevel') + ); $oMock->setMessage('test'); $oMock->setNumber($nr); @@ -134,8 +143,13 @@ class PMA_showHint_test extends PHPUnit_Framework_TestCase $GLOBALS['footnotes'][$key]['nr'] = $nr; $GLOBALS['footnotes'][$key]['instance'] = $instance; - $this->assertEquals(sprintf('%d', - $nr, $instance + 1, $nr), PMA_showHint($oMock)); + $this->assertEquals( + sprintf( + '%d', + $nr, $instance + 1, $nr + ), + PMA_showHint($oMock) + ); } /** @@ -146,12 +160,20 @@ class PMA_showHint_test extends PHPUnit_Framework_TestCase $nr = 1; $instance = 1; - $oMock = $this->getMock('PMA_Message', - array('setMessage', 'setNumber', 'getHash', 'getLevel', 'getNumber')); + $oMock = $this->getMock( + 'PMA_Message', + array('setMessage', 'setNumber', 'getHash', 'getLevel', 'getNumber') + ); $oMock->setMessage('test'); $oMock->setNumber($nr); - $this->assertEquals(sprintf('%d', $nr, $instance, $nr), PMA_showHint($oMock, false)); + $this->assertEquals( + sprintf( + '%d', + $nr, $instance, $nr + ), + PMA_showHint($oMock, false) + ); $key = $oMock->getHash(); diff --git a/test/libraries/PMA_blowfish_test.php b/test/libraries/PMA_blowfish_test.php index 989822a91e..f24d07c722 100644 --- a/test/libraries/PMA_blowfish_test.php +++ b/test/libraries/PMA_blowfish_test.php @@ -17,19 +17,23 @@ class PMA_blowfish_test extends PHPUnit_Framework_TestCase { $secret = '$%ÄüfuDFRR'; $string = '12345678'; - $this->assertEquals($string, - PMA_blowfish_decrypt(PMA_blowfish_encrypt($string, $secret), $secret)); + $this->assertEquals( + $string, + PMA_blowfish_decrypt(PMA_blowfish_encrypt($string, $secret), $secret) + ); } public function testEncryptDecryptChars() { $secret = '$%ÄüfuDFRR'; $string = 'abcDEF012!"§$%&/()=?`´"\',.;:-_#+*~öäüÖÄÜ^°²³'; - $this->assertEquals($string, - PMA_blowfish_decrypt(PMA_blowfish_encrypt($string, $secret), $secret)); + $this->assertEquals( + $string, + PMA_blowfish_decrypt(PMA_blowfish_encrypt($string, $secret), $secret) + ); } - /* Due to differences in the initialization factor, these tests are not portable between systems. + /* Due to differences in the initialization factor, these tests are not portable between systems. public function testEncrypt() { $secret = '$%ÄüfuDFRR'; diff --git a/test/libraries/PMA_transformation_getOptions_test.php b/test/libraries/PMA_transformation_getOptions_test.php index 03bc4bef33..25f70b5ce4 100644 --- a/test/libraries/PMA_transformation_getOptions_test.php +++ b/test/libraries/PMA_transformation_getOptions_test.php @@ -15,32 +15,42 @@ class PMA_transformation_getOptions_test extends PHPUnit_Framework_TestCase { public function testDefault() { - $this->assertEquals(array('option1 ', ' option2 '), - PMA_transformation_getOptions("option1 , option2 ")); + $this->assertEquals( + array('option1 ', ' option2 '), + PMA_transformation_getOptions("option1 , option2 ") + ); } public function testQuoted() { - $this->assertEquals(array('option1', ' option2'), - PMA_transformation_getOptions("'option1' ,' option2' ")); + $this->assertEquals( + array('option1', ' option2'), + PMA_transformation_getOptions("'option1' ,' option2' ") + ); } public function testComma() { - $this->assertEquals(array('2,3', ' ,, option ,,'), - PMA_transformation_getOptions("'2,3' ,' ,, option ,,' ")); + $this->assertEquals( + array('2,3', ' ,, option ,,'), + PMA_transformation_getOptions("'2,3' ,' ,, option ,,' ") + ); } public function testEmptyOptions() { - $this->assertEquals(array('', '', ''), - PMA_transformation_getOptions("'',,")); + $this->assertEquals( + array('', '', ''), + PMA_transformation_getOptions("'',,") + ); } public function testEmpty() { - $this->assertEquals(array(), - PMA_transformation_getOptions('')); + $this->assertEquals( + array(), + PMA_transformation_getOptions('') + ); } } ?> diff --git a/test/libraries/common/PMA_browseUploadFile_test.php b/test/libraries/common/PMA_browseUploadFile_test.php index 0f9f96f3c5..14baa8f78b 100644 --- a/test/libraries/common/PMA_browseUploadFile_test.php +++ b/test/libraries/common/PMA_browseUploadFile_test.php @@ -38,12 +38,14 @@ class PMA_browseUploadFile_test extends PHPUnit_Framework_TestCase */ function testBrowseUploadFile($size, $unit, $res) { - $this->expectOutputString('' - . '' - . '' - . '' - . "(" . __('Max: '). $res . $unit .")" . "\n" - . '' . "\n"); + $this->expectOutputString( + '' + . '' + . '' + . '' + . "(" . __('Max: '). $res . $unit .")" . "\n" + . '' . "\n" + ); PMA_browseUploadFile($size); } diff --git a/test/libraries/common/PMA_generateHiddenMaxFileSize_test.php b/test/libraries/common/PMA_generateHiddenMaxFileSize_test.php index 88a4f3d949..3e5c1af931 100644 --- a/test/libraries/common/PMA_generateHiddenMaxFileSize_test.php +++ b/test/libraries/common/PMA_generateHiddenMaxFileSize_test.php @@ -37,7 +37,9 @@ class PMA_generateHiddenMaxFileSize_test extends PHPUnit_Framework_TestCase */ function test_generateHiddenMaxFileSize($size) { - $this->assertEquals(PMA_generateHiddenMaxFileSize($size), - ''); + $this->assertEquals( + PMA_generateHiddenMaxFileSize($size), + '' + ); } } diff --git a/test/libraries/common/PMA_showMessage_test_disabled.php b/test/libraries/common/PMA_showMessage_test_disabled.php index 2defc737de..be46cebb27 100644 --- a/test/libraries/common/PMA_showMessage_test_disabled.php +++ b/test/libraries/common/PMA_showMessage_test_disabled.php @@ -39,7 +39,8 @@ class PMA_showMessage_test extends PHPUnit_Framework_TestCase $GLOBALS['sql_query'] = "SELECT * FROM tblPatient "; - $this->expectOutputString("