Format array declarations

Signed-off-by: Maurício Meneghini Fauth <mauriciofauth@gmail.com>
This commit is contained in:
Maurício Meneghini Fauth 2019-01-07 14:31:39 -02:00
parent 4cee0cbc12
commit 23c3579804
283 changed files with 9082 additions and 3435 deletions

View File

@ -23,7 +23,7 @@ require_once ROOT_PATH . 'libraries/common.inc.php';
*/
$request_params = [
'data',
'field'
'field',
];
foreach ($request_params as $one_request_param) {

View File

@ -103,7 +103,7 @@ if (strlen($GLOBALS['db']) > 0
'libraries/classes/Plugins/Export/',
[
'single_table' => isset($single_table),
'export_type' => 'database'
'export_type' => 'database',
]
);

View File

@ -25,11 +25,17 @@ function get_login_credentials($user)
{
/* Optionally we can use passed username */
if (! empty($user)) {
return [$user, 'password'];
return [
$user,
'password',
];
}
/* Here we would retrieve the credentials */
$credentials = ['root', ''];
$credentials = [
'root',
'',
];
return $credentials;
}

View File

@ -172,7 +172,7 @@ $post_params = [
'latex_data_continued_caption',
'latex_data_label',
'latex_null',
'aliases'
'aliases',
];
foreach ($post_params as $one_post_param) {
@ -196,7 +196,7 @@ $export_plugin = Plugins::getPlugin(
'libraries/classes/Plugins/Export/',
[
'export_type' => $export_type,
'single_table' => isset($single_table)
'single_table' => isset($single_table),
]
);
@ -210,7 +210,7 @@ if (empty($export_plugin)) {
*/
$compression_methods = [
'zip',
'gzip'
'gzip',
];
/**
@ -291,7 +291,8 @@ if ($export_type == 'server') {
} elseif ($export_type == 'table' && strlen($db) > 0 && strlen($table) > 0) {
$err_url = 'tbl_export.php' . Url::getCommon(
[
'db' => $db, 'table' => $table
'db' => $db,
'table' => $table,
]
);
} else {

View File

@ -39,7 +39,7 @@ $gis_types = [
'MULTILINESTRING',
'POLYGON',
'MULTIPOLYGON',
'GEOMETRYCOLLECTION'
'GEOMETRYCOLLECTION',
];
// Extract type from the initial call and make sure that it's a valid one.
@ -83,9 +83,14 @@ $result = "'" . $wkt . "'," . $srid;
$visualizationSettings = [
'width' => 450,
'height' => 300,
'spatialColumn' => 'wkt'
'spatialColumn' => 'wkt',
];
$data = [
[
'wkt' => $wkt_with_zero,
'srid' => $srid,
],
];
$data = [['wkt' => $wkt_with_zero, 'srid' => $srid]];
$visualization = GisVisualization::getByData($data, $visualizationSettings)
->toImage('svg');

View File

@ -105,7 +105,7 @@ $post_params = [
'message_to_show',
'noplugin',
'skip_queries',
'local_import_file'
'local_import_file',
];
foreach ($post_params as $one_post_param) {
@ -246,7 +246,7 @@ if (! in_array(
'ods',
'shp',
'sql',
'xml'
'xml',
]
)
) {
@ -257,7 +257,7 @@ if (! in_array(
$post_patterns = [
'/^force_file_/',
'/^' . $format . '_/'
'/^' . $format . '_/',
];
Core::setPostAsGlobal($post_patterns);
@ -269,7 +269,10 @@ PhpMyAdmin\Util::checkParameters(['import_type', 'format']);
$format = Core::securePath($format);
if (strlen($table) > 0 && strlen($db) > 0) {
$urlparams = ['db' => $db, 'table' => $table];
$urlparams = [
'db' => $db,
'table' => $table,
];
} elseif (strlen($db) > 0) {
$urlparams = ['db' => $db];
} else {
@ -538,7 +541,10 @@ if (! $error && isset($_POST['skip'])) {
// This array contain the data like numberof valid sql queries in the statement
// and complete valid sql statement (which affected for rows)
$sql_data = ['valid_sql' => [], 'valid_queries' => 0];
$sql_data = [
'valid_sql' => [],
'valid_queries' => 0,
];
if (! $error) {
/**

View File

@ -40,7 +40,7 @@ $drops = [
'server',
'collation_connection',
'db',
'table'
'table',
];
foreach ($drops as $each_drop) {
if (array_key_exists($each_drop, $_GET)) {
@ -55,7 +55,8 @@ unset($drops, $each_drop);
*
*/
$target_blacklist = [
'import.php', 'export.php'
'import.php',
'export.php',
];
// If we have a valid target, let's load that script instead

View File

@ -810,7 +810,7 @@ Sanitize::printJsValue(
__('September'),
__('October'),
__('November'),
__('December')
__('December'),
]
);
Sanitize::printJsValue(
@ -839,7 +839,7 @@ Sanitize::printJsValue(
/* l10n: Short month name */
__('Nov'),
/* l10n: Short month name */
__('Dec')
__('Dec'),
]
);
Sanitize::printJsValue(
@ -851,7 +851,7 @@ Sanitize::printJsValue(
__('Wednesday'),
__('Thursday'),
__('Friday'),
__('Saturday')
__('Saturday'),
]
);
Sanitize::printJsValue(
@ -870,7 +870,7 @@ Sanitize::printJsValue(
/* l10n: Short week day name */
__('Fri'),
/* l10n: Short week day name */
__('Sat')
__('Sat'),
]
);
Sanitize::printJsValue(
@ -889,7 +889,7 @@ Sanitize::printJsValue(
/* l10n: Minimal week day name */
__('Fr'),
/* l10n: Minimal week day name */
__('Sa')
__('Sa'),
]
);
/* l10n: Column header for week of the year in calendar */

View File

@ -237,7 +237,7 @@ class Advisor
return [
'parse' => ['errors' => $this->parseResult['errors']],
'run' => $this->runResult
'run' => $this->runResult,
];
}
@ -375,7 +375,10 @@ class Advisor
{
$jst = preg_split('/\s*\|\s*/', $rule['justification'], 2);
if (count($jst) > 1) {
return [$jst[0], $jst[1]];
return [
$jst[0],
$jst[1],
];
}
return [$rule['justification']];
}
@ -421,14 +424,20 @@ class Advisor
// linking to server_variables.php
$rule['recommendation'] = preg_replace_callback(
'/\{([a-z_0-9]+)\}/Ui',
[$this, 'replaceVariable'],
[
$this,
'replaceVariable',
],
$this->translate($rule['recommendation'])
);
// Replaces external Links with Core::linkURL() generated links
$rule['recommendation'] = preg_replace_callback(
'#href=("|\')(https?://[^\1]+)\1#i',
[$this, 'replaceLinkURL'],
[
$this,
'replaceLinkURL',
],
$rule['recommendation']
);
break;
@ -504,11 +513,20 @@ class Advisor
__('Error in reading file: The file \'%s\' does not exist or is not readable!'),
$filename
);
return ['rules' => $rules, 'lines' => $lines, 'errors' => $errors];
return [
'rules' => $rules,
'lines' => $lines,
'errors' => $errors,
];
}
$ruleSyntax = [
'name', 'formula', 'test', 'issue', 'recommendation', 'justification'
'name',
'formula',
'test',
'issue',
'recommendation',
'justification',
];
$numRules = count($ruleSyntax);
$numLines = count($file);
@ -589,7 +607,11 @@ class Advisor
}
}
return ['rules' => $rules, 'lines' => $lines, 'errors' => $errors];
return [
'rules' => $rules,
'lines' => $lines,
'errors' => $errors,
];
}
/**

View File

@ -146,7 +146,11 @@ class BrowseForeigners
$output .= '</tr>';
return [$output, $horizontal_count, $indexByDescription];
return [
$output,
$horizontal_count,
$indexByDescription,
];
}
/**
@ -295,7 +299,10 @@ class BrowseForeigners
. '...'
);
}
return [$description, $descriptionTitle];
return [
$description,
$descriptionTitle,
];
}
/**

View File

@ -265,7 +265,7 @@ class CentralColumns
$attribute = "";
if (isset($def['Type'])) {
$extracted_columnspec = Util::extractColumnSpec($def['Type']);
$attribute = trim($extracted_columnspec[ 'attribute']);
$attribute = trim($extracted_columnspec['attribute']);
$type = $extracted_columnspec['type'];
$length = $extracted_columnspec['spec_in_brackets'];
}
@ -760,10 +760,10 @@ class CentralColumns
'ci' => 0,
'ci_offset' => 0,
'column_meta' => [
'Field' => $row['col_name']
'Field' => $row['col_name'],
],
'cfg_relation' => [
'centralcolumnswork' => false
'centralcolumnswork' => false,
],
'max_rows' => $this->maxRows,
])
@ -1004,8 +1004,14 @@ class CentralColumns
{
$html = '<form id="multi_edit_central_columns">';
$header_cells = [
__('Name'), __('Type'), __('Length/Values'), __('Default'),
__('Collation'), __('Attributes'), __('Null'), __('A_I')
__('Name'),
__('Type'),
__('Length/Values'),
__('Default'),
__('Collation'),
__('Attributes'),
__('Null'),
__('A_I'),
];
$html .= $this->getEditTableHeader($header_cells);
$selected_fld_safe = [];

View File

@ -82,7 +82,7 @@ class CheckUserPrivileges
return [
$show_grants_str,
$show_grants_dbname,
$show_grants_tblname
$show_grants_tblname,
];
}

View File

@ -711,8 +711,16 @@ class Config
}
if ($commit !== false) {
$author = ['name' => '', 'email' => '', 'date' => ''];
$committer = ['name' => '', 'email' => '', 'date' => ''];
$author = [
'name' => '',
'email' => '',
'date' => ''
];
$committer = [
'name' => '',
'email' => '',
'date' => ''
];
do {
$dataline = array_shift($commit);
@ -1414,7 +1422,7 @@ class Config
'PMA_IS_GD2',
'PMA_USR_OS',
'PMA_USR_BROWSER_VER',
'PMA_USR_BROWSER_AGENT'
'PMA_USR_BROWSER_AGENT',
];
foreach ($defines as $define) {

View File

@ -31,8 +31,14 @@ class Descriptions
public static function get($path, $type = 'name')
{
$key = str_replace(
['Servers/1/', '/'],
['Servers/', '_'],
[
'Servers/1/',
'/',
],
[
'Servers/',
'_',
],
$path
);
$value = self::getString($key, $type);

View File

@ -860,9 +860,18 @@ class FormDisplay
) {
$comment = '';
$funcs = [
'ZipDump' => ['zip_open', 'gzcompress'],
'GZipDump' => ['gzopen', 'gzencode'],
'BZipDump' => ['bzopen', 'bzcompress']
'ZipDump' => [
'zip_open',
'gzcompress',
],
'GZipDump' => [
'gzopen',
'gzencode',
],
'BZipDump' => [
'bzopen',
'bzcompress',
],
];
if (! function_exists($funcs[$systemPath][0])) {
$comment = sprintf(

View File

@ -193,10 +193,22 @@ class FormDisplayTemplate
// The first element contains the filename and the second
// element is used for the "alt" and "title" attributes.
$iconInit = [
'edit' => ['b_edit', ''],
'help' => ['b_help', __('Documentation')],
'reload' => ['s_reload', ''],
'tblops' => ['b_tblops', '']
'edit' => [
'b_edit',
'',
],
'help' => [
'b_help',
__('Documentation'),
],
'reload' => [
's_reload',
'',
],
'tblops' => [
'b_tblops',
'',
],
];
if ($isSetupScript) {
// When called from the setup script, we don't have access to the

View File

@ -24,7 +24,7 @@ class BrowseForm extends BaseForm
public static function getForms()
{
return [
'Browse' => MainForm::getForms()['Browse']
'Browse' => MainForm::getForms()['Browse'],
];
}
}

View File

@ -24,7 +24,7 @@ class DbStructureForm extends BaseForm
public static function getForms()
{
return [
'DbStructure' => MainForm::getForms()['DbStructure']
'DbStructure' => MainForm::getForms()['DbStructure'],
];
}
}

View File

@ -24,7 +24,7 @@ class TableStructureForm extends BaseForm
public static function getForms()
{
return [
'TableStructure' => MainForm::getForms()['TableStructure']
'TableStructure' => MainForm::getForms()['TableStructure'],
];
}
}

View File

@ -25,7 +25,7 @@ class ConfigForm extends BaseForm
return [
'Config' => [
'DefaultLang',
'ServerDefault'
'ServerDefault',
],
];
}

View File

@ -24,7 +24,10 @@ class FeaturesForm extends \PhpMyAdmin\Config\Forms\User\FeaturesForm
/* Remove only_db/hide_db, we have proper Server form in setup */
$result['Databases'] = array_diff(
$result['Databases'],
['Servers/1/only_db', 'Servers/1/hide_db']
[
'Servers/1/only_db',
'Servers/1/hide_db',
]
);
/* Following are not available to user */
$result['Import_export'] = [
@ -49,7 +52,7 @@ class FeaturesForm extends \PhpMyAdmin\Config\Forms\User\FeaturesForm
'LoginCookieStore',
'LoginCookieDeleteAll',
'CaptchaLoginPublicKey',
'CaptchaLoginPrivateKey'
'CaptchaLoginPrivateKey',
];
$result['Developer'] = [
'UserprefsDeveloperTab',

View File

@ -31,9 +31,9 @@ class ServersForm extends BaseForm
'port',
'socket',
'ssl',
'compress'
]
]
'compress',
],
],
],
'Server_auth' => [
'Servers' => [
@ -49,9 +49,9 @@ class ServersForm extends BaseForm
':group:' . __('Signon authentication'),
'SignonSession',
'SignonURL',
'LogoutURL'
]
]
'LogoutURL',
],
],
],
'Server_config' => [
'Servers' => [
@ -63,9 +63,9 @@ class ServersForm extends BaseForm
'DisableIS',
'AllowDeny/order',
'AllowDeny/rules',
'SessionTimeZone'
]
]
'SessionTimeZone',
],
],
],
'Server_pmadb' => [
'Servers' => [
@ -95,8 +95,8 @@ class ServersForm extends BaseForm
'designer_settings' => 'pma__designer_settings',
'export_templates' => 'pma__export_templates',
'MaxTableUiprefs' => 100
]
]
],
],
],
'Server_tracking' => [
'Servers' => [
@ -106,8 +106,8 @@ class ServersForm extends BaseForm
'tracking_add_drop_view',
'tracking_add_drop_table',
'tracking_add_drop_database',
]
]
],
],
],
];
}

View File

@ -97,7 +97,7 @@ class ExportForm extends BaseForm
'Export/excel_null',
'Export/excel_removeCRLF',
'Export/excel_columns',
'Export/excel_edition'
'Export/excel_edition',
],
'Latex' => [
'Export/latex_caption',
@ -115,13 +115,13 @@ class ExportForm extends BaseForm
'Export/latex_data_caption',
'Export/latex_data_continued_caption',
'Export/latex_data_label',
'Export/latex_null'
'Export/latex_null',
],
'Microsoft_Office' => [
':group:' . __('Microsoft Word 2000'),
'Export/htmlword_structure_or_data',
'Export/htmlword_null',
'Export/htmlword_columns'
'Export/htmlword_columns',
],
'Open_Document' => [
':group:' . __('OpenDocument Spreadsheet'),
@ -137,13 +137,13 @@ class ExportForm extends BaseForm
':group:end',
':group:' . __('Data'),
'Export/odt_columns',
'Export/odt_null'
'Export/odt_null',
],
'Texy' => [
'Export/texytext_structure_or_data',
':group:' . __('Data'),
'Export/texytext_null',
'Export/texytext_columns'
'Export/texytext_columns',
],
];
}

View File

@ -49,19 +49,19 @@ class FeaturesForm extends BaseForm
'CharTextareaRows',
'TextareaCols',
'TextareaRows',
'LongtextDoubleTextarea'
'LongtextDoubleTextarea',
],
'Page_titles' => [
'TitleDefault',
'TitleTable',
'TitleDatabase',
'TitleServer'
'TitleServer',
],
'Warnings' => [
'PmaNoRelation_DisableWarning',
'SuhosinDisableWarning',
'LoginCookieValidityDisableWarning',
'ReservedWordDisableWarning'
'ReservedWordDisableWarning',
],
'Console' => [
'Console/Mode',

View File

@ -28,12 +28,12 @@ class ImportForm extends BaseForm
'Import/charset',
'Import/allow_interrupt',
'Import/skip_queries',
'enable_drag_drop_import'
'enable_drag_drop_import',
],
'Sql' => [
'Import/sql_compatibility',
'Import/sql_no_auto_value_on_zero',
'Import/sql_read_as_multibytes'
'Import/sql_read_as_multibytes',
],
'Csv' => [
':group:' . __('CSV'),
@ -50,14 +50,14 @@ class ImportForm extends BaseForm
'Import/ldi_terminated',
'Import/ldi_enclosed',
'Import/ldi_escaped',
'Import/ldi_local_option'
'Import/ldi_local_option',
],
'Open_Document' => [
':group:' . __('OpenDocument Spreadsheet'),
'Import/ods_col_names',
'Import/ods_empty_rows',
'Import/ods_recognize_percentages',
'Import/ods_recognize_currency'
'Import/ods_recognize_currency',
],
];

View File

@ -26,14 +26,14 @@ class MainForm extends BaseForm
'Startup' => [
'ShowCreateDb',
'ShowStats',
'ShowServerInfo'
'ShowServerInfo',
],
'DbStructure' => [
'ShowDbStructureCharset',
'ShowDbStructureComment',
'ShowDbStructureCreation',
'ShowDbStructureLastUpdate',
'ShowDbStructureLastCheck'
'ShowDbStructureLastCheck',
],
'TableStructure' => [
'HideStructureActions',
@ -48,7 +48,7 @@ class MainForm extends BaseForm
'DefaultTransformations/Inline',
'DefaultTransformations/TextImageLink',
'DefaultTransformations/TextLink',
':group:end'
':group:end',
],
'Browse' => [
'TableNavigationLinksMode',
@ -66,7 +66,7 @@ class MainForm extends BaseForm
'RowActionLinksWithoutUnique',
'TablePrimaryKeyOrder',
'RememberSorting',
'RelationalDisplay'
'RelationalDisplay',
],
'Edit' => [
'ProtectBinary',
@ -74,13 +74,13 @@ class MainForm extends BaseForm
'ShowFieldTypesInDataEditView',
'InsertRows',
'ForeignKeyDropdownOrder',
'ForeignKeyMaxLimit'
'ForeignKeyMaxLimit',
],
'Tabs' => [
'TabsMode',
'DefaultTabServer',
'DefaultTabDatabase',
'DefaultTabTable'
'DefaultTabTable',
],
'DisplayRelationalSchema' => [
'PDFDefaultPageSize'

View File

@ -45,7 +45,7 @@ class NaviForm extends BaseForm
'NavigationTreeShowFunctions',
'NavigationTreeShowProcedures',
'NavigationTreeShowEvents',
'NavigationTreeAutoexpandSingleDb'
'NavigationTreeAutoexpandSingleDb',
],
'Navi_servers' => [
'NavigationDisplayServers',
@ -53,7 +53,7 @@ class NaviForm extends BaseForm
],
'Navi_databases' => [
'NavigationTreeDisplayDbFilterMinimum',
'NavigationTreeDbSeparator'
'NavigationTreeDbSeparator',
],
'Navi_tables' => [
'NavigationTreeDefaultTabTable',

View File

@ -173,7 +173,7 @@ class PageSettings
false,
$response->getFooter()->getSelfUrl(),
[
'submit_save' => $this->_groupName
'submit_save' => $this->_groupName,
]
);
$retval .= '</div>';

View File

@ -241,7 +241,11 @@ class ServerConfigChecks
);
}
}
return [$cookieAuthUsed, $blowfishSecret, $blowfishSecretSet];
return [
$cookieAuthUsed,
$blowfishSecret,
$blowfishSecretSet,
];
}
/**
@ -262,7 +266,10 @@ class ServerConfigChecks
$blowfishSecretSet = true;
$this->cfg->set('blowfish_secret', Util::generateRandom(32));
}
return [$blowfishSecret, $blowfishSecretSet];
return [
$blowfishSecret,
$blowfishSecretSet,
];
}
/**

View File

@ -318,7 +318,7 @@ class Validator
$result = [
'Server_pmadb' => '',
'Servers/1/controluser' => '',
'Servers/1/controlpass' => ''
'Servers/1/controlpass' => '',
];
$error = false;
@ -506,7 +506,7 @@ class Validator
false,
65535,
__('Not a valid port number!')
)
),
];
}
@ -528,7 +528,7 @@ class Validator
false,
PHP_INT_MAX,
__('Not a positive number!')
)
),
];
}
@ -550,7 +550,7 @@ class Validator
true,
PHP_INT_MAX,
__('Not a non-negative number!')
)
),
];
}
@ -589,7 +589,7 @@ class Validator
$path => $result ? '' : sprintf(
__('Value must be equal or lower than %s!'),
$maxValue
)
),
];
}
}

View File

@ -159,7 +159,7 @@ class DatabaseStructureController extends DatabaseController
$uri = './db_structure.php' . Url::getCommonRaw([
'db' => $this->db,
'pos' => max(0, $this->_total_num_tables - $GLOBALS['cfg']['MaxTableList']),
'reload' => 1
'reload' => 1,
]);
Core::sendHeaderLocation($uri);
}
@ -187,7 +187,7 @@ class DatabaseStructureController extends DatabaseController
$this->response->addHTML('<div id="tableslistcontainer">');
$_url_params = [
'pos' => $this->_pos,
'db' => $this->db
'db' => $this->db,
];
// Add the sort options if they exists
@ -236,7 +236,7 @@ class DatabaseStructureController extends DatabaseController
'url_query' => Url::getCommon([
'db' => $this->db,
'goto' => 'db_structure.php',
])
]),
])
);
@ -305,10 +305,11 @@ class DatabaseStructureController extends DatabaseController
return;
}
// Check if current table is already in favorite list.
$favParams = ['db' => $this->db,
$favParams = [
'db' => $this->db,
'ajax_request' => true,
'favorite_table' => $favorite_table,
(($already_favorite ? 'remove' : 'add') . '_favorite') => true
(($already_favorite ? 'remove' : 'add') . '_favorite') => true,
];
$this->response->addJSON([
'user' => $user,
@ -353,7 +354,7 @@ class DatabaseStructureController extends DatabaseController
->getRealRowCountTable();
$real_row_count_all[] = [
'table' => $table['TABLE_NAME'],
'row_count' => $row_count
'row_count' => $row_count,
];
}
@ -440,7 +441,10 @@ class DatabaseStructureController extends DatabaseController
$table_is_view = false;
// Sets parameters for links
$tbl_url_query = Url::getCommon(
['db' => $this->db, 'table' => $current_table['TABLE_NAME']]
[
'db' => $this->db,
'table' => $current_table['TABLE_NAME'],
]
);
// do not list the previous table's size info for a view
@ -789,7 +793,10 @@ class DatabaseStructureController extends DatabaseController
}
}
return [$approx_rows, $show_superscript];
return [
$approx_rows,
$show_superscript,
];
}
/**
@ -842,7 +849,10 @@ class DatabaseStructureController extends DatabaseController
);
}
return [$do, $ignored];
return [
$do,
$ignored,
];
}
/**
@ -1017,8 +1027,15 @@ class DatabaseStructureController extends DatabaseController
$table_is_view = true;
}
return [$current_table, $formatted_size, $unit, $formatted_overhead,
$overhead_unit, $overhead_size, $table_is_view, $sum_size
return [
$current_table,
$formatted_size,
$unit,
$formatted_overhead,
$overhead_unit,
$overhead_size,
$table_is_view,
$sum_size,
];
}
@ -1071,8 +1088,14 @@ class DatabaseStructureController extends DatabaseController
$overhead_size += $current_table['Data_free'];
}
}
return [$current_table, $formatted_size, $unit, $formatted_overhead,
$overhead_unit, $overhead_size, $sum_size
return [
$current_table,
$formatted_size,
$unit,
$formatted_overhead,
$overhead_unit,
$overhead_size,
$sum_size,
];
}
@ -1113,6 +1136,11 @@ class DatabaseStructureController extends DatabaseController
);
}
return [$current_table, $formatted_size, $unit, $sum_size];
return [
$current_table,
$formatted_size,
$unit,
$sum_size,
];
}
}

View File

@ -262,7 +262,7 @@ class ServerDatabasesController extends Controller
'SCHEMA_DATA_LENGTH',
'SCHEMA_INDEX_LENGTH',
'SCHEMA_LENGTH',
'SCHEMA_DATA_FREE'
'SCHEMA_DATA_FREE',
];
if (in_array($_REQUEST['sort_by'], $sort_by_whitelist)) {
$this->_sort_by = $_REQUEST['sort_by'];
@ -360,7 +360,10 @@ class ServerDatabasesController extends Controller
$column_order = [];
$column_order['DEFAULT_COLLATION_NAME'] = [
'disp_name' => __('Collation'),
'description_function' => [Charsets::class, 'getCollationDescr'],
'description_function' => [
Charsets::class,
'getCollationDescr',
],
'format' => 'string',
'footer' => '',
];

View File

@ -185,7 +185,7 @@ class ServerVariablesController extends Controller
'mb' => 2,
'mib' => 2,
'gb' => 3,
'gib' => 3
'gib' => 3,
];
$value = floatval($matches[1]) * pow(
1024,
@ -275,7 +275,7 @@ class ServerVariablesController extends Controller
return [
$formattedValue,
$isHtmlFormatted
$isHtmlFormatted,
];
}
@ -369,7 +369,7 @@ class ServerVariablesController extends Controller
'is_html_formatted' => $isHtmlFormatted,
'has_session_value' => $has_session_value,
'session_value' => isset($sessionFormattedValue)?$sessionFormattedValue:null,
'session_is_html_formated' => isset($sessionIsHtmlFormatted)?$sessionIsHtmlFormatted:null
'session_is_html_formated' => isset($sessionIsHtmlFormatted)?$sessionIsHtmlFormatted:null,
]);
}

View File

@ -105,7 +105,7 @@ class TableChartController extends TableController
'vendor/jqplot/plugins/jqplot.pointLabels.js',
'vendor/jqplot/plugins/jqplot.pieRenderer.js',
'vendor/jqplot/plugins/jqplot.enhancedPieLegendRenderer.js',
'vendor/jqplot/plugins/jqplot.highlighter.js'
'vendor/jqplot/plugins/jqplot.highlighter.js',
]
);
@ -154,7 +154,10 @@ class TableChartController extends TableController
$keys = array_keys($data[0]);
$numeric_types = ['int', 'real'];
$numeric_types = [
'int',
'real',
];
$numeric_column_count = 0;
foreach ($keys as $idx => $key) {
if (in_array($fields_meta[$idx]->type, $numeric_types)) {

View File

@ -120,7 +120,7 @@ class TableRelationController extends TableController
$this->response->getHeader()->getScripts()->addFiles(
[
'tbl_relation.js',
'indexes.js'
'indexes.js',
]
);

View File

@ -373,7 +373,7 @@ class TableSearchController extends TableController
'Browse' => Util::getIcon(
'b_browse',
__('Browse foreign values')
)
),
];
$column_names_hashes = [];
@ -724,7 +724,18 @@ class TableSearchController extends TableController
if (is_array($result)) {
/* Iterate over possible delimiters to get one */
$delimiters = ['/', '@', '#', '~', '!', '$', '%', '^', '&', '_'];
$delimiters = [
'/',
'@',
'#',
'~',
'!',
'$',
'%',
'^',
'&',
'_',
];
$found = false;
for ($i = 0, $l = count($delimiters); $i < $l; $i++) {
if (strpos($find, $delimiters[$i]) === false) {
@ -916,7 +927,7 @@ class TableSearchController extends TableController
'Browse' => Util::getIcon(
'b_browse',
__('Browse foreign values')
)
),
];
//Gets column's type and collation
$type = $this->_columnTypes[$column_index];

View File

@ -156,7 +156,7 @@ class TableStructureController extends TableController
$this->response->getHeader()->getScripts()->addFiles(
[
'tbl_structure.js',
'indexes.js'
'indexes.js',
]
);
@ -431,7 +431,10 @@ class TableStructureController extends TableController
}
$virtual = [
'VIRTUAL', 'PERSISTENT', 'VIRTUAL GENERATED', 'STORED GENERATED'
'VIRTUAL',
'PERSISTENT',
'VIRTUAL GENERATED',
'STORED GENERATED',
];
$data['Virtuality'] = '';
$data['Expression'] = '';
@ -483,7 +486,7 @@ class TableStructureController extends TableController
$this->response->addJSON(
'sql_data',
$this->template->render('preview_sql', [
'query_data' => $sql_query
'query_data' => $sql_query,
])
);
} else { // move column
@ -779,9 +782,14 @@ class TableStructureController extends TableController
protected function getMultipleFieldCommandType()
{
$types = [
'change', 'drop', 'primary',
'index', 'unique', 'spatial',
'fulltext', 'browse'
'change',
'drop',
'primary',
'index',
'unique',
'spatial',
'fulltext',
'browse',
];
foreach ($types as $type) {
@ -870,7 +878,8 @@ class TableStructureController extends TableController
{
$err_url = 'tbl_structure.php' . Url::getCommon(
[
'db' => $this->db, 'table' => $this->table
'db' => $this->db,
'table' => $this->table,
]
);
$regenerate = false;
@ -1173,9 +1182,15 @@ class TableStructureController extends TableController
}
$fields = [
'field_attribute', 'field_collation', 'field_comments',
'field_default_value', 'field_default_type', 'field_extra',
'field_length', 'field_null', 'field_type'
'field_attribute',
'field_collation',
'field_comments',
'field_default_value',
'field_default_type',
'field_extra',
'field_length',
'field_null',
'field_type',
];
foreach ($fields as $field) {
if ($_POST[$field][$i] != $_POST[$field . '_orig'][$i]) {
@ -1608,8 +1623,11 @@ class TableStructureController extends TableController
}
return [
$what, $query_type, $is_unset_submit_mult, $mult_btn,
$centralColsError
$what,
$query_type,
$is_unset_submit_mult,
$mult_btn,
$centralColsError,
];
}
}

View File

@ -314,7 +314,18 @@ class Core
{
/* List of PHP documentation translations */
$php_doc_languages = [
'pt_BR', 'zh', 'fr', 'de', 'it', 'ja', 'pl', 'ro', 'ru', 'fa', 'es', 'tr'
'pt_BR',
'zh',
'fr',
'de',
'it',
'ja',
'pl',
'ro',
'ru',
'fa',
'es',
'tr',
];
$lang = 'en';
@ -778,7 +789,11 @@ class Core
return false;
}
// We do not want these to be present
$blocked = ['user', 'pass', 'port'];
$blocked = [
'user',
'pass',
'port',
];
foreach ($blocked as $part) {
if (isset($arr[$part]) && strlen((string) $arr[$part]) != 0) {
return false;
@ -795,14 +810,17 @@ class Core
'demo.phpmyadmin.net',
'docs.phpmyadmin.net',
/* mysql.com domains */
'dev.mysql.com','bugs.mysql.com',
'dev.mysql.com',
'bugs.mysql.com',
/* mariadb domains */
'mariadb.org', 'mariadb.com',
'mariadb.org',
'mariadb.com',
/* php.net domains */
'php.net',
'secure.php.net',
/* Github domains*/
'github.com','www.github.com',
'github.com',
'www.github.com',
/* Percona domains */
'www.percona.com',
/* Following are doubtful ones. */

View File

@ -551,6 +551,9 @@ class CreateAddField
if (isset($_POST['preview_sql'])) {
Core::previewSQL($sqlQuery);
}
return [$this->dbi->tryQuery($sqlQuery), $sqlQuery];
return [
$this->dbi->tryQuery($sqlQuery),
$sqlQuery,
];
}
}

View File

@ -209,7 +209,7 @@ class Common
$retval[$ti][$c_name_i][$dtn_i] = [];
$retval[$ti][$c_name_i][$dtn_i][$con['DCN'][$i]] = [
0 => $con['STN'][$i],
1 => $con['SCN'][$i]
1 => $con['SCN'][$i],
];
}
$ti++;
@ -263,7 +263,7 @@ class Common
{
$retval = [
'j_tabs' => [],
'h_tabs' => []
'h_tabs' => [],
];
for ($i = 0, $cnt = count($GLOBALS['designer']['TABLE_NAME']); $i < $cnt; $i++) {
@ -587,7 +587,10 @@ class Common
if ($foreigner
&& isset($foreigner['constraint'])
) {
return [false, __('Error: relationship already exists.')];
return [
false,
__('Error: relationship already exists.'),
];
}
// note: in InnoDB, the index does not requires to be on a PRIMARY
// or UNIQUE key
@ -633,23 +636,32 @@ class Common
}
$upd_query .= ';';
if ($this->dbi->tryQuery($upd_query)) {
return [true, __('FOREIGN KEY relationship has been added.')];
return [
true,
__('FOREIGN KEY relationship has been added.'),
];
}
$error = $this->dbi->getError();
return [
false,
__('Error: FOREIGN KEY relationship could not be added!')
. "<br>" . $error
. "<br>" . $error,
];
}
return [false, __('Error: Missing index on column(s).')];
return [
false,
__('Error: Missing index on column(s).'),
];
}
// internal (pmadb) relation
if ($GLOBALS['cfgRelation']['relwork'] == false) {
return [false, __('Error: Relational features are disabled!')];
return [
false,
__('Error: Relational features are disabled!'),
];
}
// no need to recheck if the keys are primary or unique at this point,
@ -671,14 +683,17 @@ class Common
if ($this->relation->queryAsControlUser($q, false, DatabaseInterface::QUERY_STORE)
) {
return [true, __('Internal relationship has been added.')];
return [
true,
__('Internal relationship has been added.'),
];
}
$error = $this->dbi->getError(DatabaseInterface::CONNECT_CONTROL);
return [
false,
__('Error: Internal relationship could not be added!')
. "<br>" . $error
. "<br>" . $error,
];
}
@ -715,14 +730,17 @@ class Common
. '.' . Util::backquote($T2) . ' DROP FOREIGN KEY '
. Util::backquote($foreigner['constraint']) . ';';
if ($this->dbi->query($upd_query)) {
return [true, __('FOREIGN KEY relationship has been removed.')];
return [
true,
__('FOREIGN KEY relationship has been removed.'),
];
}
$error = $this->dbi->getError();
return [
false,
__('Error: FOREIGN KEY relationship could not be removed!')
. "<br>" . $error
. "<br>" . $error,
];
}
}
@ -748,11 +766,14 @@ class Common
$error = $this->dbi->getError(DatabaseInterface::CONNECT_CONTROL);
return [
false,
__('Error: Internal relationship could not be removed!') . "<br>" . $error
__('Error: Internal relationship could not be removed!') . "<br>" . $error,
];
}
return [true, __('Internal relationship has been removed.')];
return [
true,
__('Internal relationship has been removed.'),
];
}
/**
@ -769,7 +790,7 @@ class Common
$cfgDesigner = [
'user' => $GLOBALS['cfg']['Server']['user'],
'db' => $cfgRelation['db'],
'table' => $cfgRelation['designer_settings']
'table' => $cfgRelation['designer_settings'],
];
$success = true;

View File

@ -1496,7 +1496,7 @@ class Qbe
} // end for
return [
'where_clause_tables' => $where_clause_tables,
'where_clause_columns' => $where_clause_columns
'where_clause_columns' => $where_clause_columns,
];
}
@ -1958,19 +1958,31 @@ class Qbe
if (isset($unique_columns) && count($unique_columns) > 0) {
$candidate_columns = $unique_columns;
$needsort = 1;
return [$candidate_columns, $needsort];
return [
$candidate_columns,
$needsort,
];
} elseif (isset($index_columns) && count($index_columns) > 0) {
$candidate_columns = $index_columns;
$needsort = 1;
return [$candidate_columns, $needsort];
return [
$candidate_columns,
$needsort,
];
} elseif (isset($where_clause_columns) && count($where_clause_columns) > 0) {
$candidate_columns = $where_clause_columns;
$needsort = 0;
return [$candidate_columns, $needsort];
return [
$candidate_columns,
$needsort,
];
}
$candidate_columns = $search_tables;
$needsort = 0;
return [$candidate_columns, $needsort];
return [
$candidate_columns,
$needsort,
];
}
}

View File

@ -330,7 +330,7 @@ class Search
),
'3' => $this->searchTypes[3],
'4' => $this->searchTypes[4],
'5' => $this->searchTypes[5] . ' ' . Util::showMySQLDocu('Regexp')
'5' => $this->searchTypes[5] . ' ' . Util::showMySQLDocu('Regexp'),
];
return $this->template->render('database/search/main', [
'db' => $this->db,

View File

@ -449,7 +449,10 @@ class DatabaseInterface
. implode(
'\', \'',
array_map(
[$this, 'escapeString'],
[
$this,
'escapeString',
],
$table
)
)
@ -584,7 +587,10 @@ class DatabaseInterface
// comparison (if we are looking for the db Aa we don't want
// to find the db aa)
$this_databases = array_map(
[$this, 'escapeString'],
[
$this,
'escapeString',
],
$databases
);
@ -599,7 +605,10 @@ class DatabaseInterface
$tables = $this->fetchResult(
$sql,
['TABLE_SCHEMA', 'TABLE_NAME'],
[
'TABLE_SCHEMA',
'TABLE_NAME',
],
null,
$link
);
@ -652,7 +661,10 @@ class DatabaseInterface
. implode(
'\', \'',
array_map(
[$this, 'escapeString'],
[
$this,
'escapeString',
],
$table,
$link
)
@ -1027,7 +1039,10 @@ class DatabaseInterface
$GLOBALS['callback_sort_by'] = $sort_by;
usort(
$databases,
[self::class, '_usortComparisonCallback']
[
self::class,
'_usortComparisonCallback',
]
);
unset($GLOBALS['callback_sort_order'], $GLOBALS['callback_sort_by']);
@ -1977,7 +1992,7 @@ class DatabaseInterface
'PROCEDURE' => 'Create Procedure',
'FUNCTION' => 'Create Function',
'EVENT' => 'Create Event',
'VIEW' => 'Create View'
'VIEW' => 'Create View',
];
$query = 'SHOW CREATE ' . $which . ' '
. Util::backquote($db) . '.'
@ -2019,7 +2034,7 @@ class DatabaseInterface
. " FROM `information_schema`.`ROUTINES`"
. " WHERE `ROUTINE_SCHEMA` " . Util::getCollateForIS()
. " = '" . $GLOBALS['dbi']->escapeString($db) . "'";
if (Core::isValid($which, ['FUNCTION','PROCEDURE'])) {
if (Core::isValid($which, ['FUNCTION', 'PROCEDURE'])) {
$query .= " AND `ROUTINE_TYPE` = '" . $which . "'";
}
if (! empty($name)) {
@ -2266,7 +2281,10 @@ class DatabaseInterface
$error .= ' - ' . $error_message .
' (<a href="server_engines.php' .
Url::getCommon(
['engine' => 'InnoDB', 'page' => 'Status']
[
'engine' => 'InnoDB',
'page' => 'Status'
]
) . '">' . __('Details…') . '</a>)';
}
} else {
@ -2434,7 +2452,10 @@ class DatabaseInterface
public function getSystemSchemas(): array
{
$schemas = [
'information_schema', 'performance_schema', 'mysql', 'sys'
'information_schema',
'performance_schema',
'mysql',
'sys',
];
$systemSchemas = [];
foreach ($schemas as $schema) {
@ -2499,9 +2520,16 @@ class DatabaseInterface
// Share the settings if the host is same
if ($server['host'] == $cfg['Server']['host']) {
$shared = [
'port', 'socket', 'compress',
'ssl', 'ssl_key', 'ssl_cert', 'ssl_ca',
'ssl_ca_path', 'ssl_ciphers', 'ssl_verify',
'port',
'socket',
'compress',
'ssl',
'ssl_key',
'ssl_cert',
'ssl_ca',
'ssl_ca_path',
'ssl_ciphers',
'ssl_verify',
];
foreach ($shared as $item) {
if (isset($cfg['Server'][$item])) {
@ -2521,7 +2549,11 @@ class DatabaseInterface
}
} else {
if (is_null($server)) {
return [null, null, null];
return [
null,
null,
null,
];
}
if (isset($server['user'])) {
$user = $server['user'];
@ -2550,7 +2582,11 @@ class DatabaseInterface
$server['compress'] = false;
}
return [$user, $password, $server];
return [
$user,
$password,
$server,
];
}
/**

View File

@ -474,14 +474,22 @@ class DbiDummy implements DbiExtension
* Array of queries this "driver" supports
*/
$GLOBALS['dummy_queries'] = [
['query' => 'SELECT 1', 'result' => [['1']]],
[
'query' => 'SELECT 1',
'result' => [['1']],
],
[
'query' => 'SELECT CURRENT_USER();',
'result' => [['pma_test@localhost']],
],
[
'query' => "SHOW VARIABLES LIKE 'lower_case_table_names'",
'result' => [['lower_case_table_names', '1']],
'result' => [
[
'lower_case_table_names',
'1',
],
],
],
[
'query' => 'SELECT 1 FROM mysql.user LIMIT 1',
@ -535,20 +543,62 @@ class DbiDummy implements DbiExtension
. ' LIKE \'Innodb\\_buffer\\_pool\\_%\''
. ' OR Variable_name = \'Innodb_page_size\';',
'result' => [
['Innodb_buffer_pool_pages_data', 0],
['Innodb_buffer_pool_pages_dirty', 0],
['Innodb_buffer_pool_pages_flushed', 0],
['Innodb_buffer_pool_pages_free', 0],
['Innodb_buffer_pool_pages_misc', 0],
['Innodb_buffer_pool_pages_total', 4096],
['Innodb_buffer_pool_read_ahead_rnd', 0],
['Innodb_buffer_pool_read_ahead', 0],
['Innodb_buffer_pool_read_ahead_evicted', 0],
['Innodb_buffer_pool_read_requests', 64],
['Innodb_buffer_pool_reads', 32],
['Innodb_buffer_pool_wait_free', 0],
['Innodb_buffer_pool_write_requests', 64],
['Innodb_page_size', 16384],
[
'Innodb_buffer_pool_pages_data',
0,
],
[
'Innodb_buffer_pool_pages_dirty',
0,
],
[
'Innodb_buffer_pool_pages_flushed',
0,
],
[
'Innodb_buffer_pool_pages_free',
0,
],
[
'Innodb_buffer_pool_pages_misc',
0,
],
[
'Innodb_buffer_pool_pages_total',
4096,
],
[
'Innodb_buffer_pool_read_ahead_rnd',
0,
],
[
'Innodb_buffer_pool_read_ahead',
0,
],
[
'Innodb_buffer_pool_read_ahead_evicted',
0,
],
[
'Innodb_buffer_pool_read_requests',
64,
],
[
'Innodb_buffer_pool_reads',
32,
],
[
'Innodb_buffer_pool_wait_free',
0,
],
[
'Innodb_buffer_pool_write_requests',
64,
],
[
'Innodb_page_size',
16384,
],
],
],
[
@ -570,13 +620,19 @@ class DbiDummy implements DbiExtension
[
'query' => 'SHOW GLOBAL VARIABLES LIKE \'innodb_file_per_table\';',
'result' => [
['innodb_file_per_table', 'OFF'],
[
'innodb_file_per_table',
'OFF',
],
],
],
[
'query' => 'SHOW GLOBAL VARIABLES LIKE \'innodb_file_format\';',
'result' => [
['innodb_file_format', 'Antelope'],
[
'innodb_file_format',
'Antelope',
],
],
],
[
@ -592,7 +648,10 @@ class DbiDummy implements DbiExtension
[
'query' => 'SHOW SESSION VARIABLES LIKE \'FOREIGN_KEY_CHECKS\';',
'result' => [
['foreign_key_checks', 'ON'],
[
'foreign_key_checks',
'ON',
],
],
],
[
@ -619,8 +678,22 @@ class DbiDummy implements DbiExtension
'Extra',
],
'result' => [
['i', 'int(11)', 'NO', 'PRI', 'NULL', 'auto_increment'],
['o', 'int(11)', 'NO', 'MUL', 'NULL', ''],
[
'i',
'int(11)',
'NO',
'PRI',
'NULL',
'auto_increment',
],
[
'o',
'int(11)',
'NO',
'MUL',
'NULL',
'',
],
],
],
[
@ -638,8 +711,22 @@ class DbiDummy implements DbiExtension
'Extra',
],
'result' => [
['i', 'int(11)', 'NO', 'PRI', 'NULL', 'auto_increment'],
['o', 'int(11)', 'NO', 'MUL', 'NULL', ''],
[
'i',
'int(11)',
'NO',
'PRI',
'NULL',
'auto_increment',
],
[
'o',
'int(11)',
'NO',
'MUL',
'NULL',
'',
],
],
],
[
@ -694,8 +781,14 @@ class DbiDummy implements DbiExtension
'Description',
],
'result' => [
['utf8', 'UTF-8 Unicode'],
['latin1', 'cp1252 West European'],
[
'utf8',
'UTF-8 Unicode',
],
[
'latin1',
'cp1252 West European',
],
],
],
[
@ -708,9 +801,21 @@ class DbiDummy implements DbiExtension
'Default',
],
'result' => [
['utf8', 'utf8_general_ci','Yes'],
['utf8', 'utf8_bin', ''],
['latin1', 'latin1_swedish_ci', 'Yes'],
[
'utf8',
'utf8_general_ci',
'Yes',
],
[
'utf8',
'utf8_bin',
'',
],
[
'latin1',
'latin1_swedish_ci',
'Yes',
],
],
],
[
@ -737,8 +842,22 @@ class DbiDummy implements DbiExtension
'input_transformation_options',
],
'result' => [
['o', 'text/plain', 'sql', '', 'regex', '/pma/i'],
['col', 't', 'o/p', '', 'i/p', ''],
[
'o',
'text/plain',
'sql',
'',
'regex',
'/pma/i',
],
[
'col',
't',
'o/p',
'',
'i/p',
'',
],
],
],
[
@ -1163,8 +1282,14 @@ class DbiDummy implements DbiExtension
[
'query' => "SHOW FULL TABLES FROM `default` WHERE `Table_type`='BASE TABLE'",
'result' => [
["test1", "BASE TABLE"],
["test2", "BASE TABLE"],
[
"test1",
"BASE TABLE",
],
[
"test2",
"BASE TABLE",
],
],
],
[
@ -1207,28 +1332,28 @@ class DbiDummy implements DbiExtension
[
'query' => 'DELETE FROM `mysql`.`db` WHERE `host` = "" '
. 'AND `Db` = "" AND `User` = ""',
'result' => true
'result' => true,
],
[
'query' => 'DELETE FROM `mysql`.`columns_priv` WHERE '
. '`host` = "" AND `Db` = "" AND `User` = ""',
'result' => true
'result' => true,
],
[
'query' => 'DELETE FROM `mysql`.`tables_priv` WHERE '
. '`host` = "" AND `Db` = "" AND `User` = "" AND Table_name = ""',
'result' => true
'result' => true,
],
[
'query' => 'DELETE FROM `mysql`.`procs_priv` WHERE '
. '`host` = "" AND `Db` = "" AND `User` = "" AND `Routine_name` = "" '
. 'AND `Routine_type` = ""',
'result' => true
'result' => true,
],
[
'query' => 'SELECT `plugin` FROM `mysql`.`user` WHERE '
. '`User` = "pma_username" AND `Host` = "pma_hostname" LIMIT 1',
'result' => []
'result' => [],
],
[
'query' => 'SELECT @@default_authentication_plugin',
@ -1363,7 +1488,7 @@ class DbiDummy implements DbiExtension
'3844432963',
'row_format=REDUNDANT',
'Test comment for "table1" in \'pma_test\'',
]
],
],
],
[
@ -1410,7 +1535,7 @@ class DbiDummy implements DbiExtension
'3844432963',
'row_format=REDUNDANT',
'Test comment for "table1" in \'pma_test\'',
]
],
],
],
[
@ -1420,7 +1545,7 @@ class DbiDummy implements DbiExtension
'BIN_NAME' => 'pma_test',
'DEFAULT_COLLATION_NAME' => 'utf8mb4_general_ci',
'SCHEMA_NAME' => 'pma_test',
]
],
],
],
[
@ -1489,7 +1614,7 @@ class DbiDummy implements DbiExtension
'COLUMN_NAME' => 'idtable2',
'REFERENCED_TABLE_NAME' => 'table1',
'REFERENCED_COLUMN_NAME' => 'idtable1',
]
],
],
],

View File

@ -618,7 +618,10 @@ class Export
// Empty row for javascript manipulations
$result .= '</tbody><tfoot class="hide">' . $template->render([
'type' => '', 'name' => '', 'field' => 'aliases_new', 'value' => ''
'type' => '',
'name' => '',
'field' => 'aliases_new',
'value' => '',
]) . '</tfoot>';
return $result . '</table>';
@ -681,7 +684,7 @@ class Export
'libraries/classes/Plugins/Export/',
[
'export_type' => $exportType,
'single_table' => isset($GLOBALS['single_table'])
'single_table' => isset($GLOBALS['single_table']),
]
);

View File

@ -48,7 +48,7 @@ class ImportAjax
//"session",
"progress",
"apc",
"noplugin"
"noplugin",
];
// select available plugin
@ -63,7 +63,11 @@ class ImportAjax
break;
}
}
return [$SESSION_KEY, $upload_id, $plugins];
return [
$SESSION_KEY,
$upload_id,
$plugins,
];
}
/**

View File

@ -268,51 +268,51 @@ class Results
$json_highlighting_data = [
'libraries/classes/Plugins/Transformations/Output/Text_Plain_Json.php',
'PhpMyAdmin\Plugins\Transformations\Output\Text_Plain_Json',
'Text_Plain'
'Text_Plain',
];
$sql_highlighting_data = [
'libraries/classes/Plugins/Transformations/Output/Text_Plain_Sql.php',
'PhpMyAdmin\Plugins\Transformations\Output\Text_Plain_Sql',
'Text_Plain'
'Text_Plain',
];
$blob_sql_highlighting_data = [
'libraries/classes/Plugins/Transformations/Output/Text_Octetstream_Sql.php',
'PhpMyAdmin\Plugins\Transformations\Output\Text_Octetstream_Sql',
'Text_Octetstream'
'Text_Octetstream',
];
$link_data = [
'libraries/classes/Plugins/Transformations/Text_Plain_Link.php',
'PhpMyAdmin\Plugins\Transformations\Text_Plain_Link',
'Text_Plain'
'Text_Plain',
];
$this->transformation_info = [
'information_schema' => [
'events' => [
'event_definition' => $sql_highlighting_data
'event_definition' => $sql_highlighting_data,
],
'processlist' => [
'info' => $sql_highlighting_data
'info' => $sql_highlighting_data,
],
'routines' => [
'routine_definition' => $sql_highlighting_data
'routine_definition' => $sql_highlighting_data,
],
'triggers' => [
'action_statement' => $sql_highlighting_data
'action_statement' => $sql_highlighting_data,
],
'views' => [
'view_definition' => $sql_highlighting_data
'view_definition' => $sql_highlighting_data,
]
],
'mysql' => [
'event' => [
'body' => $blob_sql_highlighting_data,
'body_utf8' => $blob_sql_highlighting_data
'body_utf8' => $blob_sql_highlighting_data,
],
'general_log' => [
'argument' => $sql_highlighting_data
'argument' => $sql_highlighting_data,
],
'help_category' => [
'url' => $link_data
'url' => $link_data,
],
'help_topic' => [
'example' => $sql_highlighting_data,
@ -325,7 +325,7 @@ class Results
'body_utf8' => $blob_sql_highlighting_data
],
'slow_log' => [
'sql_text' => $sql_highlighting_data
'sql_text' => $sql_highlighting_data,
]
]
];
@ -336,12 +336,12 @@ class Results
$relDb = &$this->transformation_info[$cfgRelation['db']];
if (! empty($cfgRelation['history'])) {
$relDb[$cfgRelation['history']] = [
'sqlquery' => $sql_highlighting_data
'sqlquery' => $sql_highlighting_data,
];
}
if (! empty($cfgRelation['bookmark'])) {
$relDb[$cfgRelation['bookmark']] = [
'query' => $sql_highlighting_data
'query' => $sql_highlighting_data,
];
}
if (! empty($cfgRelation['tracking'])) {
@ -352,37 +352,37 @@ class Results
}
if (! empty($cfgRelation['favorite'])) {
$relDb[$cfgRelation['favorite']] = [
'tables' => $json_highlighting_data
'tables' => $json_highlighting_data,
];
}
if (! empty($cfgRelation['recent'])) {
$relDb[$cfgRelation['recent']] = [
'tables' => $json_highlighting_data
'tables' => $json_highlighting_data,
];
}
if (! empty($cfgRelation['savedsearches'])) {
$relDb[$cfgRelation['savedsearches']] = [
'search_data' => $json_highlighting_data
'search_data' => $json_highlighting_data,
];
}
if (! empty($cfgRelation['designer_settings'])) {
$relDb[$cfgRelation['designer_settings']] = [
'settings_data' => $json_highlighting_data
'settings_data' => $json_highlighting_data,
];
}
if (! empty($cfgRelation['table_uiprefs'])) {
$relDb[$cfgRelation['table_uiprefs']] = [
'prefs' => $json_highlighting_data
'prefs' => $json_highlighting_data,
];
}
if (! empty($cfgRelation['userconfig'])) {
$relDb[$cfgRelation['userconfig']] = [
'config_data' => $json_highlighting_data
'config_data' => $json_highlighting_data,
];
}
if (! empty($cfgRelation['export_templates'])) {
$relDb[$cfgRelation['export_templates']] = [
'template_data' => $json_highlighting_data
'template_data' => $json_highlighting_data,
];
}
}
@ -703,7 +703,10 @@ class Results
}
} // end if (3)
return [$displayParts, $the_total];
return [
$displayParts,
$the_total,
];
} // end of the 'setDisplayPartsAndTotal()' function
@ -845,7 +848,10 @@ class Results
$table_navigation_html .= '</form>'
. '</td>';
}
return [$table_navigation_html, $nbTotalPage];
return [
$table_navigation_html,
$nbTotalPage,
];
}
/**
@ -1165,7 +1171,7 @@ class Results
'50' => 50,
'100' => 100,
'250' => 250,
'500' => 500
'500' => 500,
];
return $this->template->render('display/results/additional_fields', [
@ -1449,7 +1455,10 @@ class Results
}
}
return [$unsorted_sql_query, $drop_down_html];
return [
$unsorted_sql_query,
$drop_down_html,
];
} // end of the '_getUnsortedSqlAndSortByKeyDropDown()' function
/**
@ -1615,7 +1624,10 @@ class Results
$this->__set('display_params', $display_params);
return [$colspan, $button_html];
return [
$colspan,
$button_html,
];
} // end of the '_getFieldVisibilityParams()' function
@ -1781,7 +1793,7 @@ class Results
'table' => $this->__get('table'),
'sql_query' => $this->__get('sql_query'),
'goto' => $this->__get('goto'),
'full_text_button' => 1
'full_text_button' => 1,
];
if ($_SESSION['tmpval']['pftext'] == self::DISPLAY_FULL_TEXT) {
@ -1960,7 +1972,10 @@ class Results
$comments
);
return [$order_link, $sorted_header_html];
return [
$order_link,
$sorted_header_html,
];
} // end of the '_getOrderLinkAndSortedHeaderHtml()' function
/**
@ -2105,7 +2120,11 @@ class Results
if (empty($order_img)) {
$order_img = '';
}
return [$single_sort_order, $sort_order, $order_img];
return [
$single_sort_order,
$sort_order,
$order_img,
];
}
/**
@ -2209,27 +2228,42 @@ class Results
$order_img = ' ' . Util::getImage(
's_desc',
__('Descending'),
['class' => "soimg", 'title' => '']
[
'class' => "soimg",
'title' => '',
]
);
$order_img .= ' ' . Util::getImage(
's_asc',
__('Ascending'),
['class' => "soimg hide", 'title' => '']
[
'class' => "soimg hide",
'title' => '',
]
);
} else {
$sort_order .= ' DESC';
$order_img = ' ' . Util::getImage(
's_asc',
__('Ascending'),
['class' => "soimg", 'title' => '']
[
'class' => "soimg",
'title' => '',
]
);
$order_img .= ' ' . Util::getImage(
's_desc',
__('Descending'),
['class' => "soimg hide", 'title' => '']
[
'class' => "soimg hide",
'title' => '',
]
);
}
return [$sort_order, $order_img];
return [
$sort_order,
$order_img,
];
} // end of the '_getSortingUrlParams()' function
@ -2254,7 +2288,7 @@ class Results
$multi_order_url
) {
$order_link_params = [
'class' => 'sortlink'
'class' => 'sortlink',
];
$order_link_content = htmlspecialchars($fields_meta->name);
@ -3018,7 +3052,10 @@ class Results
: false;
// Wrap MIME-transformations. [MIME]
$default_function = [Core::class, 'mimeDefaultFunction']; // default_function
$default_function = [
Core::class,
'mimeDefaultFunction',
]; // default_function
$transformation_plugin = $default_function;
$transform_options = [];
@ -3042,11 +3079,9 @@ class Results
$transform_options = $this->transformations->getOptions(
isset(
$mime_map[$orgFullColName]
['transformation_options']
$mime_map[$orgFullColName]['transformation_options']
)
? $mime_map[$orgFullColName]
['transformation_options']
? $mime_map[$orgFullColName]['transformation_options']
: ''
);
@ -3069,10 +3104,8 @@ class Results
&& (trim($row[$i]) != '')
&& ! $_SESSION['tmpval']['hide_transformation']
) {
include_once $this->transformation_info
[$dbLower][$tblLower][$nameLower][0];
$transformation_plugin = new $this->transformation_info
[$dbLower][$tblLower][$nameLower][1](null);
include_once $this->transformation_info[$dbLower][$tblLower][$nameLower][0];
$transformation_plugin = new $this->transformation_info[$dbLower][$tblLower][$nameLower][1](null);
$transform_options = $this->transformations->getOptions(
isset($mime_map[$orgFullColName]['transformation_options'])
@ -3083,9 +3116,7 @@ class Results
$meta->mimetype = str_replace(
'_',
'/',
$this->transformation_info[$dbLower]
[mb_strtolower($meta->orgtable)]
[mb_strtolower($meta->orgname)][2]
$this->transformation_info[$dbLower][mb_strtolower($meta->orgtable)][mb_strtolower($meta->orgname)][2]
);
}
@ -3104,7 +3135,7 @@ class Results
$transform_options = [
0 => $linking_url,
2 => true
2 => true,
];
$meta->mimetype = str_replace(
@ -3138,7 +3169,7 @@ class Results
'db' => $this->__get('db'),
'table' => $meta->orgtable,
'where_clause' => $whereClauseMap[$row_no][$meta->orgtable],
'transform_key' => $meta->orgname
'transform_key' => $meta->orgname,
];
if (! empty($sql_query)) {
@ -3240,10 +3271,7 @@ class Results
{
$linking_url_params = [];
$link_relations = $GLOBALS['special_schema_links']
[mb_strtolower($this->__get('db'))]
[mb_strtolower($this->__get('table'))]
[$field_name];
$link_relations = $GLOBALS['special_schema_links'][mb_strtolower($this->__get('db'))][mb_strtolower($this->__get('table'))][$field_name];
if (! is_array($link_relations['link_param'])) {
$linking_url_params[$link_relations['link_param']] = $column_value;
@ -3380,7 +3408,10 @@ class Results
$col_visib = false;
}
return [$col_order, $col_visib];
return [
$col_order,
$col_visib,
];
} // end of the '_getColumnParams()' function
@ -3478,7 +3509,13 @@ class Results
$edit_anchor_class .= ' nonunique';
}
return [$edit_url, $copy_url, $edit_str, $copy_str, $edit_anchor_class];
return [
$edit_url,
$copy_url,
$edit_str,
$copy_str,
$edit_anchor_class,
];
} // end of the '_getModifiedLinks()' function
@ -3566,7 +3603,11 @@ class Results
$del_url = $del_str = $js_conf = null;
}
return [$del_url, $del_str, $js_conf];
return [
$del_url,
$del_str,
$js_conf,
];
} // end of the '_getDeleteAndKillLinks()' function
@ -4190,7 +4231,8 @@ class Results
if (Core::isValid(
$_REQUEST['pftext'],
[
self::DISPLAY_PARTIAL_TEXT, self::DISPLAY_FULL_TEXT
self::DISPLAY_PARTIAL_TEXT,
self::DISPLAY_FULL_TEXT,
]
)
) {
@ -4203,7 +4245,8 @@ class Results
if (Core::isValid(
$_REQUEST['relational_display'],
[
self::RELATIONAL_KEY, self::RELATIONAL_DISPLAY_COLUMN
self::RELATIONAL_KEY,
self::RELATIONAL_DISPLAY_COLUMN,
]
)
) {
@ -4219,8 +4262,9 @@ class Results
if (Core::isValid(
$_REQUEST['geoOption'],
[
self::GEOMETRY_DISP_WKT, self::GEOMETRY_DISP_WKB,
self::GEOMETRY_DISP_GEOM
self::GEOMETRY_DISP_WKT,
self::GEOMETRY_DISP_WKB,
self::GEOMETRY_DISP_GEOM,
]
)
) {
@ -4486,7 +4530,7 @@ class Results
$this->__get('table'),
$fields_meta[1]->name,
'',
$this->__get('db')
$this->__get('db'),
];
}
} // end if
@ -4585,7 +4629,10 @@ class Results
}
}
return [$pos_next, $pos_prev];
return [
$pos_next,
$pos_prev,
];
} // end of the '_getOffsets()' function
@ -4645,7 +4692,10 @@ class Results
$row = $GLOBALS['dbi']->fetchRow($dt_result);
// initializing default arguments
$default_function = [Core::class, 'mimeDefaultFunction'];
$default_function = [
Core::class,
'mimeDefaultFunction',
];
$transformation_plugin = $default_function;
$transform_options = [];
@ -4859,7 +4909,7 @@ class Results
$rel['foreign_table'],
$rel['foreign_field'],
$display_field,
$rel['foreign_db']
$rel['foreign_db'],
];
} else {
foreach ($rel as $key => $one_key) {
@ -4877,7 +4927,7 @@ class Results
$display_field,
isset($one_key['ref_db_name'])
? $one_key['ref_db_name']
: $GLOBALS['db']
: $GLOBALS['db'],
];
}
}
@ -5964,6 +6014,10 @@ class Results
$truncated = false;
}
return [$truncated, $str, $original_length];
return [
$truncated,
$str,
$original_length,
];
}
}

View File

@ -67,10 +67,26 @@ class Encoding
* @var array
*/
private static $_enginemap = [
'iconv' => ['iconv', self::ENGINE_ICONV, 'iconv'],
'recode' => ['recode_string', self::ENGINE_RECODE, 'recode'],
'mb' => ['mb_convert_encoding', self::ENGINE_MB, 'mbstring'],
'none' => ['isset', self::ENGINE_NONE, ''],
'iconv' => [
'iconv',
self::ENGINE_ICONV,
'iconv',
],
'recode' => [
'recode_string',
self::ENGINE_RECODE,
'recode',
],
'mb' => [
'mb_convert_encoding',
self::ENGINE_MB,
'mbstring',
],
'none' => [
'isset',
self::ENGINE_NONE,
'',
],
];
/**
@ -79,7 +95,9 @@ class Encoding
* @var array
*/
private static $_engineorder = [
'iconv', 'mb', 'recode',
'iconv',
'mb',
'recode',
];
/**

View File

@ -131,7 +131,12 @@ class Error extends Message
{
$result = [];
$members = ['line', 'function', 'class', 'type'];
$members = [
'line',
'function',
'class',
'type',
];
foreach ($backtrace as $idx => $step) {
/* Create new backtrace entry */
@ -415,7 +420,7 @@ class Error extends Message
'mysqli_connect',
'mysqli_real_connect',
'connect',
'_realConnect'
'_realConnect',
];
if (in_array($function, $include_functions)) {

View File

@ -203,7 +203,10 @@ class ErrorReport
}
$uri = $scriptName . "?" . $query;
return [$uri, $scriptName];
return [
$uri,
$scriptName,
];
}
/**

View File

@ -322,7 +322,10 @@ class Export
$filename .= '.zip';
$mime_type = 'application/zip';
}
return [$filename, $mime_type];
return [
$filename,
$mime_type,
];
}
/**
@ -375,7 +378,11 @@ class Export
);
$message->addParam($save_filename);
}
return [$save_filename, $message, $file_handle];
return [
$save_filename,
$message,
$file_handle,
];
}
/**
@ -489,7 +496,10 @@ class Export
$back_button .= 'db_export.php" data-post="' . Url::getCommon(['db' => $db], '');
} else {
$back_button .= 'tbl_export.php" data-post="' . Url::getCommon(
['db' => $db, 'table' => $table],
[
'db' => $db,
'table' => $table,
],
''
);
}
@ -531,7 +541,11 @@ class Export
. '<textarea name="sqldump" cols="50" rows="30" '
. 'id="textSQLDUMP" wrap="OFF">';
return [$html, $back_button, $refreshButton];
return [
$html,
$back_button,
$refreshButton,
];
}
/**

View File

@ -28,48 +28,137 @@ class Font
$charLists = [];
//ijl
$charLists[] = ["chars" => ["i", "j", "l"], "modifier" => 0.23];
$charLists[] = [
"chars" => [
"i",
"j",
"l",
], "modifier" => 0.23,
];
//f
$charLists[] = ["chars" => ["f"], "modifier" => 0.27];
$charLists[] = [
"chars" => ["f"],
"modifier" => 0.27,
];
//tI
$charLists[] = ["chars" => ["t", "I"], "modifier" => 0.28];
$charLists[] = [
"chars" => [
"t",
"I",
], "modifier" => 0.28,
];
//r
$charLists[] = ["chars" => ["r"], "modifier" => 0.34];
$charLists[] = [
"chars" => ["r"],
"modifier" => 0.34,
];
//1
$charLists[] = ["chars" => ["1"], "modifier" => 0.49];
$charLists[] = [
"chars" => ["1"],
"modifier" => 0.49,
];
//cksvxyzJ
$charLists[] = [
"chars" => ["c", "k", "s", "v", "x", "y", "z", "J"],
"modifier" => 0.5
"chars" => [
"c",
"k",
"s",
"v",
"x",
"y",
"z",
"J",
],
"modifier" => 0.5,
];
//abdeghnopquL023456789
$charLists[] = [
"chars" => [
"a", "b", "d", "e", "g", "h", "n", "o", "p", "q", "u", "L",
"0", "2", "3", "4", "5", "6", "7", "8", "9"
"a",
"b",
"d",
"e",
"g",
"h",
"n",
"o",
"p",
"q",
"u",
"L",
"0",
"2",
"3",
"4",
"5",
"6",
"7",
"8",
"9",
],
"modifier" => 0.56
"modifier" => 0.56,
];
//FTZ
$charLists[] = ["chars" => ["F", "T", "Z"], "modifier" => 0.61];
$charLists[] = [
"chars" => [
"F",
"T",
"Z",
], "modifier" => 0.61,
];
//ABEKPSVXY
$charLists[] = [
"chars" => ["A", "B", "E", "K", "P", "S", "V", "X", "Y"],
"modifier" => 0.67
"chars" => [
"A",
"B",
"E",
"K",
"P",
"S",
"V",
"X",
"Y",
],
"modifier" => 0.67,
];
//wCDHNRU
$charLists[] = [
"chars" => ["w", "C", "D", "H", "N", "R", "U"],
"modifier" => 0.73
"chars" => [
"w",
"C",
"D",
"H",
"N",
"R",
"U",
],
"modifier" => 0.73,
];
//GOQ
$charLists[] = ["chars" => ["G", "O", "Q"], "modifier" => 0.78];
$charLists[] = [
"chars" => [
"G",
"O",
"Q",
], "modifier" => 0.78,
];
//mM
$charLists[] = ["chars" => ["m", "M"], "modifier" => 0.84];
$charLists[] = [
"chars" => [
"m",
"M",
], "modifier" => 0.84,
];
//W
$charLists[] = ["chars" => ["W"], "modifier" => 0.95];
$charLists[] = [
"chars" => ["W"],
"modifier" => 0.95,
];
//" "
$charLists[] = ["chars" => [" "], "modifier" => 0.28];
$charLists[] = [
"chars" => [" "],
"modifier" => 0.28,
];
return $charLists;
}

View File

@ -151,7 +151,7 @@ class Footer
'db' => $db,
'table' => $table,
'server' => $GLOBALS['server'],
'target' => $target
'target' => $target,
];
// needed for server privileges tabs
if (isset($_GET['viewing_mode'])

View File

@ -199,7 +199,10 @@ abstract class GisGeometry
$wkt = $value;
}
return ['srid' => $srid, 'wkt' => $wkt];
return [
'srid' => $srid,
'wkt' => $wkt
];
}
/**
@ -241,7 +244,10 @@ abstract class GisGeometry
}
if (! $linear) {
$points_arr[] = [$x, $y];
$points_arr[] = [
$x,
$y,
];
} else {
$points_arr[] = $x;
$points_arr[] = $y;

View File

@ -151,7 +151,14 @@ class GisLineString extends GisGeometry
$red = hexdec(mb_substr($line_color, 1, 2));
$green = hexdec(mb_substr($line_color, 3, 2));
$blue = hexdec(mb_substr($line_color, 4, 2));
$line = ['width' => 1.5, 'color' => [$red, $green, $blue]];
$line = [
'width' => 1.5,
'color' => [
$red,
$green,
$blue,
],
];
// Trim to remove leading 'LINESTRING(' and trailing ')'
$linesrting

View File

@ -166,7 +166,14 @@ class GisMultiLineString extends GisGeometry
$red = hexdec(mb_substr($line_color, 1, 2));
$green = hexdec(mb_substr($line_color, 3, 2));
$blue = hexdec(mb_substr($line_color, 4, 2));
$line = ['width' => 1.5, 'color' => [$red, $green, $blue]];
$line = [
'width' => 1.5,
'color' => [
$red,
$green,
$blue,
],
];
// Trim to remove leading 'MULTILINESTRING((' and trailing '))'
$multilinestirng

View File

@ -148,7 +148,14 @@ class GisMultiPoint extends GisGeometry
$red = hexdec(mb_substr($point_color, 1, 2));
$green = hexdec(mb_substr($point_color, 3, 2));
$blue = hexdec(mb_substr($point_color, 4, 2));
$line = ['width' => 1.25, 'color' => [$red, $green, $blue]];
$line = [
'width' => 1.25,
'color' => [
$red,
$green,
$blue,
],
];
// Trim to remove leading 'MULTIPOINT(' and trailing ')'
$multipoint

View File

@ -144,7 +144,10 @@ class GisMultiPolygon extends GisGeometry
imagefilledpolygon($image, $points_arr, sizeof($points_arr) / 2, $color);
// mark label point if applicable
if (isset($label) && trim($label) != '' && $first_poly) {
$label_point = [$points_arr[2], $points_arr[3]];
$label_point = [
$points_arr[2],
$points_arr[3],
];
}
$first_poly = false;
}
@ -181,7 +184,11 @@ class GisMultiPolygon extends GisGeometry
$red = hexdec(mb_substr($fill_color, 1, 2));
$green = hexdec(mb_substr($fill_color, 3, 2));
$blue = hexdec(mb_substr($fill_color, 4, 2));
$color = [$red, $green, $blue];
$color = [
$red,
$green,
$blue,
];
// Trim to remove leading 'MULTIPOLYGON(((' and trailing ')))'
$multipolygon
@ -217,7 +224,10 @@ class GisMultiPolygon extends GisGeometry
$pdf->Polygon($points_arr, 'F*', [], $color, true);
// mark label point if applicable
if (isset($label) && trim($label) != '' && $first_poly) {
$label_point = [$points_arr[2], $points_arr[3]];
$label_point = [
$points_arr[2],
$points_arr[3],
];
}
$first_poly = false;
}

View File

@ -153,7 +153,14 @@ class GisPoint extends GisGeometry
$red = hexdec(mb_substr($point_color, 1, 2));
$green = hexdec(mb_substr($point_color, 3, 2));
$blue = hexdec(mb_substr($point_color, 4, 2));
$line = ['width' => 1.25, 'color' => [$red, $green, $blue]];
$line = [
'width' => 1.25,
'color' => [
$red,
$green,
$blue,
],
];
// Trim to remove leading 'POINT(' and trailing ')'
$point

View File

@ -162,7 +162,11 @@ class GisPolygon extends GisGeometry
$red = hexdec(mb_substr($fill_color, 1, 2));
$green = hexdec(mb_substr($fill_color, 3, 2));
$blue = hexdec(mb_substr($fill_color, 4, 2));
$color = [$red, $green, $blue];
$color = [
$red,
$green,
$blue,
];
// Trim to remove leading 'POLYGON((' and trailing '))'
$polygon = mb_substr(

View File

@ -111,7 +111,7 @@ class Import
}
$my_die[] = [
'sql' => $full,
'error' => $GLOBALS['dbi']->getError()
'error' => $GLOBALS['dbi']->getError(),
];
$msg .= __('Error');
@ -317,7 +317,10 @@ class Import
string $full
): ?array {
if (! empty($sql) || ! empty($full)) {
$import_run_buffer = ['sql' => $sql, 'full' => $full];
$import_run_buffer = [
'sql' => $sql,
'full' => $full,
];
return $import_run_buffer;
}
@ -348,7 +351,10 @@ class Import
$reload = true;
}
return [$db, $reload];
return [
$db,
$reload,
];
}
@ -581,7 +587,11 @@ class Import
$m = $curr_size - 1;
$d = $decPrecision;
return [$m, $d, ($m . "," . $d)];
return [
$m,
$d,
($m . "," . $d),
];
}
/**
@ -929,7 +939,10 @@ class Import
}
}
return [$types, $sizes];
return [
$types,
$sizes,
];
}
/**
@ -1043,7 +1056,7 @@ class Import
self::INT => "int",
self::DECIMAL => "decimal",
self::BIGINT => "bigint",
self::GEOMETRY => 'geometry'
self::GEOMETRY => 'geometry',
];
/* TODO: Do more checking here to make sure they really are matched */
@ -1262,7 +1275,7 @@ class Import
for ($i = 0; $i < $num_tables; ++$i) {
$params = [
'db' => (string) $db_name,
'table' => (string) $tables[$i][self::TBL_NAME]
'table' => (string) $tables[$i][self::TBL_NAME],
];
$tbl_url = 'sql.php' . Url::getCommon($params);
$tbl_struct_url = 'tbl_structure.php' . Url::getCommon($params);
@ -1444,14 +1457,14 @@ class Import
// URL to matched rows.
$_url_params = [
'db' => $GLOBALS['db'],
'sql_query' => $matched_row_query
'sql_query' => $matched_row_query,
];
$matched_rows_url = 'sql.php' . Url::getCommon($_url_params);
return [
'sql_query' => Util::formatSql($analyzed_sql_results['query']),
'matched_rows' => $matched_rows,
'matched_rows_url' => $matched_rows_url
'matched_rows_url' => $matched_rows_url,
];
}
@ -1700,7 +1713,7 @@ class Import
'TOKUDB',
'XTRADB',
'SEQUENCE',
'BDB'
'BDB',
];
// Query to check if table is 'Transactional'.

View File

@ -488,7 +488,7 @@ class Index
{
return [
'BTREE',
'HASH'
'HASH',
];
}

View File

@ -157,7 +157,12 @@ class InsertEdit
$found_unique_key = true;
}
}
return [$where_clauses, $result, $rows, $found_unique_key];
return [
$where_clauses,
$result,
$rows,
$found_unique_key,
];
}
/**
@ -232,7 +237,10 @@ class InsertEdit
DatabaseInterface::QUERY_STORE
);
$rows = array_fill(0, $GLOBALS['cfg']['InsertRows'], false);
return [$result, $rows];
return [
$result,
$rows,
];
}
/**
@ -343,15 +351,26 @@ class InsertEdit
$column['Field_title'] = $this->getColumnTitle($column, $comments_map);
$column['is_binary'] = $this->isColumn(
$column,
['binary', 'varbinary']
[
'binary',
'varbinary',
]
);
$column['is_blob'] = $this->isColumn(
$column,
['blob', 'tinyblob', 'mediumblob', 'longblob']
[
'blob',
'tinyblob',
'mediumblob',
'longblob',
]
);
$column['is_char'] = $this->isColumn(
$column,
['char', 'varchar']
[
'char',
'varchar',
]
);
list($column['pma_type'], $column['wrap'], $column['first_timestamp'])
@ -432,7 +451,11 @@ class InsertEdit
$column['wrap'] = ' nowrap';
break;
}
return [$column['pma_type'], $column['wrap'], $column['first_timestamp']];
return [
$column['pma_type'],
$column['wrap'],
$column['first_timestamp'],
];
}
/**
@ -867,7 +890,7 @@ class InsertEdit
'table' => $table,
'field' => $column['Field'],
'rownumber' => $rownumber,
'data' => $data
'data' => $data,
],
''
) . '">'
@ -1300,7 +1323,10 @@ class InsertEdit
}
$column['select_size'] = min(4, count($column['values']));
}
return [$column['values'], $column['select_size']];
return [
$column['values'],
$column['select_size'],
];
}
/**
@ -1549,7 +1575,7 @@ class InsertEdit
'tinyblob' => '256',
'blob' => '65536',
'mediumblob' => '16777216',
'longblob' => '4294967296' // yeah, really
'longblob' => '4294967296',// yeah, really
];
$this_field_max_size = $max_upload_size; // from PHP max
@ -1565,7 +1591,10 @@ class InsertEdit
if ($this_field_max_size > $biggest_max_file_size) {
$biggest_max_file_size = $this_field_max_size;
}
return [$html_output, $biggest_max_file_size];
return [
$html_output,
$biggest_max_file_size,
];
}
/**
@ -1647,7 +1676,10 @@ class InsertEdit
);
$virtual = [
'VIRTUAL', 'PERSISTENT', 'VIRTUAL GENERATED', 'STORED GENERATED'
'VIRTUAL',
'PERSISTENT',
'VIRTUAL GENERATED',
'STORED GENERATED',
];
if (in_array($column['Extra'], $virtual)) {
$html_output .= '<input type="hidden" name="virtual'
@ -2053,7 +2085,7 @@ class InsertEdit
$special_chars_encoded,
$special_chars,
$data,
$backup_field
$backup_field,
];
}
@ -2099,8 +2131,11 @@ class InsertEdit
$special_chars
);
return [
$real_null_value, $data, $special_chars,
$backup_field, $special_chars_encoded
$real_null_value,
$data,
$special_chars,
$backup_field,
$special_chars_encoded,
];
}
@ -2134,7 +2169,12 @@ class InsertEdit
}
$is_insertignore = isset($_POST['submit_type'])
&& $_POST['submit_type'] == 'insertignore';
return [$loop_array, $using_key, $is_insert, $is_insertignore];
return [
$loop_array,
$using_key,
$is_insert,
$is_insertignore,
];
}
/**
@ -2208,7 +2248,11 @@ class InsertEdit
*/
public function getGotoInclude($goto_include)
{
$valid_options = ['new_insert', 'same_insert', 'edit_next'];
$valid_options = [
'new_insert',
'same_insert',
'edit_next',
];
if (isset($_POST['after_insert'])
&& in_array($_POST['after_insert'], $valid_options)
) {
@ -2344,7 +2388,7 @@ class InsertEdit
$last_messages,
$warning_messages,
$error_messages,
$return_to_sql_query
$return_to_sql_query,
];
}
@ -2446,7 +2490,7 @@ class InsertEdit
. Util::backquote($foreigner['foreign_db'])
. '.' . Util::backquote($foreigner['foreign_table'])
. ' WHERE ' . Util::backquote($foreigner['foreign_field'])
. $where_comparison
. $where_comparison,
];
$output = '<a href="sql.php'
. Url::getCommon($_url_params) . '"' . $title . '>';
@ -2494,7 +2538,7 @@ class InsertEdit
'db' => $db,
'table' => $table,
'where_clause' => $_POST['where_clause'],
'transform_key' => $column_name
'transform_key' => $column_name,
];
$transform_options = $this->transformations->getOptions(
isset($transformation[$type . '_options'])
@ -2657,7 +2701,10 @@ class InsertEdit
. ' = ' . $current_value_as_an_array;
}
}
return [$query_values, $query_fields];
return [
$query_values,
$query_fields,
];
}
/**
@ -2909,9 +2956,14 @@ class InsertEdit
}
return [
$insert_mode, $where_clause, $where_clause_array, $where_clauses,
$result, $rows, $found_unique_key,
isset($after_insert) ? $after_insert : null
$insert_mode,
$where_clause,
$where_clause_array,
$where_clauses,
$result,
$rows,
$found_unique_key,
isset($after_insert) ? $after_insert : null,
];
}
@ -2949,7 +3001,7 @@ class InsertEdit
*/
$url_params = [
'db' => $db,
'sql_query' => $_POST['sql_query']
'sql_query' => $_POST['sql_query'],
];
if (preg_match('@^tbl_@', $GLOBALS['goto'])) {
@ -3290,7 +3342,7 @@ class InsertEdit
'db' => $db,
'table' => $table,
'transform_key' => $column['Field'],
'where_clause' => $where_clause
'where_clause' => $where_clause,
];
$transformation_options['wrapper_link']
= Url::getCommon($_url_params);
@ -3334,7 +3386,10 @@ class InsertEdit
$data,
$special_chars,
$foreignData,
[$table, $db],
[
$table,
$db,
],
$row_id,
$titles,
$text_dir,

View File

@ -285,7 +285,7 @@ class IpAllowDeny
// lookup table for some name shortcuts
$shortcuts = [
'all' => '0.0.0.0/0',
'localhost' => '127.0.0.1/8'
'localhost' => '127.0.0.1/8',
];
// Provide some useful shortcuts if server gives us address:

View File

@ -80,7 +80,10 @@ class Linter
}
$line = $lineNo;
}
return [$line, $pos - $lines[$line]];
return [
$line,
$pos - $lines[$line],
];
}
/**
@ -105,7 +108,7 @@ class Linter
'toLine' => 0,
'toColumn' => 0,
'severity' => 'warning',
]
],
];
}

View File

@ -269,7 +269,8 @@ class Menu
),
Url::getCommon(
[
'db' => $this->_db, 'table' => $this->_table
'db' => $this->_db,
'table' => $this->_table,
]
),
str_replace(' ', '&nbsp;', htmlspecialchars($this->_table)),
@ -356,7 +357,10 @@ class Menu
$tabs['structure']['text'] = __('Structure');
$tabs['structure']['active'] = in_array(
basename($GLOBALS['PMA_PHP_SELF']),
['tbl_structure.php', 'tbl_relation.php']
[
'tbl_structure.php',
'tbl_relation.php',
]
);
$tabs['sql']['icon'] = 'b_sql';
@ -368,7 +372,11 @@ class Menu
$tabs['search']['link'] = 'tbl_select.php';
$tabs['search']['active'] = in_array(
basename($GLOBALS['PMA_PHP_SELF']),
['tbl_select.php', 'tbl_zoom_select.php', 'tbl_find_replace.php']
[
'tbl_select.php',
'tbl_zoom_select.php',
'tbl_find_replace.php',
]
);
if (! $db_is_system_schema && (! $tbl_is_view || $updatable_view)) {
@ -597,7 +605,7 @@ class Menu
'server_status_monitor.php',
'server_status_queries.php',
'server_status_variables.php',
'server_status_processes.php'
'server_status_processes.php',
]
);
@ -607,7 +615,10 @@ class Menu
$tabs['rights']['text'] = __('User accounts');
$tabs['rights']['active'] = in_array(
basename($GLOBALS['PMA_PHP_SELF']),
['server_privileges.php', 'server_user_groups.php']
[
'server_privileges.php',
'server_user_groups.php',
]
);
$tabs['rights']['args']['viewing_mode'] = 'server';
}
@ -625,7 +636,10 @@ class Menu
$tabs['settings']['text'] = __('Settings');
$tabs['settings']['active'] = in_array(
basename($GLOBALS['PMA_PHP_SELF']),
['prefs_forms.php', 'prefs_manage.php']
[
'prefs_forms.php',
'prefs_manage.php',
]
);
if (! empty($binary_logs)) {

View File

@ -384,7 +384,7 @@ class MultSubmits
$runParts,
$executeQueryLater,
$sqlQuery,
$sqlQueryViews
$sqlQueryViews,
];
}
@ -642,6 +642,10 @@ class MultSubmits
$fullQueryViews = isset($fullQueryViews) ? $fullQueryViews : null;
return [$fullQuery, $reload, $fullQueryViews];
return [
$fullQuery,
$reload,
$fullQueryViews,
];
}
}

View File

@ -863,7 +863,10 @@ class NavigationTree
$children = $this->_tree->children;
usort(
$children,
['PhpMyAdmin\\Navigation\\NavigationTree', 'sortNode']
[
'PhpMyAdmin\\Navigation\\NavigationTree',
'sortNode',
]
);
$this->_setVisibility();
for ($i = 0, $nbChildren = count($children); $i < $nbChildren; $i++) {
@ -906,7 +909,10 @@ class NavigationTree
$children = $node->children;
usort(
$children,
['PhpMyAdmin\\Navigation\\NavigationTree', 'sortNode']
[
'PhpMyAdmin\\Navigation\\NavigationTree',
'sortNode',
]
);
for ($i = 0, $nbChildren = count($children); $i < $nbChildren; $i++) {
if ($i + 1 != $nbChildren) {
@ -1210,7 +1216,10 @@ class NavigationTree
$children = $node->children;
usort(
$children,
['PhpMyAdmin\\Navigation\\NavigationTree', 'sortNode']
[
'PhpMyAdmin\\Navigation\\NavigationTree',
'sortNode',
]
);
$buffer = '';
$extra_class = '';
@ -1302,7 +1311,10 @@ class NavigationTree
$children = $this->_tree->children;
usort(
$children,
['PhpMyAdmin\\Navigation\\NavigationTree', 'sortNode']
[
'PhpMyAdmin\\Navigation\\NavigationTree',
'sortNode',
]
);
$this->_setVisibility();
for ($i = 0, $nbChildren = count($children); $i < $nbChildren; $i++) {

View File

@ -355,7 +355,7 @@ class Normalization
'headText' => $headText,
'subText' => $subText,
'extra' => $extra,
'primary_key' => json_encode($pk)
'primary_key' => json_encode($pk),
];
}
@ -450,7 +450,7 @@ class Normalization
'headText' => $headText,
'subText' => $subText,
'extra' => $extra,
'primary_key' => $key
'primary_key' => $key,
];
}
@ -508,8 +508,9 @@ class Normalization
) . '</h3>';
if (count((array) $partialDependencies) == 1) {
return [
'legendText' => __('End of step'), 'headText' => $headText,
'queryError' => $error
'legendText' => __('End of step'),
'headText' => $headText,
'queryError' => $error,
];
}
$message = '';
@ -613,14 +614,19 @@ class Normalization
. (count($dependents) > 0 ? ', ' : '')
. htmlspecialchars(implode(', ', $dependents)) . ' )';
$newTables[$table][$tableName] = [
"pk" => $key, "nonpk" => implode(', ', $dependents)
"pk" => $key,
"nonpk" => implode(', ', $dependents),
];
$i++;
$tableName = 'table' . $i;
}
}
}
return ['html' => $html, 'newTables' => $newTables, 'success' => true];
return [
'html' => $html,
'newTables' => $newTables,
'success' => true
];
}
/**
@ -641,8 +647,9 @@ class Normalization
. '</h3>';
if (count((array) $newTables) == 0) {
return [
'legendText' => __('End of step'), 'headText' => $headText,
'queryError' => $error
'legendText' => __('End of step'),
'headText' => $headText,
'queryError' => $error,
];
}
$message = '';
@ -761,7 +768,10 @@ class Normalization
$query2 .= ' DROP ' . $repeatingColumn . ',';
}
$query2 = trim($query2, ',');
$queries = [$query1, $query2];
$queries = [
$query1,
$query2,
];
$this->dbi->selectDb($db);
foreach ($queries as $query) {
if (! $this->dbi->tryQuery($query)) {
@ -777,7 +787,8 @@ class Normalization
}
}
return [
'queryError' => $error, 'message' => $message
'queryError' => $error,
'message' => $message
];
}

View File

@ -162,7 +162,7 @@ EOT;
. ' manifest:full-path="meta.xml"/>'
. '<manifest:file-entry manifest:media-type="text/xml"'
. ' manifest:full-path="styles.xml"/>'
. '</manifest:manifest>'
. '</manifest:manifest>',
];
$name = [
@ -170,7 +170,7 @@ EOT;
'content.xml',
'meta.xml',
'styles.xml',
'META-INF/manifest.xml'
'META-INF/manifest.xml',
];
$zipExtension = new ZipExtension();

View File

@ -197,7 +197,7 @@ class Operations
$choices = [
'structure' => __('Structure only'),
'data' => __('Structure and data'),
'dataonly' => __('Data only')
'dataonly' => __('Data only'),
];
$pma_switch_to_new = isset($_SESSION['pma_switch_to_new']) && $_SESSION['pma_switch_to_new'];
@ -795,7 +795,11 @@ class Operations
public function duplicateBookmarks($_error, $db)
{
if (! $_error && $db != $_POST['newname']) {
$get_fields = ['user', 'label', 'query'];
$get_fields = [
'user',
'label',
'query',
];
$where_fields = ['dbase' => $db];
$new_fields = ['dbase' => $_POST['newname']];
Table::duplicateInfo(
@ -1274,7 +1278,7 @@ class Operations
],
'INNODB' => [
'COMPACT' => 'COMPACT',
'REDUNDANT' => 'REDUNDANT'
'REDUNDANT' => 'REDUNDANT',
]
];
@ -1333,7 +1337,7 @@ class Operations
$choices = [
'structure' => __('Structure only'),
'data' => __('Structure and data'),
'dataonly' => __('Data only')
'dataonly' => __('Data only'),
];
$html_output .= Util::getRadioFields(
@ -1484,7 +1488,7 @@ class Operations
$params = [
'sql_query' => 'ALTER TABLE '
. Util::backquote($GLOBALS['table'])
. ' ENGINE = InnoDB;'
. ' ENGINE = InnoDB;',
];
$html_output .= $this->getMaintainActionlink(
__('Defragment table'),
@ -1620,7 +1624,10 @@ class Operations
return '<li>' . Util::linkOrButton(
'sql.php' . Url::getCommon($url_params),
$link,
['id' => $htmlId, 'class' => 'ajax']
[
'id' => $htmlId,
'class' => 'ajax',
]
)
. Util::showMySQLDocu($syntax)
. '</li>';
@ -1642,7 +1649,7 @@ class Operations
'OPTIMIZE' => __('Optimize'),
'REBUILD' => __('Rebuild'),
'REPAIR' => __('Repair'),
'TRUNCATE' => __('Truncate')
'TRUNCATE' => __('Truncate'),
];
$partition_method = Partition::getPartitionMethod(
@ -1699,7 +1706,7 @@ class Operations
[
'sql_query' => 'ALTER TABLE '
. Util::backquote($GLOBALS['table'])
. ' REMOVE PARTITIONING;'
. ' REMOVE PARTITIONING;',
]
);
$html_output .= '<div class="clearfloat"><br>';
@ -1806,7 +1813,10 @@ class Operations
$sql_query .= ';';
$result = $this->dbi->query($sql_query);
return [$sql_query, $result];
return [
$sql_query,
$result,
];
}
/**
@ -1968,7 +1978,10 @@ class Operations
$result = $this->dbi->query($sql_query);
return [$sql_query, $result];
return [
$sql_query,
$result,
];
}
/**

View File

@ -90,7 +90,10 @@ class OutputBuffering
header('X-ob_mode: ' . $this->_mode);
}
register_shutdown_function(
[OutputBuffering::class, 'stop']
[
OutputBuffering::class,
'stop',
]
);
$this->_on = true;
}

View File

@ -75,6 +75,10 @@ class ParseAnalyze
$analyzed_sql_results['reload'] = $reload;
}
return [$analyzed_sql_results, $db, $table];
return [
$analyzed_sql_results,
$db,
$table,
];
}
}

View File

@ -134,13 +134,13 @@ class AuthenticationCookie extends AuthenticationPlugin
echo $this->template->render('login/header', [
'theme' => $GLOBALS['PMA_Theme'],
'add_class' => ' modal_form',
'session_expired' => 1
'session_expired' => 1,
]);
} else {
echo $this->template->render('login/header', [
'theme' => $GLOBALS['PMA_Theme'],
'add_class' => '',
'session_expired' => 0
'session_expired' => 0,
]);
}

View File

@ -157,7 +157,7 @@ class ExportJson extends ExportPlugin
$meta = [
'type' => 'database',
'name' => $db_alias
'name' => $db_alias,
];
return $this->export->outputHandler(

View File

@ -346,13 +346,19 @@ class ExportLatex extends ExportPlugin
'texEscape',
get_class($this),
],
['table' => $table_alias, 'database' => $db_alias]
[
'table' => $table_alias,
'database' => $db_alias,
]
)
. '} \\label{'
. Util::expandUserString(
$GLOBALS['latex_data_label'],
null,
['table' => $table_alias, 'database' => $db_alias]
[
'table' => $table_alias,
'database' => $db_alias,
]
)
. '} \\\\';
}
@ -381,7 +387,10 @@ class ExportLatex extends ExportPlugin
'texEscape',
get_class($this),
],
['table' => $table_alias, 'database' => $db_alias]
[
'table' => $table_alias,
'database' => $db_alias,
]
)
. '} \\\\ '
)
@ -553,13 +562,19 @@ class ExportLatex extends ExportPlugin
'texEscape',
get_class($this),
],
['table' => $table_alias, 'database' => $db_alias]
[
'table' => $table_alias,
'database' => $db_alias,
]
)
. '} \\label{'
. Util::expandUserString(
$GLOBALS['latex_structure_label'],
null,
['table' => $table_alias, 'database' => $db_alias]
[
'table' => $table_alias,
'database' => $db_alias,
]
)
. '} \\\\' . $crlf;
}
@ -574,7 +589,10 @@ class ExportLatex extends ExportPlugin
'texEscape',
get_class($this),
],
['table' => $table_alias, 'database' => $db_alias]
[
'table' => $table_alias,
'database' => $db_alias,
]
)
. '} \\\\ ' . $crlf;
}
@ -672,7 +690,16 @@ class ExportLatex extends ExportPlugin
*/
public static function texEscape($string)
{
$escape = ['$', '%', '{', '}', '&', '#', '_', '^'];
$escape = [
'$',
'%',
'{',
'}',
'&',
'#',
'_',
'^',
];
$cnt_escape = count($escape);
for ($k = 0; $k < $cnt_escape; $k++) {
$string = str_replace($escape[$k], '\\' . $escape[$k], $string);

View File

@ -140,7 +140,10 @@ class ExportPdf extends ExportPlugin
$pdf = $this->_getPdf();
$pdf->Open();
$attr = ['titleFontSize' => 18, 'titleText' => $pdf_report_title];
$attr = [
'titleFontSize' => 18,
'titleText' => $pdf_report_title
];
$pdf->setAttributes($attr);
$pdf->setTopMargin(30);
@ -229,7 +232,7 @@ class ExportPdf extends ExportPlugin
'dbAlias' => $db_alias,
'tableAlias' => $table_alias,
'aliases' => $aliases,
'purpose' => __('Dumping data')
'purpose' => __('Dumping data'),
];
$pdf->setAttributes($attr);
$pdf->mysqlReport($sql_query);

View File

@ -384,7 +384,7 @@ class ExportSql extends ExportPlugin
$leaf->setDoc(
[
'manual_MySQL_Database_Administration',
'insert_delayed'
'insert_delayed',
]
);
$subgroup->addProperty($leaf);
@ -2769,8 +2769,7 @@ class ExportSql extends ExportPlugin
// Column name.
if (! empty($field->type)) {
if (! empty($aliases[$old_database]['tables'][$old_table]['columns'][$field->name])) {
$field->name = $aliases[$old_database]['tables']
[$old_table]['columns'][$field->name];
$field->name = $aliases[$old_database]['tables'][$old_table]['columns'][$field->name];
$flag = true;
}
}
@ -2779,8 +2778,7 @@ class ExportSql extends ExportPlugin
if (! empty($field->key)) {
foreach ($field->key->columns as $key => $column) {
if (! empty($aliases[$old_database]['tables'][$old_table]['columns'][$column['name']])) {
$field->key->columns[$key]['name'] = $aliases[$old_database]
['tables'][$old_table]['columns'][$column['name']];
$field->key->columns[$key]['name'] = $aliases[$old_database]['tables'][$old_table]['columns'][$column['name']];
$flag = true;
}
}

View File

@ -202,8 +202,18 @@ class ExportYaml extends ExportPlugin
}
$record[$i] = str_replace(
['\\', '"', "\n", "\r"],
['\\\\', '\"', '\n', '\r'],
[
'\\',
'"',
"\n",
"\r",
],
[
'\\\\',
'\"',
'\n',
'\r',
],
$record[$i]
);
$buffer .= ' ' . $columns[$i] . ': "' . $record[$i] . '"' . $crlf;

View File

@ -631,29 +631,29 @@ class Pdf extends PdfLib
$column['Default'] = 'NULL';
}
}
$data [] = $column['Field'];
$data [] = $type;
$data [] = $column['Null'] == '' || $column['Null'] == 'NO'
$data[] = $column['Field'];
$data[] = $type;
$data[] = $column['Null'] == '' || $column['Null'] == 'NO'
? 'No'
: 'Yes';
$data [] = isset($column['Default']) ? $column['Default'] : '';
$data[] = isset($column['Default']) ? $column['Default'] : '';
$field_name = $column['Field'];
if ($do_relation && $have_rel) {
$data [] = isset($res_rel[$field_name])
$data[] = isset($res_rel[$field_name])
? $res_rel[$field_name]['foreign_table']
. ' (' . $res_rel[$field_name]['foreign_field']
. ')'
: '';
}
if ($do_comments) {
$data [] = isset($comments[$field_name])
$data[] = isset($comments[$field_name])
? $comments[$field_name]
: '';
}
if ($do_mime) {
$data [] = isset($mime_map[$field_name])
$data[] = isset($mime_map[$field_name])
? $mime_map[$field_name]['mimetype']
: '';
}

View File

@ -684,7 +684,11 @@ class ImportCsv extends AbstractImportCsv
$tbl_name = 'TBL_NAME';
}
$tables[] = [$tbl_name, $col_names, $rows];
$tables[] = [
$tbl_name,
$col_names,
$rows,
];
/* Obtain the best-fit MySQL types for each column */
$analyses = [];

View File

@ -219,7 +219,7 @@ class ImportMediawiki extends ImportPlugin
$cur_temp_table_headers = $cur_temp_line;
} else {
// Normal line, add it to the table
$cur_temp_table [] = $cur_temp_line;
$cur_temp_table[] = $cur_temp_line;
}
}
@ -261,13 +261,16 @@ class ImportMediawiki extends ImportPlugin
// Delete the beginning of the column, if there is one
$cell = trim($cell);
$col_start_chars = ["|", "!"];
$col_start_chars = [
"|",
"!",
];
foreach ($col_start_chars as $col_start_char) {
$cell = $this->_getCellContent($cell, $col_start_char);
}
// Add the cell to the row
$cur_temp_line [] = $cell;
$cur_temp_line[] = $cell;
} // foreach $cells
} else {
// If it's none of the above, then the current line has a bad
@ -310,11 +313,15 @@ class ImportMediawiki extends ImportPlugin
// Create the tables array to be used in Import::buildSql()
$tables = [];
$tables [] = [$table[0], $table[1], $table[2]];
$tables[] = [
$table[0],
$table[1],
$table[2],
];
// Obtain the best-fit MySQL types for each column
$analyses = [];
$analyses [] = $this->import->analyzeTable($tables[0]);
$analyses[] = $this->import->analyzeTable($tables[0]);
$this->_executeImportTables($tables, $analyses, $sql_data);
}
@ -355,7 +362,7 @@ class ImportMediawiki extends ImportPlugin
// If they are not set, generic names will be given (COL 1, COL 2, etc)
$num_cols = count($table_row);
for ($i = 0; $i < $num_cols; ++$i) {
$table_headers [$i] = 'COL ' . ($i + 1);
$table_headers[$i] = 'COL ' . ($i + 1);
}
}
}

View File

@ -312,7 +312,11 @@ class ImportOds extends ImportPlugin
$tables[] = [(string) $tbl_attr['name']];
/* Store the current sheet in the accumulator */
$rows[] = [(string) $tbl_attr['name'], $col_names, $tempRows];
$rows[] = [
(string) $tbl_attr['name'],
$col_names,
$tempRows,
];
$tempRows = [];
$col_names = [];
$max_cols = 0;

View File

@ -260,7 +260,13 @@ class ImportShp extends ImportPlugin
} else {
$table_name = 'TBL_NAME';
}
$tables = [[$table_name, $col_names, $rows]];
$tables = [
[
$table_name,
$col_names,
$rows,
],
];
// Use data from shape file to chose best-fit MySQL types for each column
$analyses = [];

View File

@ -268,7 +268,11 @@ class ImportXml extends ImportPlugin
$tempCells[] = (string) $v2;
}
$rows[] = [(string) $tbl_attr['name'], $tempRow, $tempCells];
$rows[] = [
(string) $tbl_attr['name'],
$tempRow,
$tempCells,
];
$tempRow = [];
$tempCells = [];

View File

@ -86,6 +86,9 @@ abstract class ImportPlugin
$options = null;
}
return [$db_name, $options];
return [
$db_name,
$options,
];
}
}

View File

@ -88,9 +88,17 @@ class RelationStatsDia
// left, right, position
$value = 12;
if ($pos != 0) {
return [$pos + $value + $pos, $pos + $value + $pos + 1, $pos];
return [
$pos + $value + $pos,
$pos + $value + $pos + 1,
$pos,
];
}
return [$pos + $value , $pos + $value + 1, $pos];
return [
$pos + $value,
$pos + $value + 1,
$pos,
];
}
/**

View File

@ -102,7 +102,7 @@ class TableStatsDia extends TableStats
$listOfColors = [
'FF0000',
'000099',
'00FF00'
'00FF00',
];
shuffle($listOfColors);
$this->tableColor = '#' . $listOfColors[0] . '';

View File

@ -702,7 +702,17 @@ class PdfRelationSchema extends ExportRelationSchema
$this->diagram->Cell($comments_width, 8, __('Comments'), 1, 0, 'C');
$this->diagram->Cell(45, 8, 'MIME', 1, 1, 'C');
$this->diagram->setWidths(
[25, 20, 20, 10, 20, 25, 45, $comments_width, 45]
[
25,
20,
20,
10,
20,
25,
45,
$comments_width,
45,
]
);
} else {
$this->diagram->Cell(20, 8, __('Column'), 1, 0, 'C');
@ -769,15 +779,14 @@ class PdfRelationSchema extends ExportRelationSchema
: ''),
(isset($mime_map) && isset($mime_map[$field_name])
? str_replace('_', '/', $mime_map[$field_name]['mimetype'])
: '')
: ''),
];
$links = [];
$links[0] = $this->diagram->PMA_links['RT'][$table][$field_name];
if ($foreigner
&& isset($this->diagram->PMA_links['doc'][$foreigner['foreign_table']][$foreigner['foreign_field']])
) {
$links[6] = $this->diagram->PMA_links['doc']
[$foreigner['foreign_table']][$foreigner['foreign_field']];
$links[6] = $this->diagram->PMA_links['doc'][$foreigner['foreign_table']][$foreigner['foreign_field']];
} else {
unset($links[6]);
}

View File

@ -72,12 +72,36 @@ class RelationStatsPdf extends RelationStats
$j = $j % 4;
$j++;
$case = [
[1, 0, 0],
[0, 1, 0],
[0, 0, 1],
[1, 1, 0],
[1, 0, 1],
[0, 1, 1]
[
1,
0,
0,
],
[
0,
1,
0,
],
[
0,
0,
1,
],
[
1,
1,
0,
],
[
1,
0,
1,
],
[
0,
1,
1,
],
];
list ($a, $b, $c) = $case[$d];
$e = (1 - ($j - 1) / 6);

View File

@ -114,8 +114,14 @@ abstract class ExternalTransformationsPlugin extends TransformationsPlugin
// needs PHP >= 4.3.0
$newstring = '';
$descriptorspec = [
0 => ["pipe", "r"],
1 => ["pipe", "w"],
0 => [
"pipe",
"r",
],
1 => [
"pipe",
"w",
],
];
$process = proc_open($program . ' ' . $options[1], $descriptorspec, $pipes);
if (is_resource($process)) {

View File

@ -40,7 +40,7 @@ abstract class OptionsPropertyGroup extends OptionsPropertyItem implements \Coun
) {
return;
}
$this->_properties [] = $property;
$this->_properties[] = $property;
}
/**

View File

@ -190,7 +190,7 @@ class RecentFavoriteTable
$html .= '<li class="warp_link">';
$recent_params = [
'db' => $table['db'],
'table' => $table['table']
'table' => $table['table'],
];
$recent_url = 'tbl_recent_favorite.php'
. Url::getCommon($recent_params);
@ -208,7 +208,7 @@ class RecentFavoriteTable
'db' => $table['db'],
'ajax_request' => true,
'favorite_table' => $table['table'],
'remove_favorite' => true
'remove_favorite' => true,
];
$fav_rm_url = 'db_structure.php'
. Url::getCommon($fav_params);
@ -222,7 +222,7 @@ class RecentFavoriteTable
$fav_params = [
'db' => $table['db'],
'table' => $table['table']
'table' => $table['table'],
];
$table_url = 'tbl_recent_favorite.php'
. Url::getCommon($fav_params);
@ -359,7 +359,7 @@ class RecentFavoriteTable
$params = [
'ajax_request' => true,
'favorite_table' => true,
'sync_favorite_tables' => true
'sync_favorite_tables' => true,
];
$url = 'db_structure.php' . Url::getCommon($params);
$retval = '<a class="hide" id="sync_favorite_tables"';
@ -375,7 +375,10 @@ class RecentFavoriteTable
*/
public static function getHtmlUpdateRecentTables()
{
$params = ['ajax_request' => true, 'recent_table' => true];
$params = [
'ajax_request' => true,
'recent_table' => true,
];
$url = 'index.php' . Url::getCommon($params);
$retval = '<a class="hide" id="update_recent_tables"';
$retval .= ' href="' . $url . '"></a>';

View File

@ -487,9 +487,15 @@ class Relation
$workToTable = [
'relwork' => 'relation',
'displaywork' => ['relation', 'table_info'],
'displaywork' => [
'relation',
'table_info',
],
'bookmarkwork' => 'bookmarktable',
'pdfwork' => ['table_coords', 'pdf_pages'],
'pdfwork' => [
'table_coords',
'pdf_pages',
],
'commwork' => 'column_info',
'mimework' => 'column_info',
'historywork' => 'history',
@ -498,7 +504,10 @@ class Relation
'uiprefswork' => 'table_uiprefs',
'trackingwork' => 'tracking',
'userconfigwork' => 'userconfig',
'menuswork' => ['users', 'usergroups'],
'menuswork' => [
'users',
'usergroups',
],
'navwork' => 'navigationhiding',
'savedsearcheswork' => 'savedsearches',
'centralcolumnswork' => 'central_columns',
@ -711,7 +720,7 @@ class Relation
// Check whether column_info table has input transformation columns
$new_cols = [
"input_transformation",
"input_transformation_options"
"input_transformation_options",
];
$query = 'SHOW COLUMNS FROM '
. Util::backquote($GLOBALS['cfg']['Server']['pmadb'])
@ -1834,7 +1843,10 @@ class Relation
$child_references = $this->dbi->fetchResult(
$rel_query,
['referenced_column_name', null]
[
'referenced_column_name',
null,
]
);
}
return $child_references;
@ -2155,7 +2167,10 @@ class Relation
$have_rel = false;
$res_rel = [];
} // end if
return [$res_rel, $have_rel];
return [
$res_rel,
$have_rel,
];
}
/**

View File

@ -432,7 +432,10 @@ class ReplicationGui
$html .= '<pre>server-id=' . time() . '</pre>';
$html .= $this->getHtmlForAddUserInputDiv(
['text' => __('User name:'), 'for' => "text_username"],
[
'text' => __('User name:'),
'for' => "text_username"
],
[
'type' => 'text',
'name' => 'username',
@ -444,18 +447,24 @@ class ReplicationGui
);
$html .= $this->getHtmlForAddUserInputDiv(
['text' => __('Password:'), 'for' => "text_pma_pw"],
[
'text' => __('Password:'),
'for' => "text_pma_pw"
],
[
'type' => 'password',
'name' => 'pma_pw',
'id' => 'text_pma_pw',
'title' => __('Password'),
'required' => 'required'
'required' => 'required',
]
);
$html .= $this->getHtmlForAddUserInputDiv(
['text' => __('Host:'), 'for' => "text_hostname"],
[
'text' => __('Host:'),
'for' => "text_hostname"
],
[
'type' => 'text',
'name' => 'hostname',
@ -467,7 +476,10 @@ class ReplicationGui
);
$html .= $this->getHtmlForAddUserInputDiv(
['text' => __('Port:'), 'for' => "text_port"],
[
'text' => __('Port:'),
'for' => "text_port"
],
[
'type' => 'number',
'name' => 'text_port',
@ -590,9 +602,12 @@ class ReplicationGui
}
// allow wrapping long table lists into multiple lines
$variables_wrap = [
'Replicate_Do_DB', 'Replicate_Ignore_DB',
'Replicate_Do_Table', 'Replicate_Ignore_Table',
'Replicate_Wild_Do_Table', 'Replicate_Wild_Ignore_Table'
'Replicate_Do_DB',
'Replicate_Ignore_DB',
'Replicate_Do_Table',
'Replicate_Ignore_Table',
'Replicate_Wild_Do_Table',
'Replicate_Wild_Ignore_Table',
];
if (in_array($variable, $variables_wrap)) {
$html .= htmlspecialchars(str_replace(
@ -690,7 +705,10 @@ class ReplicationGui
}
}
}
return [$username_length, $hostname_length];
return [
$username_length,
$hostname_length,
];
}
/**

View File

@ -436,7 +436,7 @@ class Response
[
'db' => Core::ifSetOr($GLOBALS['db'], ''),
'table' => Core::ifSetOr($GLOBALS['table'], ''),
'sql_query' => $query
'sql_query' => $query,
]
);
if (! empty($GLOBALS['focus_querywindow'])) {

View File

@ -329,7 +329,7 @@ class Events
'item_definition',
'item_preserve',
'item_comment',
'item_definer'
'item_definer',
];
foreach ($indices as $index) {
$retval[$index] = isset($_POST[$index]) ? $_POST[$index] : '';
@ -423,7 +423,7 @@ class Events
'item_ends',
'item_definition',
'item_definer',
'item_comment'
'item_comment',
];
foreach ($need_escape as $index) {
$item[$index] = htmlentities((string) $item[$index], ENT_QUOTES);

View File

@ -125,13 +125,13 @@ class Footer
0 => [
'label' => __('OFF'),
'value' => "SET GLOBAL event_scheduler=\"OFF\"",
'selected' => ($es_state != 'on')
'selected' => ($es_state != 'on'),
],
1 => [
'label' => __('ON'),
'value' => "SET GLOBAL event_scheduler=\"ON\"",
'selected' => ($es_state == 'on')
]
'selected' => ($es_state == 'on'),
],
];
// Generate output
$retval = "<!-- FOOTER LINKS START -->\n";

View File

@ -127,7 +127,7 @@ class Routines
/**
* Display a list of available routines
*/
if (! Core::isValid($type, ['FUNCTION','PROCEDURE'])) {
if (! Core::isValid($type, ['FUNCTION', 'PROCEDURE'])) {
$type = null;
}
$items = $this->dbi->getRoutines($db, $type);
@ -267,7 +267,10 @@ class Routines
if (! empty($_POST['editor_process_edit'])) {
$isProcOrFunc = in_array(
$_POST['item_original_type'],
['PROCEDURE', 'FUNCTION']
[
'PROCEDURE',
'FUNCTION',
]
);
if (! $isProcOrFunc) {
@ -451,7 +454,10 @@ class Routines
$errors
);
return [$errors, null];
return [
$errors,
null,
];
}
// Default value
@ -481,7 +487,10 @@ class Routines
$message = $this->flushPrivileges($resultAdjust);
return [[], $message];
return [
[],
$message,
];
}
/**
@ -536,7 +545,7 @@ class Routines
'item_returnopts_text',
'item_definition',
'item_comment',
'item_definer'
'item_definer',
];
foreach ($indices as $index) {
$retval[$index] = isset($_POST[$index]) ? $_POST[$index] : '';
@ -767,7 +776,7 @@ class Routines
'item_param_type' => [0 => ''],
'item_param_length' => [0 => ''],
'item_param_opts_num' => [0 => ''],
'item_param_opts_text' => [0 => '']
'item_param_opts_text' => [0 => ''],
];
} elseif (! empty($routine)) {
// regular row for routine editor
@ -879,7 +888,7 @@ class Routines
'item_returnlength',
'item_definition',
'item_definer',
'item_comment'
'item_comment',
];
foreach ($need_escape as $key => $index) {
$routine[$index] = htmlentities($routine[$index], ENT_QUOTES, 'UTF-8');
@ -1709,7 +1718,7 @@ class Routines
'Key' => '',
'Field' => '',
'Default' => '',
'first_timestamp' => false
'first_timestamp' => false,
];
$retval .= "<select name='funcs["
. $routine['item_param_name'][$i] . "]'>";

View File

@ -302,7 +302,7 @@ class Triggers
'item_action_timing',
'item_event_manipulation',
'item_definition',
'item_definer'
'item_definer',
];
foreach ($indices as $index) {
$retval[$index] = isset($_POST[$index]) ? $_POST[$index] : '';
@ -367,7 +367,7 @@ class Triggers
'item_original_name',
'item_name',
'item_definition',
'item_definer'
'item_definer',
];
foreach ($need_escape as $key => $index) {
$item[$index] = htmlentities($item[$index], ENT_QUOTES, 'UTF-8');

Some files were not shown because too many files have changed in this diff Show More