' . "\n" : '';
@@ -2279,7 +2282,8 @@ function PMA_externalBug($functionality, $component, $minimum_version, $bugref)
* @param boolean $checked is it initially checked?
* @param boolean $onclick should it submit the form on click?
*/
-function PMA_display_html_checkbox($html_field_name, $label, $checked, $onclick) {
+function PMA_display_html_checkbox($html_field_name, $label, $checked, $onclick)
+{
echo '
';
}
@@ -2294,7 +2298,8 @@ function PMA_display_html_checkbox($html_field_name, $label, $checked, $onclick)
* @param boolean $escape_label whether to use htmlspecialchars() on label
* @param string $class enclose each choice with a div of this class
*/
-function PMA_display_html_radio($html_field_name, $choices, $checked_choice = '', $line_break = true, $escape_label = true, $class='') {
+function PMA_display_html_radio($html_field_name, $choices, $checked_choice = '', $line_break = true, $escape_label = true, $class='')
+{
foreach ($choices as $choice_value => $choice_label) {
if (! empty($class)) {
echo '
';
@@ -2452,7 +2457,8 @@ function PMA_toggleButton($action, $select_name, $options, $callback)
/**
* Clears cache content which needs to be refreshed on user change.
*/
-function PMA_clearUserCache() {
+function PMA_clearUserCache()
+{
PMA_cacheUnset('is_superuser', true);
}
@@ -2529,7 +2535,8 @@ function PMA_cacheUnset($var, $server = 0)
* @param integer $length
* @return string the printable value
*/
-function PMA_printable_bit_value($value, $length) {
+function PMA_printable_bit_value($value, $length)
+{
$printable = '';
for ($i = 0, $len_ceiled = ceil($length / 8); $i < $len_ceiled; $i++) {
$printable .= sprintf('%08d', decbin(ord(substr($value, $i, 1))));
@@ -2544,7 +2551,8 @@ function PMA_printable_bit_value($value, $length) {
* @param string $value
* @return boolean
*/
-function PMA_contains_nonprintable_ascii($value) {
+function PMA_contains_nonprintable_ascii($value)
+{
return preg_match('@[^[:print:]]@', $value);
}
@@ -2555,7 +2563,8 @@ function PMA_contains_nonprintable_ascii($value) {
* @param string $bit_default_value
* @return string the converted value
*/
-function PMA_convert_bit_default_value($bit_default_value) {
+function PMA_convert_bit_default_value($bit_default_value)
+{
return strtr($bit_default_value, array("b" => "", "'" => ""));
}
@@ -2566,7 +2575,8 @@ function PMA_convert_bit_default_value($bit_default_value) {
* @return array associative array containing type, spec_in_brackets
* and possibly enum_set_values (another array)
*/
-function PMA_extractFieldSpec($fieldspec) {
+function PMA_extractFieldSpec($fieldspec)
+{
$first_bracket_pos = strpos($fieldspec, '(');
if ($first_bracket_pos) {
$spec_in_brackets = chop(substr($fieldspec, $first_bracket_pos + 1, (strrpos($fieldspec, ')') - $first_bracket_pos - 1)));
@@ -2679,7 +2689,8 @@ function PMA_extractFieldSpec($fieldspec) {
* @param string $engine
* @return boolean
*/
-function PMA_foreignkey_supported($engine) {
+function PMA_foreignkey_supported($engine)
+{
$engine = strtoupper($engine);
if ('INNODB' == $engine || 'PBXT' == $engine) {
return true;
@@ -2694,7 +2705,8 @@ function PMA_foreignkey_supported($engine) {
* @param string $content
* @return string the content with characters replaced
*/
-function PMA_replace_binary_contents($content) {
+function PMA_replace_binary_contents($content)
+{
$result = str_replace("\x00", '\0', $content);
$result = str_replace("\x08", '\b', $result);
$result = str_replace("\x0a", '\n', $result);
@@ -2710,7 +2722,8 @@ function PMA_replace_binary_contents($content) {
* @return string with the chars replaced
*/
-function PMA_duplicateFirstNewline($string) {
+function PMA_duplicateFirstNewline($string)
+{
$first_occurence = strpos($string, "\r\n");
if ($first_occurence === 0) {
$string = "\n".$string;
@@ -2726,7 +2739,8 @@ function PMA_duplicateFirstNewline($string) {
* or $cfg['DefaultTabDatabase']
* @return array
*/
-function PMA_getTitleForTarget($target) {
+function PMA_getTitleForTarget($target)
+{
$mapping = array(
// Values for $cfg['DefaultTabTable']
'tbl_structure.php' => __('Structure'),
@@ -2752,7 +2766,8 @@ function PMA_getTitleForTarget($target) {
* @param array $updates Array with overrides for default parameters (obtained from GLOBALS).
* @return string
*/
-function PMA_expandUserString($string, $escape = null, $updates = array()) {
+function PMA_expandUserString($string, $escape = null, $updates = array())
+{
/* Content */
$vars['http_host'] = PMA_getenv('HTTP_HOST') ? PMA_getenv('HTTP_HOST') : '';
$vars['server_name'] = $GLOBALS['cfg']['Server']['host'];
@@ -2868,7 +2883,8 @@ function PMA_ajaxResponse($message, $success = true, $extra_data = array())
*
* @param $max_upload_size
*/
-function PMA_browseUploadFile($max_upload_size) {
+function PMA_browseUploadFile($max_upload_size)
+{
echo '
';
echo '
';
echo '
';
@@ -2884,7 +2900,8 @@ function PMA_browseUploadFile($max_upload_size) {
* @param $import_list
* @param $uploaddir
*/
-function PMA_selectUploadFile($import_list, $uploaddir) {
+function PMA_selectUploadFile($import_list, $uploaddir)
+{
echo '
';
$extensions = '';
foreach ($import_list as $key => $val) {
@@ -2914,7 +2931,8 @@ function PMA_selectUploadFile($import_list, $uploaddir) {
*
* @return array the action titles
*/
-function PMA_buildActionTitles() {
+function PMA_buildActionTitles()
+{
$titles = array();
$titles['Browse'] = PMA_getIcon('b_browse.png', __('Browse'));
@@ -3007,7 +3025,8 @@ function PMA_getSupportedDatatypes($html = false, $selected = '')
* @return array list of datatypes
*/
-function PMA_unsupportedDatatypes() {
+function PMA_unsupportedDatatypes()
+{
// These GIS data types are not yet supported.
$no_support_types = array('geometry',
'point',
diff --git a/libraries/core.lib.php b/libraries/core.lib.php
index 7befffbc52..e0210cd91e 100644
--- a/libraries/core.lib.php
+++ b/libraries/core.lib.php
@@ -239,7 +239,8 @@ function PMA_fatalError($error_message, $message_args = null)
*
* @access public
*/
-function PMA_getPHPDocLink($target) {
+function PMA_getPHPDocLink($target)
+{
/* l10n: Language to use for PHP documentation, please use only languages which do exist in official documentation. */
$lang = _pgettext('PHP documentation language', 'en');
@@ -463,7 +464,8 @@ function PMA_checkPageValidity(&$page, $whitelist)
* @param string $var_name variable name
* @return string value of $var or empty string
*/
-function PMA_getenv($var_name) {
+function PMA_getenv($var_name)
+{
if (isset($_SERVER[$var_name])) {
return $_SERVER[$var_name];
} elseif (isset($_ENV[$var_name])) {
@@ -569,7 +571,8 @@ function PMA_no_cache_header()
*
* @return nothing
*/
-function PMA_download_header($filename, $mimetype, $length = 0, $no_cache = true) {
+function PMA_download_header($filename, $mimetype, $length = 0, $no_cache = true)
+{
if ($no_cache) {
PMA_no_cache_header();
}
@@ -675,7 +678,8 @@ function PMA_array_remove($path, &$array)
*
* @return string URL for a link.
*/
-function PMA_linkURL($url) {
+function PMA_linkURL($url)
+{
if (!preg_match('#^https?://#', $url) || defined('PMA_SETUP')) {
return $url;
} else {
@@ -692,7 +696,8 @@ function PMA_linkURL($url) {
*
* @return string HTML code for javascript inclusion.
*/
-function PMA_includeJS($url) {
+function PMA_includeJS($url)
+{
if (strpos($url, '?') === false) {
return '' . "\n";
} else {
diff --git a/libraries/database_interface.lib.php b/libraries/database_interface.lib.php
index 54b4af385d..6514393132 100644
--- a/libraries/database_interface.lib.php
+++ b/libraries/database_interface.lib.php
@@ -24,7 +24,8 @@ define('PMA_DBI_GETVAR_GLOBAL', 2);
*
* @param string $extension mysql extension to check
*/
-function PMA_DBI_checkMysqlExtension($extension = 'mysql') {
+function PMA_DBI_checkMysqlExtension($extension = 'mysql')
+{
if (! function_exists($extension . '_connect')) {
return false;
}
@@ -75,7 +76,8 @@ require_once './libraries/dbi/' . $GLOBALS['cfg']['Server']['extension'] . '.dbi
* @param bool $cache_affected_rows
* @return mixed
*/
-function PMA_DBI_query($query, $link = null, $options = 0, $cache_affected_rows = true) {
+function PMA_DBI_query($query, $link = null, $options = 0, $cache_affected_rows = true)
+{
$res = PMA_DBI_try_query($query, $link, $options, $cache_affected_rows)
or PMA_mysqlDie(PMA_DBI_getError($link), $query);
return $res;
@@ -155,7 +157,8 @@ function PMA_DBI_try_query($query, $link = null, $options = 0, $cache_affected_r
* @param string $message
* @return string $message
*/
-function PMA_DBI_convert_message($message) {
+function PMA_DBI_convert_message($message)
+{
// latin always last!
$encodings = array(
'japanese' => 'EUC-JP', //'ujis',
@@ -950,7 +953,8 @@ function PMA_DBI_postConnect($link, $is_controluser = false)
* @return mixed value of first field in first row from result
* or false if not found
*/
-function PMA_DBI_fetch_value($result, $row_number = 0, $field = 0, $link = null, $options = 0) {
+function PMA_DBI_fetch_value($result, $row_number = 0, $field = 0, $link = null, $options = 0)
+{
$value = false;
if (is_string($result)) {
@@ -1004,7 +1008,8 @@ function PMA_DBI_fetch_value($result, $row_number = 0, $field = 0, $link = null,
* @return array|boolean first row from result
* or false if result is empty
*/
-function PMA_DBI_fetch_single_row($result, $type = 'ASSOC', $link = null, $options = 0) {
+function PMA_DBI_fetch_single_row($result, $type = 'ASSOC', $link = null, $options = 0)
+{
if (is_string($result)) {
$result = PMA_DBI_try_query($result, $link, $options | PMA_DBI_QUERY_STORE, false);
}
diff --git a/libraries/dbi/mysql.dbi.lib.php b/libraries/dbi/mysql.dbi.lib.php
index 0d6c6976f7..d745f1ba81 100644
--- a/libraries/dbi/mysql.dbi.lib.php
+++ b/libraries/dbi/mysql.dbi.lib.php
@@ -53,7 +53,7 @@ function PMA_DBI_real_connect($server, $user, $password, $client_flags, $persist
/**
* connects to the database server
- *
+ *
* @param string $user mysql user name
* @param string $password mysql user password
* @param bool $is_controluser
@@ -188,7 +188,8 @@ function PMA_DBI_fetch_array($result)
* @param resource $result
* @return array
*/
-function PMA_DBI_fetch_assoc($result) {
+function PMA_DBI_fetch_assoc($result)
+{
return mysql_fetch_array($result, MYSQL_ASSOC);
}
@@ -232,7 +233,8 @@ function PMA_DBI_free_result($result)
*
* @return bool false
*/
-function PMA_DBI_more_results() {
+function PMA_DBI_more_results()
+{
// N.B.: PHP's 'mysql' extension does not support
// multi_queries so this function will always
// return false. Use the 'mysqli' extension, if
@@ -245,7 +247,8 @@ function PMA_DBI_more_results() {
*
* @return boo false
*/
-function PMA_DBI_next_result() {
+function PMA_DBI_next_result()
+{
// N.B.: PHP's 'mysql' extension does not support
// multi_queries so this function will always
// return false. Use the 'mysqli' extension, if
diff --git a/libraries/dbi/mysqli.dbi.lib.php b/libraries/dbi/mysqli.dbi.lib.php
index e3f017b119..d3829588c7 100644
--- a/libraries/dbi/mysqli.dbi.lib.php
+++ b/libraries/dbi/mysqli.dbi.lib.php
@@ -256,7 +256,8 @@ function PMA_DBI_free_result($result)
* @param mysqli $link the mysqli object
* @return bool true or false
*/
-function PMA_DBI_more_results($link = null) {
+function PMA_DBI_more_results($link = null)
+{
if (empty($link)) {
if (isset($GLOBALS['userlink'])) {
$link = $GLOBALS['userlink'];
@@ -273,7 +274,8 @@ function PMA_DBI_more_results($link = null) {
* @param mysqli $link the mysqli object
* @return bool true or false
*/
-function PMA_DBI_next_result($link = null) {
+function PMA_DBI_next_result($link = null)
+{
if (empty($link)) {
if (isset($GLOBALS['userlink'])) {
$link = $GLOBALS['userlink'];
@@ -286,7 +288,7 @@ function PMA_DBI_next_result($link = null) {
/**
* Returns a string representing the type of connection used
- *
+ *
* @param resource $link mysql link
* @return string type of connection used
*/
diff --git a/libraries/display_export.lib.php b/libraries/display_export.lib.php
index 75ec919f25..1a0a86f45d 100644
--- a/libraries/display_export.lib.php
+++ b/libraries/display_export.lib.php
@@ -15,13 +15,15 @@ $cfgRelation = PMA_getRelationsParam();
require_once './libraries/file_listing.php';
require_once './libraries/plugin_interface.lib.php';
-function PMA_exportCheckboxCheck($str) {
+function PMA_exportCheckboxCheck($str)
+{
if (isset($GLOBALS['cfg']['Export'][$str]) && $GLOBALS['cfg']['Export'][$str]) {
echo ' checked="checked"';
}
}
-function PMA_exportIsActive($what, $val) {
+function PMA_exportIsActive($what, $val)
+{
if (isset($GLOBALS['cfg']['Export'][$what]) && $GLOBALS['cfg']['Export'][$what] == $val) {
echo ' checked="checked"';
}
diff --git a/libraries/display_import_ajax.lib.php b/libraries/display_import_ajax.lib.php
index e10a9ea658..f0c271df7f 100644
--- a/libraries/display_import_ajax.lib.php
+++ b/libraries/display_import_ajax.lib.php
@@ -11,7 +11,7 @@ if (!defined('PHPMYADMIN')) {
/**
* constant for differenciating array in $_SESSION variable
*/
-$SESSION_KEY = '__upload_status';
+$SESSION_KEY = '__upload_status';
/**
* sets default plugin for handling the import process
@@ -35,12 +35,12 @@ $plugins = array(
// select available plugin
foreach ($plugins as $plugin) {
$check = "PMA_import_" . $plugin . "Check";
-
+
if ($check()) {
$_SESSION[$SESSION_KEY]["handler"] = $plugin;
include_once("import/upload/" . $plugin . ".php");
break;
- }
+ }
}
/**
@@ -48,7 +48,8 @@ foreach ($plugins as $plugin) {
*
* @return true if APC extension is available and if rfc1867 is enabled, false if it is not
*/
-function PMA_import_apcCheck() {
+function PMA_import_apcCheck()
+{
if (! extension_loaded('apc') || ! function_exists('apc_fetch') || ! function_exists('getallheaders')) {
return false;
}
@@ -57,10 +58,11 @@ function PMA_import_apcCheck() {
/**
* Checks if UploadProgress bar extension is available.
- *
+ *
* @return true if UploadProgress extension is available, false if it is not
*/
-function PMA_import_uploadprogressCheck() {
+function PMA_import_uploadprogressCheck()
+{
if (! function_exists("uploadprogress_get_info") || ! function_exists('getallheaders')) {
return false;
}
@@ -68,19 +70,21 @@ function PMA_import_uploadprogressCheck() {
}
/**
* Default plugin for handling import. If no other plugin is available, noplugin is used.
- *
- * @return true
+ *
+ * @return true
*/
-function PMA_import_nopluginCheck() {
+function PMA_import_nopluginCheck()
+{
return true;
}
/**
* The function outputs json encoded status of uploaded. It uses PMA_getUploadStatus, which is defined in plugin's file.
- *
+ *
* @param $id - ID of transfer, usually $upload_id from display_import_ajax.lib.php
*/
-function PMA_importAjaxStatus($id) {
+function PMA_importAjaxStatus($id)
+{
header('Content-type: application/json');
echo json_encode(PMA_getUploadStatus($id));
}
diff --git a/libraries/display_select_lang.lib.php b/libraries/display_select_lang.lib.php
index 4ed3ec2b83..202378dbfe 100644
--- a/libraries/display_select_lang.lib.php
+++ b/libraries/display_select_lang.lib.php
@@ -17,7 +17,8 @@ if (! defined('PHPMYADMIN')) {
* @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
@@ -26,7 +27,8 @@ function PMA_language_cmp(&$a, &$b) {
*
* @access public
*/
-function PMA_select_language($use_fieldset = false, $show_doc = true) {
+function PMA_select_language($use_fieldset = false, $show_doc = true)
+{
global $cfg, $lang;
?>
diff --git a/libraries/display_tbl.lib.php b/libraries/display_tbl.lib.php
index 5243dff9c0..454f888c1b 100644
--- a/libraries/display_tbl.lib.php
+++ b/libraries/display_tbl.lib.php
@@ -28,12 +28,12 @@ require_once './libraries/Index.class.php';
* the "display printable view" option.
* Of course '0'/'1' means the feature won't/will be enabled.
*
- * @param string &$the_disp_mode the synthetic value for display_mode (see a few
- * lines above for explanations)
- * @param integer &$the_total the total number of rows returned by the SQL query
- * without any programmatically appended "LIMIT" clause
- * (just a copy of $unlim_num_rows if it exists, else
- * computed inside this function)
+ * @param string &$the_disp_mode the synthetic value for display_mode (see a few
+ * lines above for explanations)
+ * @param integer &$the_total the total number of rows returned by the SQL query
+ * without any programmatically appended "LIMIT" clause
+ * (just a copy of $unlim_num_rows if it exists, else
+ * computed inside this function)
*
* @return array an array with explicit indexes for all the display
* elements
@@ -80,7 +80,9 @@ function PMA_setDisplayMode(&$the_disp_mode, &$the_total)
$do_display['bkm_form'] = (string) '0';
$do_display['text_btn'] = (string) '0';
$do_display['pview_lnk'] = (string) '0';
- } elseif ($GLOBALS['is_count'] || $GLOBALS['is_analyse'] || $GLOBALS['is_maint'] || $GLOBALS['is_explain']) {
+ } elseif ($GLOBALS['is_count'] || $GLOBALS['is_analyse']
+ || $GLOBALS['is_maint'] || $GLOBALS['is_explain']
+ ) {
// 2.1 Statement is a "SELECT COUNT", a
// "CHECK/ANALYZE/REPAIR/OPTIMIZE", an "EXPLAIN" one or
// contains a "PROC ANALYSE" part
@@ -131,7 +133,8 @@ function PMA_setDisplayMode(&$the_disp_mode, &$the_total)
|| $do_display['ins_row'] != '0');
// 2.3.2 Displays edit/delete/sort/insert links?
if ($is_link
- && ($fields_meta[$i]->table == '' || $fields_meta[$i]->table != $prev_table)) {
+ && ($fields_meta[$i]->table == '' || $fields_meta[$i]->table != $prev_table)
+ ) {
$do_display['edit_lnk'] = 'nn'; // don't display links
$do_display['del_lnk'] = 'nn';
/**
@@ -220,7 +223,8 @@ function PMA_isSelect()
*
* @see PMA_displayTableNavigation()
*/
-function PMA_displayTableNavigationOneButton($caption, $title, $pos, $html_sql_query, $onsubmit = '', $input_for_real_end = '', $onclick = '') {
+function PMA_displayTableNavigationOneButton($caption, $title, $pos, $html_sql_query, $onsubmit = '', $input_for_real_end = '', $onclick = '')
+{
global $db, $table, $goto;
@@ -1071,7 +1075,8 @@ function PMA_displayTableHeaders(&$is_display, &$fields_meta, $fields_cnt = 0, $
*
* @return string the td
*/
-function PMA_buildValueDisplay($class, $condition_field, $value) {
+function PMA_buildValueDisplay($class, $condition_field, $value)
+{
return '
' . $value . ' | ';
}
@@ -1083,7 +1088,8 @@ function PMA_buildValueDisplay($class, $condition_field, $value) {
*
* @return string the td
*/
-function PMA_buildNullDisplay($class, $condition_field) {
+function PMA_buildNullDisplay($class, $condition_field)
+{
// the null class is needed for inline editing
return '
NULL | ';
}
@@ -1097,7 +1103,8 @@ function PMA_buildNullDisplay($class, $condition_field) {
*
* @return string the td
*/
-function PMA_buildEmptyDisplay($class, $condition_field, $meta, $align = '') {
+function PMA_buildEmptyDisplay($class, $condition_field, $meta, $align = '')
+{
$nowrap = ' nowrap';
return '
| ';
}
@@ -1115,7 +1122,8 @@ function PMA_buildEmptyDisplay($class, $condition_field, $meta, $align = '') {
*
* @return string the list of classes
*/
-function PMA_addClass($class, $condition_field, $meta, $nowrap, $is_field_truncated = false, $transform_function = '', $default_function = '') {
+function PMA_addClass($class, $condition_field, $meta, $nowrap, $is_field_truncated = false, $transform_function = '', $default_function = '')
+{
// Define classes to be added to this data field based on the type of data
$enum_class = '';
if (strpos($meta->flags, 'enum') !== false) {
@@ -1171,7 +1179,8 @@ function PMA_addClass($class, $condition_field, $meta, $nowrap, $is_field_trunca
*
* @see PMA_displayTable()
*/
-function PMA_displayTableBody(&$dt_result, &$is_display, $map, $analyzed_sql) {
+function PMA_displayTableBody(&$dt_result, &$is_display, $map, $analyzed_sql)
+{
global $db, $table, $goto;
global $sql_query, $fields_meta, $fields_cnt;
global $vertical_display, $highlight_columns;
@@ -2385,7 +2394,8 @@ function PMA_displayTable(&$dt_result, &$the_disp_mode, $analyzed_sql)
}
} // end of the 'PMA_displayTable()' function
-function default_function($buffer) {
+function default_function($buffer)
+{
$buffer = htmlspecialchars($buffer);
$buffer = str_replace("\011", ' ',
str_replace(' ', ' ', $buffer));
@@ -2413,7 +2423,8 @@ function default_function($buffer) {
* PMA_displayTableNavigation(), PMA_displayTableHeaders(),
* PMA_displayTableBody(), PMA_displayResultsOperations()
*/
-function PMA_displayResultsOperations($the_disp_mode, $analyzed_sql) {
+function PMA_displayResultsOperations($the_disp_mode, $analyzed_sql)
+{
global $db, $table, $sql_query, $unlim_num_rows, $fields_meta;
$header_shown = false;
@@ -2548,7 +2559,8 @@ function PMA_displayResultsOperations($the_disp_mode, $analyzed_sql) {
* @param object $meta the meta-information about this field
* @return mixed string or float
*/
-function PMA_handle_non_printable_contents($category, $content, $transform_function, $transform_options, $default_function, $meta, $url_params = array()) {
+function PMA_handle_non_printable_contents($category, $content, $transform_function, $transform_options, $default_function, $meta, $url_params = array())
+{
$result = '[' . $category;
if (is_null($content)) {
$result .= ' - NULL';
@@ -2598,7 +2610,8 @@ function PMA_handle_non_printable_contents($category, $content, $transform_funct
* @param bool $is_field_truncated
* @return string formatted data
*/
-function PMA_prepare_row_data($class, $condition_field, $analyzed_sql, $meta, $map, $data, $transform_function, $default_function, $nowrap, $where_comparison, $transform_options, $is_field_truncated ) {
+function PMA_prepare_row_data($class, $condition_field, $analyzed_sql, $meta, $map, $data, $transform_function, $default_function, $nowrap, $where_comparison, $transform_options, $is_field_truncated )
+{
$result = ' class="' . PMA_addClass($class, $condition_field, $meta, $nowrap, $is_field_truncated, $transform_function, $default_function) . '">';
@@ -2696,7 +2709,8 @@ function PMA_prepare_row_data($class, $condition_field, $analyzed_sql, $meta, $m
* @return string the generated HTML
*/
-function PMA_generateCheckboxForMulti($del_url, $is_display, $row_no, $where_clause_html, $del_query, $id_suffix, $class) {
+function PMA_generateCheckboxForMulti($del_url, $is_display, $row_no, $where_clause_html, $del_query, $id_suffix, $class)
+{
$ret = '';
if (! empty($del_url) && $is_display['del_lnk'] != 'kp') {
$ret .= '
'
@@ -2748,7 +2763,8 @@ function PMA_generateEditLink($edit_url, $class, $edit_str, $where_clause, $wher
* @param string $where_clause_html
* @return string the generated HTML
*/
-function PMA_generateCopyLink($copy_url, $copy_str, $where_clause, $where_clause_html, $class) {
+function PMA_generateCopyLink($copy_url, $copy_str, $where_clause, $where_clause_html, $class)
+{
$ret = '';
if (! empty($copy_url)) {
$ret .= ' | add($db, $table);
if ($tmp_result === true) {
echo '';
diff --git a/libraries/iconv_wrapper.lib.php b/libraries/iconv_wrapper.lib.php
index 61e6875b4e..1b05e04b5e 100644
--- a/libraries/iconv_wrapper.lib.php
+++ b/libraries/iconv_wrapper.lib.php
@@ -49,7 +49,8 @@ $gnu_iconv_to_aix_iconv_codepage_map = array (
* @access public
*
*/
-function PMA_aix_iconv_wrapper($in_charset, $out_charset, $str) {
+function PMA_aix_iconv_wrapper($in_charset, $out_charset, $str)
+{
global $gnu_iconv_to_aix_iconv_codepage_map;
diff --git a/libraries/import.lib.php b/libraries/import.lib.php
index 0ab9d5a320..f4577890c5 100644
--- a/libraries/import.lib.php
+++ b/libraries/import.lib.php
@@ -381,7 +381,8 @@ function PMA_getColumnAlphaName($num)
* @param string $name (i.e. "A", or "BC", etc.)
* @return int The column number
*/
-function PMA_getColumnNumberFromName($name) {
+function PMA_getColumnNumberFromName($name)
+{
if (!empty($name)) {
$name = strtoupper($name);
$num_chars = strlen($name);
@@ -440,7 +441,8 @@ define("SIZES", 1);
* @param string $last_cumulative_size
* @return int Precision of the given decimal size notation
*/
-function PMA_getM($last_cumulative_size) {
+function PMA_getM($last_cumulative_size)
+{
return (int)substr($last_cumulative_size, 0, strpos($last_cumulative_size, ","));
}
@@ -452,7 +454,8 @@ function PMA_getM($last_cumulative_size) {
* @param string $last_cumulative_size
* @return int Scale of the given decimal size notation
*/
-function PMA_getD($last_cumulative_size) {
+function PMA_getD($last_cumulative_size)
+{
return (int)substr($last_cumulative_size, (strpos($last_cumulative_size, ",") + 1), (strlen($last_cumulative_size) - strpos($last_cumulative_size, ",")));
}
@@ -464,7 +467,8 @@ function PMA_getD($last_cumulative_size) {
* @param string &$cell
* @return array Contains the precision, scale, and full size representation of the given decimal cell
*/
-function PMA_getDecimalSize(&$cell) {
+function PMA_getDecimalSize(&$cell)
+{
$curr_size = strlen((string)$cell);
$decPos = strpos($cell, ".");
$decPrecision = ($curr_size - 1) - $decPos;
@@ -488,7 +492,8 @@ function PMA_getDecimalSize(&$cell) {
* @param string &$cell The current cell
* @return string Size of the given cell in the type-appropriate format
*/
-function PMA_detectSize($last_cumulative_size, $last_cumulative_type, $curr_type, &$cell) {
+function PMA_detectSize($last_cumulative_size, $last_cumulative_type, $curr_type, &$cell)
+{
$curr_size = strlen((string)$cell);
/**
@@ -697,7 +702,8 @@ function PMA_detectSize($last_cumulative_size, $last_cumulative_type, $curr_type
* @param string &$cell String representation of the cell for which a best-fit type is to be determined
* @return int The MySQL type representation (VARCHAR or INT or BIGINT or DECIMAL or NONE)
*/
-function PMA_detectType($last_cumulative_type, &$cell) {
+function PMA_detectType($last_cumulative_type, &$cell)
+{
/**
* If numeric, determine if decimal, int or bigint
* Else, we call it varchar for simplicity
@@ -736,7 +742,8 @@ function PMA_detectType($last_cumulative_type, &$cell) {
* @param &$table array(string $table_name, array $col_names, array $rows)
* @return array array(array $types, array $sizes)
*/
-function PMA_analyzeTable(&$table) {
+function PMA_analyzeTable(&$table)
+{
/* Get number of rows in table */
$numRows = count($table[ROWS]);
/* Get number of columns */
@@ -833,7 +840,8 @@ $import_notice = null;
* @param array $options Associative array of options
* @return void
*/
-function PMA_buildSQL($db_name, &$tables, &$analyses = null, &$additional_sql = null, $options = null) {
+function PMA_buildSQL($db_name, &$tables, &$analyses = null, &$additional_sql = null, $options = null)
+{
/* Take care of the options */
if (isset($options['db_collation'])&& ! is_null($options['db_collation'])) {
$collation = $options['db_collation'];
diff --git a/libraries/import/upload/apc.php b/libraries/import/upload/apc.php
index a308b1b67c..5250c92255 100644
--- a/libraries/import/upload/apc.php
+++ b/libraries/import/upload/apc.php
@@ -16,7 +16,8 @@ $ID_KEY = 'APC_UPLOAD_PROGRESS';
*
* This is implementation for APC extension.
*/
-function PMA_getUploadStatus($id) {
+function PMA_getUploadStatus($id)
+{
global $SESSION_KEY;
global $ID_KEY;
diff --git a/libraries/import/upload/noplugin.php b/libraries/import/upload/noplugin.php
index a3cb19ad4f..fa7796c686 100644
--- a/libraries/import/upload/noplugin.php
+++ b/libraries/import/upload/noplugin.php
@@ -16,7 +16,8 @@ $ID_KEY = 'noplugin';
*
* This is implementation when no webserver support exists, so it returns just zeroes.
*/
-function PMA_getUploadStatus($id) {
+function PMA_getUploadStatus($id)
+{
global $SESSION_KEY;
global $ID_KEY;
diff --git a/libraries/import/upload/uploadprogress.php b/libraries/import/upload/uploadprogress.php
index 797ade70f9..a3ec60b1de 100644
--- a/libraries/import/upload/uploadprogress.php
+++ b/libraries/import/upload/uploadprogress.php
@@ -15,7 +15,8 @@ $ID_KEY = "UPLOAD_IDENTIFIER";
*
* This is implementation for uploadprogress extension.
*/
-function PMA_getUploadStatus($id) {
+function PMA_getUploadStatus($id)
+{
global $SESSION_KEY;
global $ID_KEY;
diff --git a/libraries/js_escape.lib.php b/libraries/js_escape.lib.php
index 53e5052223..25b832f04a 100644
--- a/libraries/js_escape.lib.php
+++ b/libraries/js_escape.lib.php
@@ -64,7 +64,8 @@ function PMA_escapeJsString($string)
* @param string $key Name of value to set
* @param mixed $value Value to set, can be either string or array of strings
*/
-function PMA_printJsValue($key, $value) {
+function PMA_printJsValue($key, $value)
+{
echo $key . ' = ';
if (is_array($value)) {
echo '[';
diff --git a/libraries/kanji-encoding.lib.php b/libraries/kanji-encoding.lib.php
index 59891f53c3..6ee78c61eb 100644
--- a/libraries/kanji-encoding.lib.php
+++ b/libraries/kanji-encoding.lib.php
@@ -25,7 +25,8 @@ if (! defined('PHPMYADMIN')) {
*
* @return boolean always true
*/
-function PMA_internal_enc_check() {
+function PMA_internal_enc_check()
+{
global $internal_enc, $enc_list;
$internal_enc = mb_internal_encoding();
@@ -47,7 +48,8 @@ function PMA_internal_enc_check() {
*
* @return boolean always true
*/
-function PMA_change_enc_order() {
+function PMA_change_enc_order()
+{
global $enc_list;
$p = explode(',', $enc_list);
@@ -73,7 +75,8 @@ function PMA_change_enc_order() {
*
* @return string the converted string
*/
-function PMA_kanji_str_conv($str, $enc, $kana) {
+function PMA_kanji_str_conv($str, $enc, $kana)
+{
global $enc_list;
if ($enc == '' && $kana == '') {
@@ -104,7 +107,8 @@ function PMA_kanji_str_conv($str, $enc, $kana) {
*
* @return string the name of the converted file
*/
-function PMA_kanji_file_conv($file, $enc, $kana) {
+function PMA_kanji_file_conv($file, $enc, $kana)
+{
if ($enc == '' && $kana == '') {
return $file;
}
@@ -135,7 +139,8 @@ function PMA_kanji_file_conv($file, $enc, $kana) {
*
* @return string xhtml code for the radio controls
*/
-function PMA_set_enc_form($spaces) {
+function PMA_set_enc_form($spaces)
+{
return "\n"
/* l10n: This is currently used only in Japanese locales */
. $spaces . '' . "\n" . '- '
diff --git a/libraries/logging.lib.php b/libraries/logging.lib.php
index 1dabc9a118..e58f96de48 100644
--- a/libraries/logging.lib.php
+++ b/libraries/logging.lib.php
@@ -11,7 +11,8 @@
/**
* Logs user information to webserver logs.
*/
-function PMA_log_user($user, $status = 'ok') {
+function PMA_log_user($user, $status = 'ok')
+{
if (function_exists('apache_note')) {
apache_note('userID', $user);
apache_note('userStatus', $status);
diff --git a/libraries/mime.lib.php b/libraries/mime.lib.php
index b8d035a7b5..f394b8fcfd 100644
--- a/libraries/mime.lib.php
+++ b/libraries/mime.lib.php
@@ -10,7 +10,8 @@
/**
* Tries to detect MIME type of content.
*/
-function PMA_detectMIME(&$test) {
+function PMA_detectMIME(&$test)
+{
$len = strlen($test);
if ($len >= 2 && $test[0] == chr(0xff) && $test[1] == chr(0xd8)) {
return 'image/jpeg';
diff --git a/libraries/mysql_charsets.lib.php b/libraries/mysql_charsets.lib.php
index fc6b18fe87..4eec97eb2b 100644
--- a/libraries/mysql_charsets.lib.php
+++ b/libraries/mysql_charsets.lib.php
@@ -145,7 +145,8 @@ function PMA_generateCharsetDropdownBox($type = PMA_CSDROPDOWN_COLLATION,
return $return_str;
}
-function PMA_generateCharsetQueryPart($collation) {
+function PMA_generateCharsetQueryPart($collation)
+{
list($charset) = explode('_', $collation);
return ' CHARACTER SET ' . $charset . ($charset == $collation ? '' : ' COLLATE ' . $collation);
}
@@ -156,7 +157,8 @@ function PMA_generateCharsetQueryPart($collation) {
* @param string $db name of db
* @return string collation of $db
*/
-function PMA_getDbCollation($db) {
+function PMA_getDbCollation($db)
+{
if ($db == 'information_schema') {
// We don't have to check the collation of the virtual
// information_schema database: We know it!
@@ -181,7 +183,8 @@ function PMA_getDbCollation($db) {
*
* @return string $server_collation
*/
-function PMA_getServerCollation() {
+function PMA_getServerCollation()
+{
return PMA_DBI_fetch_value(
'SHOW VARIABLES LIKE \'collation_server\'', 0, 1);
}
@@ -193,7 +196,8 @@ function PMA_getServerCollation() {
* @param string $collation MySQL collation string
* @return string collation description
*/
-function PMA_getCollationDescr($collation) {
+function PMA_getCollationDescr($collation)
+{
if ($collation == 'binary') {
return __('Binary');
}
diff --git a/libraries/opendocument.lib.php b/libraries/opendocument.lib.php
index 4af590aee9..c161f22a01 100644
--- a/libraries/opendocument.lib.php
+++ b/libraries/opendocument.lib.php
@@ -30,7 +30,8 @@ $GLOBALS['OpenDocumentNS'] = 'xmlns:office="urn:oasis:names:tc:opendocument:xmln
*
* @access public
*/
-function PMA_createOpenDocument($mime, $data) {
+function PMA_createOpenDocument($mime, $data)
+{
$zipfile = new zipfile();
$zipfile -> addFile($mime, 'mimetype');
$zipfile -> addFile($data, 'content.xml');
diff --git a/libraries/relation.lib.php b/libraries/relation.lib.php
index 3534840afe..c24c2491e7 100644
--- a/libraries/relation.lib.php
+++ b/libraries/relation.lib.php
@@ -1071,7 +1071,8 @@ function PMA_REL_renameField($db, $table, $field, $new_name)
* @param string $query_default_option
* @return string $pdf_page_number
*/
-function PMA_REL_create_page($newpage, $cfgRelation, $db, $query_default_option) {
+function PMA_REL_create_page($newpage, $cfgRelation, $db, $query_default_option)
+{
if (! isset($newpage) || $newpage == '') {
$newpage = __('no description');
}
diff --git a/libraries/replication.inc.php b/libraries/replication.inc.php
index 36e656c457..7327075688 100644
--- a/libraries/replication.inc.php
+++ b/libraries/replication.inc.php
@@ -140,7 +140,8 @@ foreach ($replication_types as $type) {
* @param $what what to extract (db|table)
* @return $string the extracted part
*/
-function PMA_extract_db_or_table($string, $what = 'db') {
+function PMA_extract_db_or_table($string, $what = 'db')
+{
$list = explode(".", $string);
if ('db' == $what) {
return $list[0];
@@ -155,7 +156,8 @@ function PMA_extract_db_or_table($string, $what = 'db') {
*
* @return mixed output of PMA_DBI_try_query
*/
-function PMA_replication_slave_control($action, $control = null, $link = null) {
+function PMA_replication_slave_control($action, $control = null, $link = null)
+{
$action = strtoupper($action);
$control = strtoupper($control);
@@ -180,7 +182,8 @@ function PMA_replication_slave_control($action, $control = null, $link = null) {
*
* @return output of CHANGE MASTER mysql command
*/
-function PMA_replication_slave_change_master($user, $password, $host, $port, $pos, $stop = true, $start = true, $link = null) {
+function PMA_replication_slave_change_master($user, $password, $host, $port, $pos, $stop = true, $start = true, $link = null)
+{
if ($stop) {
PMA_replication_slave_control("STOP", null, $link);
}
@@ -211,7 +214,8 @@ function PMA_replication_slave_change_master($user, $password, $host, $port, $po
*
* @return mixed $link mysql link on success
*/
-function PMA_replication_connect_to_master($user, $password, $host = null, $port = null, $socket = null) {
+function PMA_replication_connect_to_master($user, $password, $host = null, $port = null, $socket = null)
+{
$server = array();
$server["host"] = $host;
$server["port"] = $port;
@@ -226,7 +230,8 @@ function PMA_replication_connect_to_master($user, $password, $host = null, $port
*
* @return array - containing File and Position in MySQL replication on master server, useful for PMA_replication_slave_change_master
*/
-function PMA_replication_slave_bin_log_master($link = null) {
+function PMA_replication_slave_bin_log_master($link = null)
+{
$data = PMA_DBI_fetch_result('SHOW MASTER STATUS', null, null, $link);
$output = array();
@@ -245,7 +250,8 @@ function PMA_replication_slave_bin_log_master($link = null) {
* @return array array of replicated databases
*/
-function PMA_replication_master_replicated_dbs($link = null) {
+function PMA_replication_master_replicated_dbs($link = null)
+{
$data = PMA_DBI_fetch_result('SHOW MASTER STATUS', null, null, $link); // let's find out, which databases are replicated
$do_db = array();
@@ -287,7 +293,8 @@ function PMA_replication_master_replicated_dbs($link = null) {
* @param boolean $data - if true, then data will be copied as well
*/
-function PMA_replication_synchronize_db($db, $src_link, $trg_link, $data = true) {
+function PMA_replication_synchronize_db($db, $src_link, $trg_link, $data = true)
+{
$src_db = $trg_db = $db;
$src_connection = PMA_DBI_select_db($src_db, $src_link);
diff --git a/libraries/replication_gui.lib.php b/libraries/replication_gui.lib.php
index 3e8e6877df..91b284f189 100644
--- a/libraries/replication_gui.lib.php
+++ b/libraries/replication_gui.lib.php
@@ -43,7 +43,8 @@ function PMA_replication_db_multibox()
* @param String $submitname - submit button name
*/
-function PMA_replication_gui_changemaster($submitname) {
+function PMA_replication_gui_changemaster($submitname)
+{
list($username_length, $hostname_length) = PMA_replication_get_username_hostname_length();
@@ -84,7 +85,8 @@ function PMA_replication_gui_changemaster($submitname) {
* @param boolean $hidden - if true, then default style is set to hidden, default value false
* @param boolen $title - if true, then title is displayed, default true
*/
-function PMA_replication_print_status_table($type, $hidden = false, $title = true) {
+function PMA_replication_print_status_table($type, $hidden = false, $title = true)
+{
global ${"{$type}_variables"};
global ${"{$type}_variables_alerts"};
global ${"{$type}_variables_oks"};
@@ -162,7 +164,8 @@ function PMA_replication_print_status_table($type, $hidden = false, $title = tru
*
* @param boolean $hidden - if true, then default style is set to hidden, default value false
*/
-function PMA_replication_print_slaves_table($hidden = false) {
+function PMA_replication_print_slaves_table($hidden = false)
+{
// Fetch data
$data = PMA_DBI_fetch_result('SHOW SLAVE HOSTS', null, null);
@@ -202,7 +205,8 @@ function PMA_replication_print_slaves_table($hidden = false) {
* @return array username length, hostname length
*/
-function PMA_replication_get_username_hostname_length() {
+function PMA_replication_get_username_hostname_length()
+{
$fields_info = PMA_DBI_get_columns('mysql', 'user');
$username_length = 16;
$hostname_length = 41;
@@ -227,7 +231,8 @@ function PMA_replication_get_username_hostname_length() {
/**
* Print code to add a replication slave user to the master
*/
-function PMA_replication_gui_master_addslaveuser() {
+function PMA_replication_gui_master_addslaveuser()
+{
list($username_length, $hostname_length) = PMA_replication_get_username_hostname_length();
diff --git a/libraries/select_lang.lib.php b/libraries/select_lang.lib.php
index 284fdbef85..a3627b1ea5 100644
--- a/libraries/select_lang.lib.php
+++ b/libraries/select_lang.lib.php
@@ -12,7 +12,8 @@ if (! defined('PHPMYADMIN')) {
/**
* Returns language name
*/
-function PMA_langName($tmplang) {
+function PMA_langName($tmplang)
+{
$lang_name = ucfirst(substr(strrchr($tmplang[0], '|'), 1));
// Include native name if non empty
@@ -182,7 +183,8 @@ function PMA_langDetect($str, $envType)
* example.
*
*/
-function PMA_langDetails($lang) {
+function PMA_langDetails($lang)
+{
switch ($lang) {
case 'af':
return array('af|afrikaans', 'af', '');
diff --git a/libraries/server_synchronize.lib.php b/libraries/server_synchronize.lib.php
index 5ddd07a8d3..1edbb83c1f 100644
--- a/libraries/server_synchronize.lib.php
+++ b/libraries/server_synchronize.lib.php
@@ -1261,7 +1261,8 @@ function PMA_applyIndexesDiff ($trg_db, $trg_link, $matching_tables, $source_ind
*
* @param string $query the query to display
*/
-function PMA_displayQuery($query) {
+function PMA_displayQuery($query)
+{
if (strlen($query) > $GLOBALS['cfg']['MaxCharactersInDisplayedSQL']) {
$query = substr($query, 0, $GLOBALS['cfg']['MaxCharactersInDisplayedSQL']) . '[...]';
}
@@ -1274,7 +1275,8 @@ function PMA_displayQuery($query) {
* @param string $src_db source db name
* @param string $trg_db target db name
*/
-function PMA_syncDisplayHeaderCompare($src_db, $trg_db) {
+function PMA_syncDisplayHeaderCompare($src_db, $trg_db)
+{
echo '
|