';
$output .= ThemeManager::getInstance()->getPrintPreviews();
$response->addHTML($output);
login/import_status.php 0000644 00000006607 15155311537 0011321 0 ustar 00 $value) {
// only copy session-prefixed data
if (substr($key, 0, strlen(UPLOAD_PREFIX))
== UPLOAD_PREFIX) {
$sessionupload[$key] = $value;
}
}
// PMA will kill all variables, so let's use a constant
define('SESSIONUPLOAD', serialize($sessionupload));
session_write_close();
// The cookie name is not good anymore since PR #15273
session_name('phpMyAdmin');
session_id($_COOKIE['phpMyAdmin']);
}
*/
define('PMA_MINIMUM_COMMON', 1);
require_once 'libraries/common.inc.php';
list(
$SESSION_KEY,
$upload_id,
$plugins
) = ImportAjax::uploadProgressSetup();
/*
if (defined('SESSIONUPLOAD')) {
// write sessionupload back into the loaded PMA session
$sessionupload = unserialize(SESSIONUPLOAD);
foreach ($sessionupload as $key => $value) {
$_SESSION[$key] = $value;
}
// remove session upload data that are not set anymore
foreach ($_SESSION as $key => $value) {
if (substr($key, 0, strlen(UPLOAD_PREFIX))
== UPLOAD_PREFIX
&& ! isset($sessionupload[$key])
) {
unset($_SESSION[$key]);
}
}
}
*/
// $_GET["message"] is used for asking for an import message
if (isset($_GET["message"]) && $_GET["message"]) {
// AJAX requests can't be cached!
Core::noCacheHeader();
header('Content-type: text/html');
// wait 0.3 sec before we check for $_SESSION variable,
// which is set inside import.php
usleep(300000);
$maximumTime = ini_get('max_execution_time');
$timestamp = time();
// wait until message is available
while ($_SESSION['Import_message']['message'] == null) {
// close session before sleeping
session_write_close();
// sleep
usleep(250000); // 0.25 sec
// reopen session
session_start();
if ((time() - $timestamp) > $maximumTime) {
$_SESSION['Import_message']['message'] = PhpMyAdmin\Message::error(
__('Could not load the progress of the import.')
)->getDisplay();
break;
}
}
echo $_SESSION['Import_message']['message'];
echo '' , "\n";
} else {
ImportAjax::status($_GET["id"]);
}
login/tbl_replace.php 0000644 00000041114 15155311537 0010650 0 ustar 00 selectDb($GLOBALS['db']);
/**
* Initializes some variables
*/
$goto_include = false;
$response = Response::getInstance();
$header = $response->getHeader();
$scripts = $header->getScripts();
$scripts->addFile('makegrid.js');
// Needed for generation of Inline Edit anchors
$scripts->addFile('sql.js');
$scripts->addFile('indexes.js');
$scripts->addFile('gis_data_editor.js');
$relation = new Relation();
$insertEdit = new InsertEdit($GLOBALS['dbi']);
// check whether insert row mode, if so include tbl_change.php
$insertEdit->isInsertRow();
$after_insert_actions = array('new_insert', 'same_insert', 'edit_next');
if (isset($_POST['after_insert'])
&& in_array($_POST['after_insert'], $after_insert_actions)
) {
$url_params['after_insert'] = $_POST['after_insert'];
if (isset($_POST['where_clause'])) {
foreach ($_POST['where_clause'] as $one_where_clause) {
if ($_POST['after_insert'] == 'same_insert') {
$url_params['where_clause'][] = $one_where_clause;
} elseif ($_POST['after_insert'] == 'edit_next') {
$insertEdit->setSessionForEditNext($one_where_clause);
}
}
}
}
//get $goto_include for different cases
$goto_include = $insertEdit->getGotoInclude($goto_include);
// Defines the url to return in case of failure of the query
$err_url = $insertEdit->getErrorUrl($url_params);
/**
* Prepares the update/insert of a row
*/
list($loop_array, $using_key, $is_insert, $is_insertignore)
= $insertEdit->getParamsForUpdateOrInsert();
$query = array();
$value_sets = array();
$func_no_param = array(
'CONNECTION_ID',
'CURRENT_USER',
'CURDATE',
'CURTIME',
'CURRENT_DATE',
'CURRENT_TIME',
'DATABASE',
'LAST_INSERT_ID',
'NOW',
'PI',
'RAND',
'SYSDATE',
'UNIX_TIMESTAMP',
'USER',
'UTC_DATE',
'UTC_TIME',
'UTC_TIMESTAMP',
'UUID',
'UUID_SHORT',
'VERSION',
);
$func_optional_param = array(
'RAND',
'UNIX_TIMESTAMP',
);
$gis_from_text_functions = array(
'GeomFromText',
'GeomCollFromText',
'LineFromText',
'MLineFromText',
'PointFromText',
'MPointFromText',
'PolyFromText',
'MPolyFromText',
);
if ($GLOBALS['dbi']->getVersion() >= 50600) {
$gis_from_text_functions = array(
'ST_GeomFromText',
'ST_GeomCollFromText',
'ST_LineFromText',
'ST_MLineFromText',
'ST_PointFromText',
'ST_MPointFromText',
'ST_PolyFromText',
'ST_MPolyFromText',
);
}
$gis_from_wkb_functions = array(
'GeomFromWKB',
'GeomCollFromWKB',
'LineFromWKB',
'MLineFromWKB',
'PointFromWKB',
'MPointFromWKB',
'PolyFromWKB',
'MPolyFromWKB',
);
//if some posted fields need to be transformed.
$mime_map = Transformations::getMIME($GLOBALS['db'], $GLOBALS['table']);
if ($mime_map === false) {
$mime_map = array();
}
$query_fields = array();
$insert_errors = array();
$row_skipped = false;
$unsaved_values = array();
foreach ($loop_array as $rownumber => $where_clause) {
// skip fields to be ignored
if (! $using_key && isset($_POST['insert_ignore_' . $where_clause])) {
continue;
}
// Defines the SET part of the sql query
$query_values = array();
// Map multi-edit keys to single-level arrays, dependent on how we got the fields
$multi_edit_columns
= isset($_POST['fields']['multi_edit'][$rownumber])
? $_POST['fields']['multi_edit'][$rownumber]
: array();
$multi_edit_columns_name
= isset($_POST['fields_name']['multi_edit'][$rownumber])
? $_POST['fields_name']['multi_edit'][$rownumber]
: array();
$multi_edit_columns_prev
= isset($_POST['fields_prev']['multi_edit'][$rownumber])
? $_POST['fields_prev']['multi_edit'][$rownumber]
: null;
$multi_edit_funcs
= isset($_POST['funcs']['multi_edit'][$rownumber])
? $_POST['funcs']['multi_edit'][$rownumber]
: null;
$multi_edit_salt
= isset($_POST['salt']['multi_edit'][$rownumber])
? $_POST['salt']['multi_edit'][$rownumber]
:null;
$multi_edit_columns_type
= isset($_POST['fields_type']['multi_edit'][$rownumber])
? $_POST['fields_type']['multi_edit'][$rownumber]
: null;
$multi_edit_columns_null
= isset($_POST['fields_null']['multi_edit'][$rownumber])
? $_POST['fields_null']['multi_edit'][$rownumber]
: null;
$multi_edit_columns_null_prev
= isset($_POST['fields_null_prev']['multi_edit'][$rownumber])
? $_POST['fields_null_prev']['multi_edit'][$rownumber]
: null;
$multi_edit_auto_increment
= isset($_POST['auto_increment']['multi_edit'][$rownumber])
? $_POST['auto_increment']['multi_edit'][$rownumber]
: null;
$multi_edit_virtual
= isset($_POST['virtual']['multi_edit'][$rownumber])
? $_POST['virtual']['multi_edit'][$rownumber]
: null;
// When a select field is nullified, it's not present in $_POST
// so initialize it; this way, the foreach($multi_edit_columns) will process it
foreach ($multi_edit_columns_name as $key => $val) {
if (! isset($multi_edit_columns[$key])) {
$multi_edit_columns[$key] = '';
}
}
// Iterate in the order of $multi_edit_columns_name,
// not $multi_edit_columns, to avoid problems
// when inserting multiple entries
$insert_fail = false;
foreach ($multi_edit_columns_name as $key => $column_name) {
$current_value = $multi_edit_columns[$key];
// Note: $key is an md5 of the fieldname. The actual fieldname is
// available in $multi_edit_columns_name[$key]
$file_to_insert = new File();
$file_to_insert->checkTblChangeForm($key, $rownumber);
$possibly_uploaded_val = $file_to_insert->getContent();
if ($possibly_uploaded_val !== false) {
$current_value = $possibly_uploaded_val;
}
// Apply Input Transformation if defined
if (!empty($mime_map[$column_name])
&& !empty($mime_map[$column_name]['input_transformation'])
) {
$filename = 'libraries/classes/Plugins/Transformations/'
. $mime_map[$column_name]['input_transformation'];
if (is_file($filename)) {
$classname = Transformations::getClassName($filename);
if (class_exists($classname)) {
/** @var IOTransformationsPlugin $transformation_plugin */
$transformation_plugin = new $classname();
$transformation_options = Transformations::getOptions(
$mime_map[$column_name]['input_transformation_options']
);
$current_value = $transformation_plugin->applyTransformation(
$current_value, $transformation_options
);
// check if transformation was successful or not
// and accordingly set error messages & insert_fail
if (method_exists($transformation_plugin, 'isSuccess')
&& !$transformation_plugin->isSuccess()
) {
$insert_fail = true;
$row_skipped = true;
$insert_errors[] = sprintf(
__('Row: %1$s, Column: %2$s, Error: %3$s'),
$rownumber, $column_name,
$transformation_plugin->getError()
);
}
}
}
}
if ($file_to_insert->isError()) {
$insert_errors[] = $file_to_insert->getError();
}
// delete $file_to_insert temporary variable
$file_to_insert->cleanUp();
$current_value = $insertEdit->getCurrentValueForDifferentTypes(
$possibly_uploaded_val, $key, $multi_edit_columns_type,
$current_value, $multi_edit_auto_increment,
$rownumber, $multi_edit_columns_name, $multi_edit_columns_null,
$multi_edit_columns_null_prev, $is_insert,
$using_key, $where_clause, $table, $multi_edit_funcs
);
$current_value_as_an_array = $insertEdit->getCurrentValueAsAnArrayForMultipleEdit(
$multi_edit_funcs,
$multi_edit_salt, $gis_from_text_functions, $current_value,
$gis_from_wkb_functions, $func_optional_param, $func_no_param, $key
);
if (! isset($multi_edit_virtual) || ! isset($multi_edit_virtual[$key])) {
list($query_values, $query_fields)
= $insertEdit->getQueryValuesForInsertAndUpdateInMultipleEdit(
$multi_edit_columns_name, $multi_edit_columns_null,
$current_value, $multi_edit_columns_prev, $multi_edit_funcs,
$is_insert, $query_values, $query_fields,
$current_value_as_an_array, $value_sets, $key,
$multi_edit_columns_null_prev
);
}
if (isset($multi_edit_columns_null[$key])) {
$multi_edit_columns[$key] = null;
}
} //end of foreach
// temporarily store rows not inserted
// so that they can be populated again.
if ($insert_fail) {
$unsaved_values[$rownumber] = $multi_edit_columns;
}
if (!$insert_fail && count($query_values) > 0) {
if ($is_insert) {
$value_sets[] = implode(', ', $query_values);
} else {
// build update query
$query[] = 'UPDATE ' . Util::backquote($GLOBALS['table'])
. ' SET ' . implode(', ', $query_values)
. ' WHERE ' . $where_clause
. ($_POST['clause_is_unique'] ? '' : ' LIMIT 1');
}
}
} // end foreach ($loop_array as $where_clause)
unset(
$multi_edit_columns_name, $multi_edit_columns_prev, $multi_edit_funcs,
$multi_edit_columns_type, $multi_edit_columns_null, $func_no_param,
$multi_edit_auto_increment, $current_value_as_an_array, $key, $current_value,
$loop_array, $where_clause, $using_key, $multi_edit_columns_null_prev,
$insert_fail
);
// Builds the sql query
if ($is_insert && count($value_sets) > 0) {
$query = $insertEdit->buildSqlQuery($is_insertignore, $query_fields, $value_sets);
} elseif (empty($query) && ! isset($_POST['preview_sql']) && !$row_skipped) {
// No change -> move back to the calling script
//
// Note: logic passes here for inline edit
$message = Message::success(__('No change'));
// Avoid infinite recursion
if ($goto_include == 'tbl_replace.php') {
$goto_include = 'tbl_change.php';
}
$active_page = $goto_include;
include '' . Core::securePath($goto_include);
exit;
}
unset($multi_edit_columns, $is_insertignore);
// If there is a request for SQL previewing.
if (isset($_POST['preview_sql'])) {
Core::previewSQL($query);
}
/**
* Executes the sql query and get the result, then move back to the calling
* page
*/
list ($url_params, $total_affected_rows, $last_messages, $warning_messages,
$error_messages, $return_to_sql_query)
= $insertEdit->executeSqlQuery($url_params, $query);
if ($is_insert && (count($value_sets) > 0 || $row_skipped)) {
$message = Message::getMessageForInsertedRows(
$total_affected_rows
);
$unsaved_values = array_values($unsaved_values);
} else {
$message = Message::getMessageForAffectedRows(
$total_affected_rows
);
}
if ($row_skipped) {
$goto_include = 'tbl_change.php';
$message->addMessagesString($insert_errors, ' ');
$message->isError(true);
}
$message->addMessages($last_messages, ' ');
if (! empty($warning_messages)) {
$message->addMessagesString($warning_messages, ' ');
$message->isError(true);
}
if (! empty($error_messages)) {
$message->addMessagesString($error_messages);
$message->isError(true);
}
unset(
$error_messages, $warning_messages, $total_affected_rows,
$last_messages, $last_message, $row_skipped, $insert_errors
);
/**
* The following section only applies to grid editing.
* However, verifying isAjax() is not enough to ensure we are coming from
* grid editing. If we are coming from the Edit or Copy link in Browse mode,
* ajax_page_request is present in the POST parameters.
*/
if ($response->isAjax() && ! isset($_POST['ajax_page_request'])) {
/**
* If we are in grid editing, we need to process the relational and
* transformed fields, if they were edited. After that, output the correct
* link/transformed value and exit
*/
if (isset($_POST['rel_fields_list']) && $_POST['rel_fields_list'] != '') {
$map = $relation->getForeigners($db, $table, '', 'both');
$relation_fields = array();
parse_str($_POST['rel_fields_list'], $relation_fields);
// loop for each relation cell
/** @var array $relation_fields */
foreach ($relation_fields as $cell_index => $curr_rel_field) {
foreach ($curr_rel_field as $relation_field => $relation_field_value) {
$where_comparison = "='" . $relation_field_value . "'";
$dispval = $insertEdit->getDisplayValueForForeignTableColumn(
$where_comparison, $map, $relation_field
);
$extra_data['relations'][$cell_index]
= $insertEdit->getLinkForRelationalDisplayField(
$map, $relation_field, $where_comparison,
$dispval, $relation_field_value
);
}
} // end of loop for each relation cell
}
if (isset($_POST['do_transformations'])
&& $_POST['do_transformations'] == true
) {
$edited_values = array();
parse_str($_POST['transform_fields_list'], $edited_values);
if (! isset($extra_data)) {
$extra_data = array();
}
$transformation_types = array(
"input_transformation",
"transformation"
);
foreach ($mime_map as $transformation) {
$column_name = $transformation['column_name'];
foreach ($transformation_types as $type) {
$file = Core::securePath($transformation[$type]);
$extra_data = $insertEdit->transformEditedValues(
$db, $table, $transformation, $edited_values, $file,
$column_name, $extra_data, $type
);
}
} // end of loop for each $mime_map
}
// Need to check the inline edited value can be truncated by MySQL
// without informing while saving
$column_name = $_POST['fields_name']['multi_edit'][0][0];
$insertEdit->verifyWhetherValueCanBeTruncatedAndAppendExtraData(
$db, $table, $column_name, $extra_data
);
/**Get the total row count of the table*/
$_table = new Table($_POST['table'], $_POST['db']);
$extra_data['row_count'] = $_table->countRecords();
$extra_data['sql_query'] = Util::getMessage(
$message,
$GLOBALS['display_query']
);
$response->setRequestStatus($message->isSuccess());
$response->addJSON('message', $message);
$response->addJSON($extra_data);
exit;
}
if (! empty($return_to_sql_query)) {
$disp_query = $GLOBALS['sql_query'];
$disp_message = $message;
unset($message);
$GLOBALS['sql_query'] = $return_to_sql_query;
}
$scripts->addFile('vendor/jquery/additional-methods.js');
$scripts->addFile('tbl_change.js');
$active_page = $goto_include;
/**
* If user asked for "and then Insert another new row" we have to remove
* WHERE clause information so that tbl_change.php does not go back
* to the current record
*/
if (isset($_POST['after_insert']) && 'new_insert' == $_POST['after_insert']) {
unset($_POST['where_clause']);
}
/**
* Load target page.
*/
require '' . Core::securePath($goto_include);
exit;
login/composer.lock 0000644 00000275216 15155311537 0010400 0 ustar 00 {
"_readme": [
"This file locks the dependencies of your project to a known state",
"Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies",
"This file is @generated automatically"
],
"content-hash": "fcc1bc864c141a58b0bbb7e52b156ef1",
"packages": [
{
"name": "bacon/bacon-qr-code",
"version": "1.0.3",
"source": {
"type": "git",
"url": "https://github.com/Bacon/BaconQrCode.git",
"reference": "5a91b62b9d37cee635bbf8d553f4546057250bee"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/Bacon/BaconQrCode/zipball/5a91b62b9d37cee635bbf8d553f4546057250bee",
"reference": "5a91b62b9d37cee635bbf8d553f4546057250bee",
"shasum": ""
},
"require": {
"ext-iconv": "*",
"php": "^5.4|^7.0"
},
"require-dev": {
"phpunit/phpunit": "^4.8"
},
"suggest": {
"ext-gd": "to generate QR code images"
},
"type": "library",
"autoload": {
"psr-0": {
"BaconQrCode": "src/"
}
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"BSD-2-Clause"
],
"authors": [
{
"name": "Ben Scholzen 'DASPRiD'",
"email": "mail@dasprids.de",
"homepage": "http://www.dasprids.de",
"role": "Developer"
}
],
"description": "BaconQrCode is a QR code generator for PHP.",
"homepage": "https://github.com/Bacon/BaconQrCode",
"time": "2017-10-17T09:59:25+00:00"
},
{
"name": "google/recaptcha",
"version": "1.2.4",
"source": {
"type": "git",
"url": "https://github.com/google/recaptcha.git",
"reference": "614f25a9038be4f3f2da7cbfd778dc5b357d2419"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/google/recaptcha/zipball/614f25a9038be4f3f2da7cbfd778dc5b357d2419",
"reference": "614f25a9038be4f3f2da7cbfd778dc5b357d2419",
"shasum": ""
},
"require": {
"php": ">=5.5"
},
"require-dev": {
"friendsofphp/php-cs-fixer": "^2.2.20|^2.15",
"php-coveralls/php-coveralls": "^2.1",
"phpunit/phpunit": "^4.8.36|^5.7.27|^6.59|^7.5.11"
},
"type": "library",
"extra": {
"branch-alias": {
"dev-master": "1.2.x-dev"
}
},
"autoload": {
"psr-4": {
"ReCaptcha\\": "src/ReCaptcha"
}
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"BSD-3-Clause"
],
"description": "Client library for reCAPTCHA, a free service that protects websites from spam and abuse.",
"homepage": "https://www.google.com/recaptcha/",
"keywords": [
"Abuse",
"captcha",
"recaptcha",
"spam"
],
"time": "2020-03-31T17:50:54+00:00"
},
{
"name": "paragonie/constant_time_encoding",
"version": "v1.0.4",
"source": {
"type": "git",
"url": "https://github.com/paragonie/constant_time_encoding.git",
"reference": "2132f0f293d856026d7d11bd81b9f4a23a1dc1f6"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/paragonie/constant_time_encoding/zipball/2132f0f293d856026d7d11bd81b9f4a23a1dc1f6",
"reference": "2132f0f293d856026d7d11bd81b9f4a23a1dc1f6",
"shasum": ""
},
"require": {
"php": "^5.3|^7"
},
"require-dev": {
"paragonie/random_compat": "^1.4|^2",
"phpunit/phpunit": "4.*|5.*",
"vimeo/psalm": "^0.3|^1"
},
"type": "library",
"autoload": {
"psr-4": {
"ParagonIE\\ConstantTime\\": "src/"
}
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
"authors": [
{
"name": "Paragon Initiative Enterprises",
"email": "security@paragonie.com",
"homepage": "https://paragonie.com",
"role": "Maintainer"
},
{
"name": "Steve 'Sc00bz' Thomas",
"email": "steve@tobtu.com",
"homepage": "https://www.tobtu.com",
"role": "Original Developer"
}
],
"description": "Constant-time Implementations of RFC 4648 Encoding (Base-64, Base-32, Base-16)",
"keywords": [
"base16",
"base32",
"base32_decode",
"base32_encode",
"base64",
"base64_decode",
"base64_encode",
"bin2hex",
"encoding",
"hex",
"hex2bin",
"rfc4648"
],
"time": "2018-04-30T17:57:16+00:00"
},
{
"name": "paragonie/random_compat",
"version": "v2.0.19",
"source": {
"type": "git",
"url": "https://github.com/paragonie/random_compat.git",
"reference": "446fc9faa5c2a9ddf65eb7121c0af7e857295241"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/paragonie/random_compat/zipball/446fc9faa5c2a9ddf65eb7121c0af7e857295241",
"reference": "446fc9faa5c2a9ddf65eb7121c0af7e857295241",
"shasum": ""
},
"require": {
"php": ">=5.2.0"
},
"require-dev": {
"phpunit/phpunit": "4.*|5.*"
},
"suggest": {
"ext-libsodium": "Provides a modern crypto API that can be used to generate random bytes."
},
"type": "library",
"autoload": {
"files": [
"lib/random.php"
]
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
"authors": [
{
"name": "Paragon Initiative Enterprises",
"email": "security@paragonie.com",
"homepage": "https://paragonie.com"
}
],
"description": "PHP 5.x polyfill for random_bytes() and random_int() from PHP 7",
"keywords": [
"csprng",
"polyfill",
"pseudorandom",
"random"
],
"time": "2020-10-15T10:06:57+00:00"
},
{
"name": "phpmyadmin/motranslator",
"version": "4.0",
"source": {
"type": "git",
"url": "https://github.com/phpmyadmin/motranslator.git",
"reference": "fcb370254998fda7eeccfd7c787b4deb71b0d77c"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/phpmyadmin/motranslator/zipball/fcb370254998fda7eeccfd7c787b4deb71b0d77c",
"reference": "fcb370254998fda7eeccfd7c787b4deb71b0d77c",
"shasum": ""
},
"require": {
"php": ">=5.3.0",
"symfony/expression-language": "^4.0 || ^3.2 || ^2.8"
},
"require-dev": {
"apigen/apigen": "^4.1",
"phpunit/php-code-coverage": "*",
"phpunit/phpunit": "~4.8 || ~5.7 || ~6.5"
},
"type": "library",
"autoload": {
"psr-4": {
"PhpMyAdmin\\MoTranslator\\": "src"
}
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"GPL-2.0-or-later"
],
"authors": [
{
"name": "The phpMyAdmin Team",
"email": "developers@phpmyadmin.net",
"homepage": "https://www.phpmyadmin.net/team/"
}
],
"description": "Translation API for PHP using Gettext MO files",
"homepage": "https://github.com/phpmyadmin/motranslator",
"keywords": [
"gettext",
"i18n",
"mo",
"translator"
],
"time": "2018-02-12T13:22:52+00:00"
},
{
"name": "phpmyadmin/shapefile",
"version": "2.1",
"source": {
"type": "git",
"url": "https://github.com/phpmyadmin/shapefile.git",
"reference": "e23b767f2a81f61fee3fc09fc062879985f3e224"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/phpmyadmin/shapefile/zipball/e23b767f2a81f61fee3fc09fc062879985f3e224",
"reference": "e23b767f2a81f61fee3fc09fc062879985f3e224",
"shasum": ""
},
"require": {
"php": ">=5.4.0"
},
"require-dev": {
"phpunit/php-code-coverage": "*",
"phpunit/phpunit": "~4.8 || ~5.7"
},
"suggest": {
"ext-dbase": "For dbf files parsing"
},
"type": "library",
"autoload": {
"psr-4": {
"PhpMyAdmin\\ShapeFile\\": "src"
}
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"GPL-2.0+"
],
"authors": [
{
"name": "The phpMyAdmin Team",
"email": "developers@phpmyadmin.net",
"homepage": "https://www.phpmyadmin.net/team/"
}
],
"description": "ESRI ShapeFile library for PHP",
"homepage": "https://github.com/phpmyadmin/shapefile",
"keywords": [
"ESRI",
"Shapefile",
"dbf",
"geo",
"geospatial",
"shape",
"shp"
],
"time": "2017-05-15T08:31:47+00:00"
},
{
"name": "phpmyadmin/sql-parser",
"version": "4.7.1",
"source": {
"type": "git",
"url": "https://github.com/phpmyadmin/sql-parser.git",
"reference": "550ce6968794e890cfd5b4cbf202e716d78b6a92"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/phpmyadmin/sql-parser/zipball/550ce6968794e890cfd5b4cbf202e716d78b6a92",
"reference": "550ce6968794e890cfd5b4cbf202e716d78b6a92",
"shasum": ""
},
"require": {
"php": ">=5.3.0",
"symfony/polyfill-mbstring": "^1.3"
},
"conflict": {
"phpmyadmin/motranslator": "<3.0"
},
"require-dev": {
"phpunit/phpunit": "~4.8 || ~5.7 || ~6.5 || ^7.0",
"squizlabs/php_codesniffer": "~2.9 || ~3.4"
},
"suggest": {
"ext-mbstring": "For best performance",
"phpmyadmin/motranslator": "Translate messages to your favorite locale"
},
"bin": [
"bin/highlight-query",
"bin/lint-query",
"bin/tokenize-query"
],
"type": "library",
"autoload": {
"psr-4": {
"PhpMyAdmin\\SqlParser\\": "src"
}
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"GPL-2.0-or-later"
],
"authors": [
{
"name": "The phpMyAdmin Team",
"email": "developers@phpmyadmin.net",
"homepage": "https://www.phpmyadmin.net/team/"
}
],
"description": "A validating SQL lexer and parser with a focus on MySQL dialect.",
"homepage": "https://github.com/phpmyadmin/sql-parser",
"keywords": [
"analysis",
"lexer",
"parser",
"sql"
],
"time": "2020-10-15T15:17:59+00:00"
},
{
"name": "phpseclib/phpseclib",
"version": "2.0.29",
"source": {
"type": "git",
"url": "https://github.com/phpseclib/phpseclib.git",
"reference": "497856a8d997f640b4a516062f84228a772a48a8"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/phpseclib/phpseclib/zipball/497856a8d997f640b4a516062f84228a772a48a8",
"reference": "497856a8d997f640b4a516062f84228a772a48a8",
"shasum": ""
},
"require": {
"php": ">=5.3.3"
},
"require-dev": {
"phing/phing": "~2.7",
"phpunit/phpunit": "^4.8.35|^5.7|^6.0",
"squizlabs/php_codesniffer": "~2.0"
},
"suggest": {
"ext-gmp": "Install the GMP (GNU Multiple Precision) extension in order to speed up arbitrary precision integer arithmetic operations.",
"ext-libsodium": "SSH2/SFTP can make use of some algorithms provided by the libsodium-php extension.",
"ext-mcrypt": "Install the Mcrypt extension in order to speed up a few other cryptographic operations.",
"ext-openssl": "Install the OpenSSL extension in order to speed up a wide variety of cryptographic operations."
},
"type": "library",
"autoload": {
"files": [
"phpseclib/bootstrap.php"
],
"psr-4": {
"phpseclib\\": "phpseclib/"
}
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
"authors": [
{
"name": "Jim Wigginton",
"email": "terrafrost@php.net",
"role": "Lead Developer"
},
{
"name": "Patrick Monnerat",
"email": "pm@datasphere.ch",
"role": "Developer"
},
{
"name": "Andreas Fischer",
"email": "bantu@phpbb.com",
"role": "Developer"
},
{
"name": "Hans-Jürgen Petrich",
"email": "petrich@tronic-media.com",
"role": "Developer"
},
{
"name": "Graham Campbell",
"email": "graham@alt-three.com",
"role": "Developer"
}
],
"description": "PHP Secure Communications Library - Pure-PHP implementations of RSA, AES, SSH2, SFTP, X.509 etc.",
"homepage": "http://phpseclib.sourceforge.net",
"keywords": [
"BigInteger",
"aes",
"asn.1",
"asn1",
"blowfish",
"crypto",
"cryptography",
"encryption",
"rsa",
"security",
"sftp",
"signature",
"signing",
"ssh",
"twofish",
"x.509",
"x509"
],
"funding": [
{
"url": "https://github.com/terrafrost",
"type": "github"
},
{
"url": "https://www.patreon.com/phpseclib",
"type": "patreon"
},
{
"url": "https://tidelift.com/funding/github/packagist/phpseclib/phpseclib",
"type": "tidelift"
}
],
"time": "2020-09-08T04:24:43+00:00"
},
{
"name": "pragmarx/google2fa",
"version": "v3.0.3",
"source": {
"type": "git",
"url": "https://github.com/antonioribeiro/google2fa.git",
"reference": "6949226739e4424f40031e6f1c96b1fd64047335"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/antonioribeiro/google2fa/zipball/6949226739e4424f40031e6f1c96b1fd64047335",
"reference": "6949226739e4424f40031e6f1c96b1fd64047335",
"shasum": ""
},
"require": {
"paragonie/constant_time_encoding": "~1.0|~2.0",
"paragonie/random_compat": ">=1",
"php": ">=5.4",
"symfony/polyfill-php56": "~1.2"
},
"require-dev": {
"bacon/bacon-qr-code": "~1.0",
"phpunit/phpunit": "~4|~5|~6"
},
"suggest": {
"bacon/bacon-qr-code": "Required to generate inline QR Codes."
},
"type": "library",
"extra": {
"component": "package",
"branch-alias": {
"dev-master": "2.0-dev"
}
},
"autoload": {
"psr-4": {
"PragmaRX\\Google2FA\\": "src/",
"PragmaRX\\Google2FA\\Tests\\": "tests/"
}
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
"authors": [
{
"name": "Antonio Carlos Ribeiro",
"email": "acr@antoniocarlosribeiro.com",
"role": "Creator & Designer"
}
],
"description": "A One Time Password Authentication package, compatible with Google Authenticator.",
"keywords": [
"2fa",
"Authentication",
"Two Factor Authentication",
"google2fa",
"laravel"
],
"time": "2018-08-29T13:28:06+00:00"
},
{
"name": "psr/container",
"version": "1.0.0",
"source": {
"type": "git",
"url": "https://github.com/php-fig/container.git",
"reference": "b7ce3b176482dbbc1245ebf52b181af44c2cf55f"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/php-fig/container/zipball/b7ce3b176482dbbc1245ebf52b181af44c2cf55f",
"reference": "b7ce3b176482dbbc1245ebf52b181af44c2cf55f",
"shasum": ""
},
"require": {
"php": ">=5.3.0"
},
"type": "library",
"extra": {
"branch-alias": {
"dev-master": "1.0.x-dev"
}
},
"autoload": {
"psr-4": {
"Psr\\Container\\": "src/"
}
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
"authors": [
{
"name": "PHP-FIG",
"homepage": "http://www.php-fig.org/"
}
],
"description": "Common Container Interface (PHP FIG PSR-11)",
"homepage": "https://github.com/php-fig/container",
"keywords": [
"PSR-11",
"container",
"container-interface",
"container-interop",
"psr"
],
"time": "2017-02-14T16:28:37+00:00"
},
{
"name": "samyoul/u2f-php-server",
"version": "v1.1.4",
"source": {
"type": "git",
"url": "https://github.com/Samyoul/U2F-php-server.git",
"reference": "0625202c79d570e58525ed6c4ae38500ea3f0883"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/Samyoul/U2F-php-server/zipball/0625202c79d570e58525ed6c4ae38500ea3f0883",
"reference": "0625202c79d570e58525ed6c4ae38500ea3f0883",
"shasum": ""
},
"require": {
"ext-openssl": "*"
},
"type": "library",
"autoload": {
"psr-4": {
"Samyoul\\U2F\\U2FServer\\": [
"src/"
]
}
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"BSD-2-Clause"
],
"authors": [
{
"name": "Samuel Hawksby-Robinson",
"email": "samuel@samyoul.com"
}
],
"description": "Server side handling class for FIDO U2F registration and authentication",
"time": "2018-10-26T12:43:39+00:00"
},
{
"name": "symfony/expression-language",
"version": "v2.8.52",
"source": {
"type": "git",
"url": "https://github.com/symfony/expression-language.git",
"reference": "fa9be1b831859b56d244137fabbfd01a46dbdb36"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/symfony/expression-language/zipball/fa9be1b831859b56d244137fabbfd01a46dbdb36",
"reference": "fa9be1b831859b56d244137fabbfd01a46dbdb36",
"shasum": ""
},
"require": {
"php": ">=5.3.9"
},
"type": "library",
"extra": {
"branch-alias": {
"dev-master": "2.8-dev"
}
},
"autoload": {
"psr-4": {
"Symfony\\Component\\ExpressionLanguage\\": ""
},
"exclude-from-classmap": [
"/Tests/"
]
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
"authors": [
{
"name": "Fabien Potencier",
"email": "fabien@symfony.com"
},
{
"name": "Symfony Community",
"homepage": "https://symfony.com/contributors"
}
],
"description": "Symfony ExpressionLanguage Component",
"homepage": "https://symfony.com",
"time": "2018-11-11T11:18:13+00:00"
},
{
"name": "symfony/polyfill-ctype",
"version": "v1.18.1",
"source": {
"type": "git",
"url": "https://github.com/symfony/polyfill-ctype.git",
"reference": "1c302646f6efc070cd46856e600e5e0684d6b454"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/symfony/polyfill-ctype/zipball/1c302646f6efc070cd46856e600e5e0684d6b454",
"reference": "1c302646f6efc070cd46856e600e5e0684d6b454",
"shasum": ""
},
"require": {
"php": ">=5.3.3"
},
"suggest": {
"ext-ctype": "For best performance"
},
"type": "library",
"extra": {
"branch-alias": {
"dev-master": "1.18-dev"
},
"thanks": {
"name": "symfony/polyfill",
"url": "https://github.com/symfony/polyfill"
}
},
"autoload": {
"psr-4": {
"Symfony\\Polyfill\\Ctype\\": ""
},
"files": [
"bootstrap.php"
]
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
"authors": [
{
"name": "Gert de Pagter",
"email": "BackEndTea@gmail.com"
},
{
"name": "Symfony Community",
"homepage": "https://symfony.com/contributors"
}
],
"description": "Symfony polyfill for ctype functions",
"homepage": "https://symfony.com",
"keywords": [
"compatibility",
"ctype",
"polyfill",
"portable"
],
"funding": [
{
"url": "https://symfony.com/sponsor",
"type": "custom"
},
{
"url": "https://github.com/fabpot",
"type": "github"
},
{
"url": "https://tidelift.com/funding/github/packagist/symfony/symfony",
"type": "tidelift"
}
],
"time": "2020-07-14T12:35:20+00:00"
},
{
"name": "symfony/polyfill-mbstring",
"version": "v1.18.1",
"source": {
"type": "git",
"url": "https://github.com/symfony/polyfill-mbstring.git",
"reference": "a6977d63bf9a0ad4c65cd352709e230876f9904a"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/symfony/polyfill-mbstring/zipball/a6977d63bf9a0ad4c65cd352709e230876f9904a",
"reference": "a6977d63bf9a0ad4c65cd352709e230876f9904a",
"shasum": ""
},
"require": {
"php": ">=5.3.3"
},
"suggest": {
"ext-mbstring": "For best performance"
},
"type": "library",
"extra": {
"branch-alias": {
"dev-master": "1.18-dev"
},
"thanks": {
"name": "symfony/polyfill",
"url": "https://github.com/symfony/polyfill"
}
},
"autoload": {
"psr-4": {
"Symfony\\Polyfill\\Mbstring\\": ""
},
"files": [
"bootstrap.php"
]
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
"authors": [
{
"name": "Nicolas Grekas",
"email": "p@tchwork.com"
},
{
"name": "Symfony Community",
"homepage": "https://symfony.com/contributors"
}
],
"description": "Symfony polyfill for the Mbstring extension",
"homepage": "https://symfony.com",
"keywords": [
"compatibility",
"mbstring",
"polyfill",
"portable",
"shim"
],
"funding": [
{
"url": "https://symfony.com/sponsor",
"type": "custom"
},
{
"url": "https://github.com/fabpot",
"type": "github"
},
{
"url": "https://tidelift.com/funding/github/packagist/symfony/symfony",
"type": "tidelift"
}
],
"time": "2020-07-14T12:35:20+00:00"
},
{
"name": "symfony/polyfill-php56",
"version": "v1.18.1",
"source": {
"type": "git",
"url": "https://github.com/symfony/polyfill-php56.git",
"reference": "13df84e91cd168f247c2f2ec82cc0fa24901c011"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/symfony/polyfill-php56/zipball/13df84e91cd168f247c2f2ec82cc0fa24901c011",
"reference": "13df84e91cd168f247c2f2ec82cc0fa24901c011",
"shasum": ""
},
"require": {
"php": ">=5.3.3",
"symfony/polyfill-util": "~1.0"
},
"type": "library",
"extra": {
"branch-alias": {
"dev-master": "1.18-dev"
},
"thanks": {
"name": "symfony/polyfill",
"url": "https://github.com/symfony/polyfill"
}
},
"autoload": {
"psr-4": {
"Symfony\\Polyfill\\Php56\\": ""
},
"files": [
"bootstrap.php"
]
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
"authors": [
{
"name": "Nicolas Grekas",
"email": "p@tchwork.com"
},
{
"name": "Symfony Community",
"homepage": "https://symfony.com/contributors"
}
],
"description": "Symfony polyfill backporting some PHP 5.6+ features to lower PHP versions",
"homepage": "https://symfony.com",
"keywords": [
"compatibility",
"polyfill",
"portable",
"shim"
],
"funding": [
{
"url": "https://symfony.com/sponsor",
"type": "custom"
},
{
"url": "https://github.com/fabpot",
"type": "github"
},
{
"url": "https://tidelift.com/funding/github/packagist/symfony/symfony",
"type": "tidelift"
}
],
"time": "2020-07-14T12:35:20+00:00"
},
{
"name": "symfony/polyfill-util",
"version": "v1.18.1",
"source": {
"type": "git",
"url": "https://github.com/symfony/polyfill-util.git",
"reference": "46b910c71e9828f8ec2aa7a0314de1130d9b295a"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/symfony/polyfill-util/zipball/46b910c71e9828f8ec2aa7a0314de1130d9b295a",
"reference": "46b910c71e9828f8ec2aa7a0314de1130d9b295a",
"shasum": ""
},
"require": {
"php": ">=5.3.3"
},
"type": "library",
"extra": {
"branch-alias": {
"dev-master": "1.18-dev"
},
"thanks": {
"name": "symfony/polyfill",
"url": "https://github.com/symfony/polyfill"
}
},
"autoload": {
"psr-4": {
"Symfony\\Polyfill\\Util\\": ""
}
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
"authors": [
{
"name": "Nicolas Grekas",
"email": "p@tchwork.com"
},
{
"name": "Symfony Community",
"homepage": "https://symfony.com/contributors"
}
],
"description": "Symfony utilities for portability of PHP codes",
"homepage": "https://symfony.com",
"keywords": [
"compat",
"compatibility",
"polyfill",
"shim"
],
"funding": [
{
"url": "https://symfony.com/sponsor",
"type": "custom"
},
{
"url": "https://github.com/fabpot",
"type": "github"
},
{
"url": "https://tidelift.com/funding/github/packagist/symfony/symfony",
"type": "tidelift"
}
],
"time": "2020-07-14T12:35:20+00:00"
},
{
"name": "tecnickcom/tcpdf",
"version": "6.3.5",
"source": {
"type": "git",
"url": "https://github.com/tecnickcom/TCPDF.git",
"reference": "19a535eaa7fb1c1cac499109deeb1a7a201b4549"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/tecnickcom/TCPDF/zipball/19a535eaa7fb1c1cac499109deeb1a7a201b4549",
"reference": "19a535eaa7fb1c1cac499109deeb1a7a201b4549",
"shasum": ""
},
"require": {
"php": ">=5.3.0"
},
"type": "library",
"autoload": {
"classmap": [
"config",
"include",
"tcpdf.php",
"tcpdf_parser.php",
"tcpdf_import.php",
"tcpdf_barcodes_1d.php",
"tcpdf_barcodes_2d.php",
"include/tcpdf_colors.php",
"include/tcpdf_filters.php",
"include/tcpdf_font_data.php",
"include/tcpdf_fonts.php",
"include/tcpdf_images.php",
"include/tcpdf_static.php",
"include/barcodes/datamatrix.php",
"include/barcodes/pdf417.php",
"include/barcodes/qrcode.php"
]
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"LGPL-3.0-only"
],
"authors": [
{
"name": "Nicola Asuni",
"email": "info@tecnick.com",
"role": "lead"
}
],
"description": "TCPDF is a PHP class for generating PDF documents and barcodes.",
"homepage": "http://www.tcpdf.org/",
"keywords": [
"PDFD32000-2008",
"TCPDF",
"barcodes",
"datamatrix",
"pdf",
"pdf417",
"qrcode"
],
"time": "2020-02-14T14:20:12+00:00"
},
{
"name": "twig/extensions",
"version": "v1.5.4",
"source": {
"type": "git",
"url": "https://github.com/twigphp/Twig-extensions.git",
"reference": "57873c8b0c1be51caa47df2cdb824490beb16202"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/twigphp/Twig-extensions/zipball/57873c8b0c1be51caa47df2cdb824490beb16202",
"reference": "57873c8b0c1be51caa47df2cdb824490beb16202",
"shasum": ""
},
"require": {
"twig/twig": "^1.27|^2.0"
},
"require-dev": {
"symfony/phpunit-bridge": "^3.4",
"symfony/translation": "^2.7|^3.4"
},
"suggest": {
"symfony/translation": "Allow the time_diff output to be translated"
},
"type": "library",
"extra": {
"branch-alias": {
"dev-master": "1.5-dev"
}
},
"autoload": {
"psr-0": {
"Twig_Extensions_": "lib/"
},
"psr-4": {
"Twig\\Extensions\\": "src/"
}
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
"authors": [
{
"name": "Fabien Potencier",
"email": "fabien@symfony.com"
}
],
"description": "Common additional features for Twig that do not directly belong in core",
"keywords": [
"i18n",
"text"
],
"abandoned": true,
"time": "2018-12-05T18:34:18+00:00"
},
{
"name": "twig/twig",
"version": "v1.42.5",
"source": {
"type": "git",
"url": "https://github.com/twigphp/Twig.git",
"reference": "87b2ea9d8f6fd014d0621ca089bb1b3769ea3f8e"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/twigphp/Twig/zipball/87b2ea9d8f6fd014d0621ca089bb1b3769ea3f8e",
"reference": "87b2ea9d8f6fd014d0621ca089bb1b3769ea3f8e",
"shasum": ""
},
"require": {
"php": ">=5.5.0",
"symfony/polyfill-ctype": "^1.8"
},
"require-dev": {
"psr/container": "^1.0",
"symfony/phpunit-bridge": "^4.4|^5.0"
},
"type": "library",
"extra": {
"branch-alias": {
"dev-master": "1.42-dev"
}
},
"autoload": {
"psr-0": {
"Twig_": "lib/"
},
"psr-4": {
"Twig\\": "src/"
}
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"BSD-3-Clause"
],
"authors": [
{
"name": "Fabien Potencier",
"email": "fabien@symfony.com",
"homepage": "http://fabien.potencier.org",
"role": "Lead Developer"
},
{
"name": "Twig Team",
"role": "Contributors"
},
{
"name": "Armin Ronacher",
"email": "armin.ronacher@active-4.com",
"role": "Project Founder"
}
],
"description": "Twig, the flexible, fast, and secure template language for PHP",
"homepage": "https://twig.symfony.com",
"keywords": [
"templating"
],
"time": "2020-02-11T05:59:23+00:00"
}
],
"packages-dev": [
{
"name": "codacy/coverage",
"version": "1.4.3",
"source": {
"type": "git",
"url": "https://github.com/codacy/php-codacy-coverage.git",
"reference": "1852ca987c91ef466ebcfdbdd4e1788b653eaf1d"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/codacy/php-codacy-coverage/zipball/1852ca987c91ef466ebcfdbdd4e1788b653eaf1d",
"reference": "1852ca987c91ef466ebcfdbdd4e1788b653eaf1d",
"shasum": ""
},
"require": {
"gitonomy/gitlib": ">=1.0",
"php": ">=5.3.3",
"symfony/console": "~2.5|~3.0|~4.0|~5.0"
},
"require-dev": {
"clue/phar-composer": "^1.1",
"phpunit/phpunit": "~6.5"
},
"bin": [
"bin/codacycoverage"
],
"type": "library",
"autoload": {
"classmap": [
"src/"
]
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
"authors": [
{
"name": "Jakob Pupke",
"email": "jakob.pupke@gmail.com"
}
],
"description": "Sends PHP test coverage information to Codacy.",
"homepage": "https://github.com/codacy/php-codacy-coverage",
"abandoned": true,
"time": "2020-01-10T10:52:12+00:00"
},
{
"name": "doctrine/instantiator",
"version": "1.0.5",
"source": {
"type": "git",
"url": "https://github.com/doctrine/instantiator.git",
"reference": "8e884e78f9f0eb1329e445619e04456e64d8051d"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/doctrine/instantiator/zipball/8e884e78f9f0eb1329e445619e04456e64d8051d",
"reference": "8e884e78f9f0eb1329e445619e04456e64d8051d",
"shasum": ""
},
"require": {
"php": ">=5.3,<8.0-DEV"
},
"require-dev": {
"athletic/athletic": "~0.1.8",
"ext-pdo": "*",
"ext-phar": "*",
"phpunit/phpunit": "~4.0",
"squizlabs/php_codesniffer": "~2.0"
},
"type": "library",
"extra": {
"branch-alias": {
"dev-master": "1.0.x-dev"
}
},
"autoload": {
"psr-4": {
"Doctrine\\Instantiator\\": "src/Doctrine/Instantiator/"
}
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
"authors": [
{
"name": "Marco Pivetta",
"email": "ocramius@gmail.com",
"homepage": "http://ocramius.github.com/"
}
],
"description": "A small, lightweight utility to instantiate objects in PHP without invoking their constructors",
"homepage": "https://github.com/doctrine/instantiator",
"keywords": [
"constructor",
"instantiate"
],
"time": "2015-06-14T21:17:01+00:00"
},
{
"name": "gitonomy/gitlib",
"version": "v1.0.4",
"source": {
"type": "git",
"url": "https://github.com/gitonomy/gitlib.git",
"reference": "932a960221ae3484a3e82553b3be478e56beb68d"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/gitonomy/gitlib/zipball/932a960221ae3484a3e82553b3be478e56beb68d",
"reference": "932a960221ae3484a3e82553b3be478e56beb68d",
"shasum": ""
},
"require": {
"php": "^5.3 || ^7.0",
"symfony/process": "^2.3|^3.0|^4.0"
},
"require-dev": {
"phpunit/phpunit": "^4.8.35|^5.7",
"psr/log": "^1.0"
},
"suggest": {
"psr/log": "Add some log"
},
"type": "library",
"extra": {
"branch-alias": {
"dev-master": "1.0-dev"
}
},
"autoload": {
"psr-4": {
"Gitonomy\\Git\\": "src/Gitonomy/Git/"
}
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
"authors": [
{
"name": "Alexandre Salomé",
"email": "alexandre.salome@gmail.com",
"homepage": "http://alexandre-salome.fr"
},
{
"name": "Julien DIDIER",
"email": "genzo.wm@gmail.com",
"homepage": "http://www.jdidier.net"
}
],
"description": "Library for accessing git",
"homepage": "http://gitonomy.com",
"time": "2018-04-22T19:55:36+00:00"
},
{
"name": "phpdocumentor/reflection-common",
"version": "1.0.1",
"source": {
"type": "git",
"url": "https://github.com/phpDocumentor/ReflectionCommon.git",
"reference": "21bdeb5f65d7ebf9f43b1b25d404f87deab5bfb6"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/phpDocumentor/ReflectionCommon/zipball/21bdeb5f65d7ebf9f43b1b25d404f87deab5bfb6",
"reference": "21bdeb5f65d7ebf9f43b1b25d404f87deab5bfb6",
"shasum": ""
},
"require": {
"php": ">=5.5"
},
"require-dev": {
"phpunit/phpunit": "^4.6"
},
"type": "library",
"extra": {
"branch-alias": {
"dev-master": "1.0.x-dev"
}
},
"autoload": {
"psr-4": {
"phpDocumentor\\Reflection\\": [
"src"
]
}
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
"authors": [
{
"name": "Jaap van Otterdijk",
"email": "opensource@ijaap.nl"
}
],
"description": "Common reflection classes used by phpdocumentor to reflect the code structure",
"homepage": "http://www.phpdoc.org",
"keywords": [
"FQSEN",
"phpDocumentor",
"phpdoc",
"reflection",
"static analysis"
],
"time": "2017-09-11T18:02:19+00:00"
},
{
"name": "phpdocumentor/reflection-docblock",
"version": "3.2.2",
"source": {
"type": "git",
"url": "https://github.com/phpDocumentor/ReflectionDocBlock.git",
"reference": "4aada1f93c72c35e22fb1383b47fee43b8f1d157"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/phpDocumentor/ReflectionDocBlock/zipball/4aada1f93c72c35e22fb1383b47fee43b8f1d157",
"reference": "4aada1f93c72c35e22fb1383b47fee43b8f1d157",
"shasum": ""
},
"require": {
"php": ">=5.5",
"phpdocumentor/reflection-common": "^1.0@dev",
"phpdocumentor/type-resolver": "^0.3.0",
"webmozart/assert": "^1.0"
},
"require-dev": {
"mockery/mockery": "^0.9.4",
"phpunit/phpunit": "^4.4"
},
"type": "library",
"autoload": {
"psr-4": {
"phpDocumentor\\Reflection\\": [
"src/"
]
}
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
"authors": [
{
"name": "Mike van Riel",
"email": "me@mikevanriel.com"
}
],
"description": "With this component, a library can provide support for annotations via DocBlocks or otherwise retrieve information that is embedded in a DocBlock.",
"time": "2017-08-08T06:39:58+00:00"
},
{
"name": "phpdocumentor/type-resolver",
"version": "0.3.0",
"source": {
"type": "git",
"url": "https://github.com/phpDocumentor/TypeResolver.git",
"reference": "fb3933512008d8162b3cdf9e18dba9309b7c3773"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/phpDocumentor/TypeResolver/zipball/fb3933512008d8162b3cdf9e18dba9309b7c3773",
"reference": "fb3933512008d8162b3cdf9e18dba9309b7c3773",
"shasum": ""
},
"require": {
"php": "^5.5 || ^7.0",
"phpdocumentor/reflection-common": "^1.0"
},
"require-dev": {
"mockery/mockery": "^0.9.4",
"phpunit/phpunit": "^5.2||^4.8.24"
},
"type": "library",
"extra": {
"branch-alias": {
"dev-master": "1.0.x-dev"
}
},
"autoload": {
"psr-4": {
"phpDocumentor\\Reflection\\": [
"src/"
]
}
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
"authors": [
{
"name": "Mike van Riel",
"email": "me@mikevanriel.com"
}
],
"time": "2017-06-03T08:32:36+00:00"
},
{
"name": "phpmyadmin/coding-standard",
"version": "0.3",
"source": {
"type": "git",
"url": "https://github.com/phpmyadmin/coding-standard.git",
"reference": "5ae123e27140a1e16be005432e26a8233524eaf5"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/phpmyadmin/coding-standard/zipball/5ae123e27140a1e16be005432e26a8233524eaf5",
"reference": "5ae123e27140a1e16be005432e26a8233524eaf5",
"shasum": ""
},
"require": {
"squizlabs/php_codesniffer": "^3.0"
},
"type": "phpcodesniffer-standard",
"notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
"authors": [
{
"name": "The phpMyAdmin Team",
"email": "developers@phpmyadmin.net",
"homepage": "https://www.phpmyadmin.net/team/"
}
],
"description": "phpMyAdmin PHP CodeSniffer Coding Standard",
"keywords": [
"codesniffer",
"phpcs",
"phpmyadmin"
],
"time": "2017-09-28T09:13:00+00:00"
},
{
"name": "phpspec/prophecy",
"version": "v1.10.3",
"source": {
"type": "git",
"url": "https://github.com/phpspec/prophecy.git",
"reference": "451c3cd1418cf640de218914901e51b064abb093"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/phpspec/prophecy/zipball/451c3cd1418cf640de218914901e51b064abb093",
"reference": "451c3cd1418cf640de218914901e51b064abb093",
"shasum": ""
},
"require": {
"doctrine/instantiator": "^1.0.2",
"php": "^5.3|^7.0",
"phpdocumentor/reflection-docblock": "^2.0|^3.0.2|^4.0|^5.0",
"sebastian/comparator": "^1.2.3|^2.0|^3.0|^4.0",
"sebastian/recursion-context": "^1.0|^2.0|^3.0|^4.0"
},
"require-dev": {
"phpspec/phpspec": "^2.5 || ^3.2",
"phpunit/phpunit": "^4.8.35 || ^5.7 || ^6.5 || ^7.1"
},
"type": "library",
"extra": {
"branch-alias": {
"dev-master": "1.10.x-dev"
}
},
"autoload": {
"psr-4": {
"Prophecy\\": "src/Prophecy"
}
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
"authors": [
{
"name": "Konstantin Kudryashov",
"email": "ever.zet@gmail.com",
"homepage": "http://everzet.com"
},
{
"name": "Marcello Duarte",
"email": "marcello.duarte@gmail.com"
}
],
"description": "Highly opinionated mocking framework for PHP 5.3+",
"homepage": "https://github.com/phpspec/prophecy",
"keywords": [
"Double",
"Dummy",
"fake",
"mock",
"spy",
"stub"
],
"time": "2020-03-05T15:02:03+00:00"
},
{
"name": "phpunit/php-code-coverage",
"version": "2.2.4",
"source": {
"type": "git",
"url": "https://github.com/sebastianbergmann/php-code-coverage.git",
"reference": "eabf68b476ac7d0f73793aada060f1c1a9bf8979"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/sebastianbergmann/php-code-coverage/zipball/eabf68b476ac7d0f73793aada060f1c1a9bf8979",
"reference": "eabf68b476ac7d0f73793aada060f1c1a9bf8979",
"shasum": ""
},
"require": {
"php": ">=5.3.3",
"phpunit/php-file-iterator": "~1.3",
"phpunit/php-text-template": "~1.2",
"phpunit/php-token-stream": "~1.3",
"sebastian/environment": "^1.3.2",
"sebastian/version": "~1.0"
},
"require-dev": {
"ext-xdebug": ">=2.1.4",
"phpunit/phpunit": "~4"
},
"suggest": {
"ext-dom": "*",
"ext-xdebug": ">=2.2.1",
"ext-xmlwriter": "*"
},
"type": "library",
"extra": {
"branch-alias": {
"dev-master": "2.2.x-dev"
}
},
"autoload": {
"classmap": [
"src/"
]
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"BSD-3-Clause"
],
"authors": [
{
"name": "Sebastian Bergmann",
"email": "sb@sebastian-bergmann.de",
"role": "lead"
}
],
"description": "Library that provides collection, processing, and rendering functionality for PHP code coverage information.",
"homepage": "https://github.com/sebastianbergmann/php-code-coverage",
"keywords": [
"coverage",
"testing",
"xunit"
],
"time": "2015-10-06T15:47:00+00:00"
},
{
"name": "phpunit/php-file-iterator",
"version": "1.4.5",
"source": {
"type": "git",
"url": "https://github.com/sebastianbergmann/php-file-iterator.git",
"reference": "730b01bc3e867237eaac355e06a36b85dd93a8b4"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/sebastianbergmann/php-file-iterator/zipball/730b01bc3e867237eaac355e06a36b85dd93a8b4",
"reference": "730b01bc3e867237eaac355e06a36b85dd93a8b4",
"shasum": ""
},
"require": {
"php": ">=5.3.3"
},
"type": "library",
"extra": {
"branch-alias": {
"dev-master": "1.4.x-dev"
}
},
"autoload": {
"classmap": [
"src/"
]
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"BSD-3-Clause"
],
"authors": [
{
"name": "Sebastian Bergmann",
"email": "sb@sebastian-bergmann.de",
"role": "lead"
}
],
"description": "FilterIterator implementation that filters files based on a list of suffixes.",
"homepage": "https://github.com/sebastianbergmann/php-file-iterator/",
"keywords": [
"filesystem",
"iterator"
],
"time": "2017-11-27T13:52:08+00:00"
},
{
"name": "phpunit/php-text-template",
"version": "1.2.1",
"source": {
"type": "git",
"url": "https://github.com/sebastianbergmann/php-text-template.git",
"reference": "31f8b717e51d9a2afca6c9f046f5d69fc27c8686"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/sebastianbergmann/php-text-template/zipball/31f8b717e51d9a2afca6c9f046f5d69fc27c8686",
"reference": "31f8b717e51d9a2afca6c9f046f5d69fc27c8686",
"shasum": ""
},
"require": {
"php": ">=5.3.3"
},
"type": "library",
"autoload": {
"classmap": [
"src/"
]
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"BSD-3-Clause"
],
"authors": [
{
"name": "Sebastian Bergmann",
"email": "sebastian@phpunit.de",
"role": "lead"
}
],
"description": "Simple template engine.",
"homepage": "https://github.com/sebastianbergmann/php-text-template/",
"keywords": [
"template"
],
"time": "2015-06-21T13:50:34+00:00"
},
{
"name": "phpunit/php-timer",
"version": "1.0.9",
"source": {
"type": "git",
"url": "https://github.com/sebastianbergmann/php-timer.git",
"reference": "3dcf38ca72b158baf0bc245e9184d3fdffa9c46f"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/sebastianbergmann/php-timer/zipball/3dcf38ca72b158baf0bc245e9184d3fdffa9c46f",
"reference": "3dcf38ca72b158baf0bc245e9184d3fdffa9c46f",
"shasum": ""
},
"require": {
"php": "^5.3.3 || ^7.0"
},
"require-dev": {
"phpunit/phpunit": "^4.8.35 || ^5.7 || ^6.0"
},
"type": "library",
"extra": {
"branch-alias": {
"dev-master": "1.0-dev"
}
},
"autoload": {
"classmap": [
"src/"
]
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"BSD-3-Clause"
],
"authors": [
{
"name": "Sebastian Bergmann",
"email": "sb@sebastian-bergmann.de",
"role": "lead"
}
],
"description": "Utility class for timing",
"homepage": "https://github.com/sebastianbergmann/php-timer/",
"keywords": [
"timer"
],
"time": "2017-02-26T11:10:40+00:00"
},
{
"name": "phpunit/php-token-stream",
"version": "1.4.12",
"source": {
"type": "git",
"url": "https://github.com/sebastianbergmann/php-token-stream.git",
"reference": "1ce90ba27c42e4e44e6d8458241466380b51fa16"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/sebastianbergmann/php-token-stream/zipball/1ce90ba27c42e4e44e6d8458241466380b51fa16",
"reference": "1ce90ba27c42e4e44e6d8458241466380b51fa16",
"shasum": ""
},
"require": {
"ext-tokenizer": "*",
"php": ">=5.3.3"
},
"require-dev": {
"phpunit/phpunit": "~4.2"
},
"type": "library",
"extra": {
"branch-alias": {
"dev-master": "1.4-dev"
}
},
"autoload": {
"classmap": [
"src/"
]
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"BSD-3-Clause"
],
"authors": [
{
"name": "Sebastian Bergmann",
"email": "sebastian@phpunit.de"
}
],
"description": "Wrapper around PHP's tokenizer extension.",
"homepage": "https://github.com/sebastianbergmann/php-token-stream/",
"keywords": [
"tokenizer"
],
"abandoned": true,
"time": "2017-12-04T08:55:13+00:00"
},
{
"name": "phpunit/phpunit",
"version": "4.8.36",
"source": {
"type": "git",
"url": "https://github.com/sebastianbergmann/phpunit.git",
"reference": "46023de9a91eec7dfb06cc56cb4e260017298517"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/46023de9a91eec7dfb06cc56cb4e260017298517",
"reference": "46023de9a91eec7dfb06cc56cb4e260017298517",
"shasum": ""
},
"require": {
"ext-dom": "*",
"ext-json": "*",
"ext-pcre": "*",
"ext-reflection": "*",
"ext-spl": "*",
"php": ">=5.3.3",
"phpspec/prophecy": "^1.3.1",
"phpunit/php-code-coverage": "~2.1",
"phpunit/php-file-iterator": "~1.4",
"phpunit/php-text-template": "~1.2",
"phpunit/php-timer": "^1.0.6",
"phpunit/phpunit-mock-objects": "~2.3",
"sebastian/comparator": "~1.2.2",
"sebastian/diff": "~1.2",
"sebastian/environment": "~1.3",
"sebastian/exporter": "~1.2",
"sebastian/global-state": "~1.0",
"sebastian/version": "~1.0",
"symfony/yaml": "~2.1|~3.0"
},
"suggest": {
"phpunit/php-invoker": "~1.1"
},
"bin": [
"phpunit"
],
"type": "library",
"extra": {
"branch-alias": {
"dev-master": "4.8.x-dev"
}
},
"autoload": {
"classmap": [
"src/"
]
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"BSD-3-Clause"
],
"authors": [
{
"name": "Sebastian Bergmann",
"email": "sebastian@phpunit.de",
"role": "lead"
}
],
"description": "The PHP Unit Testing framework.",
"homepage": "https://phpunit.de/",
"keywords": [
"phpunit",
"testing",
"xunit"
],
"time": "2017-06-21T08:07:12+00:00"
},
{
"name": "phpunit/phpunit-mock-objects",
"version": "2.3.8",
"source": {
"type": "git",
"url": "https://github.com/sebastianbergmann/phpunit-mock-objects.git",
"reference": "ac8e7a3db35738d56ee9a76e78a4e03d97628983"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/sebastianbergmann/phpunit-mock-objects/zipball/ac8e7a3db35738d56ee9a76e78a4e03d97628983",
"reference": "ac8e7a3db35738d56ee9a76e78a4e03d97628983",
"shasum": ""
},
"require": {
"doctrine/instantiator": "^1.0.2",
"php": ">=5.3.3",
"phpunit/php-text-template": "~1.2",
"sebastian/exporter": "~1.2"
},
"require-dev": {
"phpunit/phpunit": "~4.4"
},
"suggest": {
"ext-soap": "*"
},
"type": "library",
"extra": {
"branch-alias": {
"dev-master": "2.3.x-dev"
}
},
"autoload": {
"classmap": [
"src/"
]
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"BSD-3-Clause"
],
"authors": [
{
"name": "Sebastian Bergmann",
"email": "sb@sebastian-bergmann.de",
"role": "lead"
}
],
"description": "Mock Object library for PHPUnit",
"homepage": "https://github.com/sebastianbergmann/phpunit-mock-objects/",
"keywords": [
"mock",
"xunit"
],
"abandoned": true,
"time": "2015-10-02T06:51:40+00:00"
},
{
"name": "phpunit/phpunit-selenium",
"version": "1.4.2",
"source": {
"type": "git",
"url": "https://github.com/giorgiosironi/phpunit-selenium.git",
"reference": "c84dd7ca214563868ce216123b7ae9c792beb262"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/giorgiosironi/phpunit-selenium/zipball/c84dd7ca214563868ce216123b7ae9c792beb262",
"reference": "c84dd7ca214563868ce216123b7ae9c792beb262",
"shasum": ""
},
"require": {
"ext-curl": "*",
"ext-dom": "*",
"php": ">=5.3.3",
"phpunit/phpunit": "~3.7|~4.0",
"sebastian/comparator": "~1.0"
},
"type": "library",
"autoload": {
"classmap": [
"PHPUnit/"
]
},
"notification-url": "https://packagist.org/downloads/",
"include-path": [
""
],
"license": [
"BSD-3-Clause"
],
"authors": [
{
"name": "Sebastian Bergmann",
"email": "sb@sebastian-bergmann.de",
"role": "lead"
},
{
"name": "Giorgio Sironi",
"email": "info@giorgiosironi.com",
"role": "developer"
}
],
"description": "Selenium Server integration for PHPUnit",
"homepage": "http://www.phpunit.de/",
"keywords": [
"selenium",
"testing",
"xunit"
],
"time": "2014-11-02T09:23:27+00:00"
},
{
"name": "psr/log",
"version": "1.1.3",
"source": {
"type": "git",
"url": "https://github.com/php-fig/log.git",
"reference": "0f73288fd15629204f9d42b7055f72dacbe811fc"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/php-fig/log/zipball/0f73288fd15629204f9d42b7055f72dacbe811fc",
"reference": "0f73288fd15629204f9d42b7055f72dacbe811fc",
"shasum": ""
},
"require": {
"php": ">=5.3.0"
},
"type": "library",
"extra": {
"branch-alias": {
"dev-master": "1.1.x-dev"
}
},
"autoload": {
"psr-4": {
"Psr\\Log\\": "Psr/Log/"
}
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
"authors": [
{
"name": "PHP-FIG",
"homepage": "http://www.php-fig.org/"
}
],
"description": "Common interface for logging libraries",
"homepage": "https://github.com/php-fig/log",
"keywords": [
"log",
"psr",
"psr-3"
],
"time": "2020-03-23T09:12:05+00:00"
},
{
"name": "sebastian/comparator",
"version": "1.2.4",
"source": {
"type": "git",
"url": "https://github.com/sebastianbergmann/comparator.git",
"reference": "2b7424b55f5047b47ac6e5ccb20b2aea4011d9be"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/sebastianbergmann/comparator/zipball/2b7424b55f5047b47ac6e5ccb20b2aea4011d9be",
"reference": "2b7424b55f5047b47ac6e5ccb20b2aea4011d9be",
"shasum": ""
},
"require": {
"php": ">=5.3.3",
"sebastian/diff": "~1.2",
"sebastian/exporter": "~1.2 || ~2.0"
},
"require-dev": {
"phpunit/phpunit": "~4.4"
},
"type": "library",
"extra": {
"branch-alias": {
"dev-master": "1.2.x-dev"
}
},
"autoload": {
"classmap": [
"src/"
]
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"BSD-3-Clause"
],
"authors": [
{
"name": "Jeff Welch",
"email": "whatthejeff@gmail.com"
},
{
"name": "Volker Dusch",
"email": "github@wallbash.com"
},
{
"name": "Bernhard Schussek",
"email": "bschussek@2bepublished.at"
},
{
"name": "Sebastian Bergmann",
"email": "sebastian@phpunit.de"
}
],
"description": "Provides the functionality to compare PHP values for equality",
"homepage": "http://www.github.com/sebastianbergmann/comparator",
"keywords": [
"comparator",
"compare",
"equality"
],
"time": "2017-01-29T09:50:25+00:00"
},
{
"name": "sebastian/diff",
"version": "1.4.3",
"source": {
"type": "git",
"url": "https://github.com/sebastianbergmann/diff.git",
"reference": "7f066a26a962dbe58ddea9f72a4e82874a3975a4"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/sebastianbergmann/diff/zipball/7f066a26a962dbe58ddea9f72a4e82874a3975a4",
"reference": "7f066a26a962dbe58ddea9f72a4e82874a3975a4",
"shasum": ""
},
"require": {
"php": "^5.3.3 || ^7.0"
},
"require-dev": {
"phpunit/phpunit": "^4.8.35 || ^5.7 || ^6.0"
},
"type": "library",
"extra": {
"branch-alias": {
"dev-master": "1.4-dev"
}
},
"autoload": {
"classmap": [
"src/"
]
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"BSD-3-Clause"
],
"authors": [
{
"name": "Kore Nordmann",
"email": "mail@kore-nordmann.de"
},
{
"name": "Sebastian Bergmann",
"email": "sebastian@phpunit.de"
}
],
"description": "Diff implementation",
"homepage": "https://github.com/sebastianbergmann/diff",
"keywords": [
"diff"
],
"time": "2017-05-22T07:24:03+00:00"
},
{
"name": "sebastian/environment",
"version": "1.3.8",
"source": {
"type": "git",
"url": "https://github.com/sebastianbergmann/environment.git",
"reference": "be2c607e43ce4c89ecd60e75c6a85c126e754aea"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/sebastianbergmann/environment/zipball/be2c607e43ce4c89ecd60e75c6a85c126e754aea",
"reference": "be2c607e43ce4c89ecd60e75c6a85c126e754aea",
"shasum": ""
},
"require": {
"php": "^5.3.3 || ^7.0"
},
"require-dev": {
"phpunit/phpunit": "^4.8 || ^5.0"
},
"type": "library",
"extra": {
"branch-alias": {
"dev-master": "1.3.x-dev"
}
},
"autoload": {
"classmap": [
"src/"
]
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"BSD-3-Clause"
],
"authors": [
{
"name": "Sebastian Bergmann",
"email": "sebastian@phpunit.de"
}
],
"description": "Provides functionality to handle HHVM/PHP environments",
"homepage": "http://www.github.com/sebastianbergmann/environment",
"keywords": [
"Xdebug",
"environment",
"hhvm"
],
"time": "2016-08-18T05:49:44+00:00"
},
{
"name": "sebastian/exporter",
"version": "1.2.2",
"source": {
"type": "git",
"url": "https://github.com/sebastianbergmann/exporter.git",
"reference": "42c4c2eec485ee3e159ec9884f95b431287edde4"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/sebastianbergmann/exporter/zipball/42c4c2eec485ee3e159ec9884f95b431287edde4",
"reference": "42c4c2eec485ee3e159ec9884f95b431287edde4",
"shasum": ""
},
"require": {
"php": ">=5.3.3",
"sebastian/recursion-context": "~1.0"
},
"require-dev": {
"ext-mbstring": "*",
"phpunit/phpunit": "~4.4"
},
"type": "library",
"extra": {
"branch-alias": {
"dev-master": "1.3.x-dev"
}
},
"autoload": {
"classmap": [
"src/"
]
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"BSD-3-Clause"
],
"authors": [
{
"name": "Jeff Welch",
"email": "whatthejeff@gmail.com"
},
{
"name": "Volker Dusch",
"email": "github@wallbash.com"
},
{
"name": "Bernhard Schussek",
"email": "bschussek@2bepublished.at"
},
{
"name": "Sebastian Bergmann",
"email": "sebastian@phpunit.de"
},
{
"name": "Adam Harvey",
"email": "aharvey@php.net"
}
],
"description": "Provides the functionality to export PHP variables for visualization",
"homepage": "http://www.github.com/sebastianbergmann/exporter",
"keywords": [
"export",
"exporter"
],
"time": "2016-06-17T09:04:28+00:00"
},
{
"name": "sebastian/global-state",
"version": "1.1.1",
"source": {
"type": "git",
"url": "https://github.com/sebastianbergmann/global-state.git",
"reference": "bc37d50fea7d017d3d340f230811c9f1d7280af4"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/sebastianbergmann/global-state/zipball/bc37d50fea7d017d3d340f230811c9f1d7280af4",
"reference": "bc37d50fea7d017d3d340f230811c9f1d7280af4",
"shasum": ""
},
"require": {
"php": ">=5.3.3"
},
"require-dev": {
"phpunit/phpunit": "~4.2"
},
"suggest": {
"ext-uopz": "*"
},
"type": "library",
"extra": {
"branch-alias": {
"dev-master": "1.0-dev"
}
},
"autoload": {
"classmap": [
"src/"
]
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"BSD-3-Clause"
],
"authors": [
{
"name": "Sebastian Bergmann",
"email": "sebastian@phpunit.de"
}
],
"description": "Snapshotting of global state",
"homepage": "http://www.github.com/sebastianbergmann/global-state",
"keywords": [
"global state"
],
"time": "2015-10-12T03:26:01+00:00"
},
{
"name": "sebastian/recursion-context",
"version": "1.0.5",
"source": {
"type": "git",
"url": "https://github.com/sebastianbergmann/recursion-context.git",
"reference": "b19cc3298482a335a95f3016d2f8a6950f0fbcd7"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/sebastianbergmann/recursion-context/zipball/b19cc3298482a335a95f3016d2f8a6950f0fbcd7",
"reference": "b19cc3298482a335a95f3016d2f8a6950f0fbcd7",
"shasum": ""
},
"require": {
"php": ">=5.3.3"
},
"require-dev": {
"phpunit/phpunit": "~4.4"
},
"type": "library",
"extra": {
"branch-alias": {
"dev-master": "1.0.x-dev"
}
},
"autoload": {
"classmap": [
"src/"
]
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"BSD-3-Clause"
],
"authors": [
{
"name": "Jeff Welch",
"email": "whatthejeff@gmail.com"
},
{
"name": "Sebastian Bergmann",
"email": "sebastian@phpunit.de"
},
{
"name": "Adam Harvey",
"email": "aharvey@php.net"
}
],
"description": "Provides functionality to recursively process PHP variables",
"homepage": "http://www.github.com/sebastianbergmann/recursion-context",
"time": "2016-10-03T07:41:43+00:00"
},
{
"name": "sebastian/version",
"version": "1.0.6",
"source": {
"type": "git",
"url": "https://github.com/sebastianbergmann/version.git",
"reference": "58b3a85e7999757d6ad81c787a1fbf5ff6c628c6"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/sebastianbergmann/version/zipball/58b3a85e7999757d6ad81c787a1fbf5ff6c628c6",
"reference": "58b3a85e7999757d6ad81c787a1fbf5ff6c628c6",
"shasum": ""
},
"type": "library",
"autoload": {
"classmap": [
"src/"
]
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"BSD-3-Clause"
],
"authors": [
{
"name": "Sebastian Bergmann",
"email": "sebastian@phpunit.de",
"role": "lead"
}
],
"description": "Library that helps with managing the version number of Git-hosted PHP projects",
"homepage": "https://github.com/sebastianbergmann/version",
"time": "2015-06-21T13:59:46+00:00"
},
{
"name": "squizlabs/php_codesniffer",
"version": "3.5.6",
"source": {
"type": "git",
"url": "https://github.com/squizlabs/PHP_CodeSniffer.git",
"reference": "e97627871a7eab2f70e59166072a6b767d5834e0"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/squizlabs/PHP_CodeSniffer/zipball/e97627871a7eab2f70e59166072a6b767d5834e0",
"reference": "e97627871a7eab2f70e59166072a6b767d5834e0",
"shasum": ""
},
"require": {
"ext-simplexml": "*",
"ext-tokenizer": "*",
"ext-xmlwriter": "*",
"php": ">=5.4.0"
},
"require-dev": {
"phpunit/phpunit": "^4.0 || ^5.0 || ^6.0 || ^7.0"
},
"bin": [
"bin/phpcs",
"bin/phpcbf"
],
"type": "library",
"extra": {
"branch-alias": {
"dev-master": "3.x-dev"
}
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"BSD-3-Clause"
],
"authors": [
{
"name": "Greg Sherwood",
"role": "lead"
}
],
"description": "PHP_CodeSniffer tokenizes PHP, JavaScript and CSS files and detects violations of a defined set of coding standards.",
"homepage": "https://github.com/squizlabs/PHP_CodeSniffer",
"keywords": [
"phpcs",
"standards"
],
"time": "2020-08-10T04:50:15+00:00"
},
{
"name": "symfony/console",
"version": "v2.8.52",
"source": {
"type": "git",
"url": "https://github.com/symfony/console.git",
"reference": "cbcf4b5e233af15cd2bbd50dee1ccc9b7927dc12"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/symfony/console/zipball/cbcf4b5e233af15cd2bbd50dee1ccc9b7927dc12",
"reference": "cbcf4b5e233af15cd2bbd50dee1ccc9b7927dc12",
"shasum": ""
},
"require": {
"php": ">=5.3.9",
"symfony/debug": "^2.7.2|~3.0.0",
"symfony/polyfill-mbstring": "~1.0"
},
"require-dev": {
"psr/log": "~1.0",
"symfony/event-dispatcher": "~2.1|~3.0.0",
"symfony/process": "~2.1|~3.0.0"
},
"suggest": {
"psr/log-implementation": "For using the console logger",
"symfony/event-dispatcher": "",
"symfony/process": ""
},
"type": "library",
"extra": {
"branch-alias": {
"dev-master": "2.8-dev"
}
},
"autoload": {
"psr-4": {
"Symfony\\Component\\Console\\": ""
},
"exclude-from-classmap": [
"/Tests/"
]
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
"authors": [
{
"name": "Fabien Potencier",
"email": "fabien@symfony.com"
},
{
"name": "Symfony Community",
"homepage": "https://symfony.com/contributors"
}
],
"description": "Symfony Console Component",
"homepage": "https://symfony.com",
"time": "2018-11-20T15:55:20+00:00"
},
{
"name": "symfony/debug",
"version": "v2.8.52",
"source": {
"type": "git",
"url": "https://github.com/symfony/debug.git",
"reference": "74251c8d50dd3be7c4ce0c7b862497cdc641a5d0"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/symfony/debug/zipball/74251c8d50dd3be7c4ce0c7b862497cdc641a5d0",
"reference": "74251c8d50dd3be7c4ce0c7b862497cdc641a5d0",
"shasum": ""
},
"require": {
"php": ">=5.3.9",
"psr/log": "~1.0"
},
"conflict": {
"symfony/http-kernel": ">=2.3,<2.3.24|~2.4.0|>=2.5,<2.5.9|>=2.6,<2.6.2"
},
"require-dev": {
"symfony/class-loader": "~2.2|~3.0.0",
"symfony/http-kernel": "~2.3.24|~2.5.9|^2.6.2|~3.0.0"
},
"type": "library",
"extra": {
"branch-alias": {
"dev-master": "2.8-dev"
}
},
"autoload": {
"psr-4": {
"Symfony\\Component\\Debug\\": ""
},
"exclude-from-classmap": [
"/Tests/"
]
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
"authors": [
{
"name": "Fabien Potencier",
"email": "fabien@symfony.com"
},
{
"name": "Symfony Community",
"homepage": "https://symfony.com/contributors"
}
],
"description": "Symfony Debug Component",
"homepage": "https://symfony.com",
"time": "2018-11-11T11:18:13+00:00"
},
{
"name": "symfony/process",
"version": "v2.8.52",
"source": {
"type": "git",
"url": "https://github.com/symfony/process.git",
"reference": "c3591a09c78639822b0b290d44edb69bf9f05dc8"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/symfony/process/zipball/c3591a09c78639822b0b290d44edb69bf9f05dc8",
"reference": "c3591a09c78639822b0b290d44edb69bf9f05dc8",
"shasum": ""
},
"require": {
"php": ">=5.3.9"
},
"type": "library",
"extra": {
"branch-alias": {
"dev-master": "2.8-dev"
}
},
"autoload": {
"psr-4": {
"Symfony\\Component\\Process\\": ""
},
"exclude-from-classmap": [
"/Tests/"
]
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
"authors": [
{
"name": "Fabien Potencier",
"email": "fabien@symfony.com"
},
{
"name": "Symfony Community",
"homepage": "https://symfony.com/contributors"
}
],
"description": "Symfony Process Component",
"homepage": "https://symfony.com",
"time": "2018-11-11T11:18:13+00:00"
},
{
"name": "symfony/yaml",
"version": "v2.8.52",
"source": {
"type": "git",
"url": "https://github.com/symfony/yaml.git",
"reference": "02c1859112aa779d9ab394ae4f3381911d84052b"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/symfony/yaml/zipball/02c1859112aa779d9ab394ae4f3381911d84052b",
"reference": "02c1859112aa779d9ab394ae4f3381911d84052b",
"shasum": ""
},
"require": {
"php": ">=5.3.9",
"symfony/polyfill-ctype": "~1.8"
},
"type": "library",
"extra": {
"branch-alias": {
"dev-master": "2.8-dev"
}
},
"autoload": {
"psr-4": {
"Symfony\\Component\\Yaml\\": ""
},
"exclude-from-classmap": [
"/Tests/"
]
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
"authors": [
{
"name": "Fabien Potencier",
"email": "fabien@symfony.com"
},
{
"name": "Symfony Community",
"homepage": "https://symfony.com/contributors"
}
],
"description": "Symfony Yaml Component",
"homepage": "https://symfony.com",
"time": "2018-11-11T11:18:13+00:00"
},
{
"name": "webmozart/assert",
"version": "1.9.1",
"source": {
"type": "git",
"url": "https://github.com/webmozart/assert.git",
"reference": "bafc69caeb4d49c39fd0779086c03a3738cbb389"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/webmozart/assert/zipball/bafc69caeb4d49c39fd0779086c03a3738cbb389",
"reference": "bafc69caeb4d49c39fd0779086c03a3738cbb389",
"shasum": ""
},
"require": {
"php": "^5.3.3 || ^7.0 || ^8.0",
"symfony/polyfill-ctype": "^1.8"
},
"conflict": {
"phpstan/phpstan": "<0.12.20",
"vimeo/psalm": "<3.9.1"
},
"require-dev": {
"phpunit/phpunit": "^4.8.36 || ^7.5.13"
},
"type": "library",
"autoload": {
"psr-4": {
"Webmozart\\Assert\\": "src/"
}
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
"authors": [
{
"name": "Bernhard Schussek",
"email": "bschussek@gmail.com"
}
],
"description": "Assertions to validate method input/output with nice error messages.",
"keywords": [
"assert",
"check",
"validate"
],
"time": "2020-07-08T17:02:28+00:00"
}
],
"aliases": [],
"minimum-stability": "stable",
"stability-flags": [],
"prefer-stable": false,
"prefer-lowest": false,
"platform": {
"php": ">=5.5.0",
"ext-mysqli": "*",
"ext-xml": "*",
"ext-pcre": "*",
"ext-json": "*",
"ext-ctype": "*",
"ext-hash": "*"
},
"platform-dev": [],
"platform-overrides": {
"php": "5.5"
},
"plugin-api-version": "1.1.0"
}
login/libraries/check_user_privileges.inc.php 0000644 00000001506 15155311537 0015465 0 ustar 00 getCurrentUserAndHost();
if ($username === '') { // MySQL is started with --skip-grant-tables
$GLOBALS['is_create_db_priv'] = true;
$GLOBALS['is_reload_priv'] = true;
$GLOBALS['db_to_create'] = '';
$GLOBALS['dbs_where_create_table_allowed'] = array('*');
$GLOBALS['dbs_to_test'] = false;
$GLOBALS['db_priv'] = true;
$GLOBALS['col_priv'] = true;
$GLOBALS['table_priv'] = true;
$GLOBALS['proc_priv'] = true;
} else {
$checkUserPrivileges->analyseShowGrant();
}
login/libraries/mult_submits.inc.php 0000644 00000025323 15155311537 0013653 0 ustar 00 getVirtualTables($db);
list($full_query, $reload, $full_query_views)
= $multSubmits->getQueryFromSelected(
$submit_mult, $table, $selected, $views
);
$_url_params = $multSubmits->getUrlParams(
$submit_mult, $reload, $action, $db, $table, $selected, $views,
isset($original_sql_query)? $original_sql_query : null,
isset($original_url_query)? $original_url_query : null
);
$response->disable();
$response->addHTML(
$multSubmits->getHtmlForCopyMultipleTables($action, $_url_params)
);
exit;
case 'show_create':
$show_create = Template::get(
'database/structure/show_create'
)
->render(
array(
'db' => $GLOBALS['db'],
'db_objects' => $selected,
'dbi' => $GLOBALS['dbi'],
)
);
// Send response to client.
$response->addJSON('message', $show_create);
exit;
case 'sync_unique_columns_central_list':
$centralColsError = $centralColumns->syncUniqueColumns(
$selected
);
break;
case 'delete_unique_columns_central_list':
$centralColsError = $centralColumns->deleteColumnsFromList(
$selected
);
break;
case 'make_consistent_with_central_list':
$centralColsError = $centralColumns->makeConsistentWithList(
$GLOBALS['db'],
$selected
);
break;
} // end switch
} elseif (isset($selected_fld) && !empty($selected_fld)) {
// coming from table structure view - do something with
// selected columns
// handled in StructrueController
} else {
// coming from browsing - do something with selected rows
$what = 'row_delete';
$selected = $_REQUEST['rows_to_delete'];
}
} // end if
if (empty($db)) {
$db = '';
}
if (empty($table)) {
$table = '';
}
$views = $GLOBALS['dbi']->getVirtualTables($db);
/**
* Displays the confirmation form if required
*/
if (!empty($submit_mult) && !empty($what)) {
unset($message);
if (strlen($table) > 0) {
include './libraries/tbl_common.inc.php';
$url_query .= '&goto=tbl_sql.php&back=tbl_sql.php';
} elseif (strlen($db) > 0) {
include './libraries/db_common.inc.php';
list(
$tables,
$num_tables,
$total_num_tables,
$sub_part,
$is_show_stats,
$db_is_system_schema,
$tooltip_truename,
$tooltip_aliasname,
$pos
) = Util::getDbInfo($db, isset($sub_part) ? $sub_part : '');
} else {
include_once './libraries/server_common.inc.php';
}
// Builds the query
list($full_query, $reload, $full_query_views)
= $multSubmits->getQueryFromSelected(
$what, $table, $selected, $views
);
// Displays the confirmation form
$_url_params = $multSubmits->getUrlParams(
$what, $reload, $action, $db, $table, $selected, $views,
isset($original_sql_query)? $original_sql_query : null,
isset($original_url_query)? $original_url_query : null
);
if ($what == 'replace_prefix_tbl' || $what == 'copy_tbl_change_prefix') {
$response->disable();
$response->addHTML(
$multSubmits->getHtmlForReplacePrefixTable($action, $_url_params)
);
} elseif ($what == 'add_prefix_tbl') {
$response->disable();
$response->addHTML($multSubmits->getHtmlForAddPrefixTable($action, $_url_params));
} else {
$response->addHTML(
$multSubmits->getHtmlForOtherActions($what, $action, $_url_params, $full_query)
);
}
exit;
} elseif (! empty($mult_btn) && $mult_btn == __('Yes')) {
/**
* Executes the query - dropping rows, columns/fields, tables or dbs
*/
if ($query_type == 'primary_fld') {
// Gets table primary key
$GLOBALS['dbi']->selectDb($db);
$result = $GLOBALS['dbi']->query(
'SHOW KEYS FROM ' . Util::backquote($table) . ';'
);
$primary = '';
while ($row = $GLOBALS['dbi']->fetchAssoc($result)) {
// Backups the list of primary keys
if ($row['Key_name'] == 'PRIMARY') {
$primary .= $row['Column_name'] . ', ';
}
} // end while
$GLOBALS['dbi']->freeResult($result);
}
if ($query_type == 'drop_tbl'
|| $query_type == 'empty_tbl'
|| $query_type == 'row_delete'
) {
$default_fk_check_value = Util::handleDisableFKCheckInit();
}
list(
$result, $rebuild_database_list, $reload_ret,
$run_parts, $execute_query_later, $sql_query, $sql_query_views
) = $multSubmits->buildOrExecuteQuery(
$query_type, $selected, $db, $table, $views,
isset($primary) ? $primary : null,
isset($from_prefix) ? $from_prefix : null,
isset($to_prefix) ? $to_prefix : null
);
//update the existed variable
if (isset($reload_ret)) {
$reload = $reload_ret;
}
if ($query_type == 'drop_tbl') {
if (!empty($sql_query)) {
$sql_query .= ';';
} elseif (!empty($sql_query_views)) {
$sql_query = $sql_query_views . ';';
unset($sql_query_views);
}
}
// Unset cache values for tables count, issue #14205
if ($query_type === 'drop_tbl' && isset($_SESSION['tmpval'])) {
if (isset($_SESSION['tmpval']['table_limit_offset'])) {
unset($_SESSION['tmpval']['table_limit_offset']);
}
if (isset($_SESSION['tmpval']['table_limit_offset_db'])) {
unset($_SESSION['tmpval']['table_limit_offset_db']);
}
}
if ($execute_query_later) {
$sql = new Sql();
$sql->executeQueryAndSendQueryResponse(
null, // analyzed_sql_results
false, // is_gotofile
$db, // db
$table, // table
null, // find_real_end
null, // sql_query_for_bookmark
null, // extra_data
null, // message_to_show
null, // message
null, // sql_data
$goto, // goto
$pmaThemeImage, // pmaThemeImage
null, // disp_query
null, // disp_message
$query_type, // query_type
$sql_query, // sql_query
$selected, // selectedTables
null // complete_query
);
} elseif (!$run_parts) {
$GLOBALS['dbi']->selectDb($db);
$result = $GLOBALS['dbi']->tryQuery($sql_query);
if ($result && !empty($sql_query_views)) {
$sql_query .= ' ' . $sql_query_views . ';';
$result = $GLOBALS['dbi']->tryQuery($sql_query_views);
unset($sql_query_views);
}
if (! $result) {
$message = Message::error($GLOBALS['dbi']->getError());
}
}
if ($query_type == 'drop_tbl'
|| $query_type == 'empty_tbl'
|| $query_type == 'row_delete'
) {
Util::handleDisableFKCheckCleanup($default_fk_check_value);
}
if ($rebuild_database_list) {
// avoid a problem with the database list navigator
// when dropping a db from server_databases
$GLOBALS['dblist']->databases->build();
}
} else {
if (isset($submit_mult)
&& ($submit_mult == 'sync_unique_columns_central_list'
|| $submit_mult == 'delete_unique_columns_central_list'
|| $submit_mult == 'add_to_central_columns'
|| $submit_mult == 'remove_from_central_columns'
|| $submit_mult == 'make_consistent_with_central_list')
) {
if (isset($centralColsError) && $centralColsError !== true) {
$message = $centralColsError;
} else {
$message = Message::success(__('Success!'));
}
} else {
$message = Message::success(__('No change'));
}
}
login/libraries/user_preferences.inc.php 0000644 00000004400 15155311537 0014454 0 ustar 00 'b_tblops',
'Sql' => 'b_sql',
'Navi' => 'b_select',
'Main' => 'b_props',
'Import' => 'b_import',
'Export' => 'b_export');
$content = PhpMyAdmin\Util::getHtmlTab(
array(
'link' => 'prefs_manage.php',
'text' => __('Manage your settings')
)
) . "\n";
/* Second authentication factor */
$content .= PhpMyAdmin\Util::getHtmlTab(
array(
'link' => 'prefs_twofactor.php',
'text' => __('Two-factor authentication')
)
) . "\n";
$script_name = basename($GLOBALS['PMA_PHP_SELF']);
foreach (UserFormList::getAll() as $formset) {
$formset_class = UserFormList::get($formset);
$tab = array(
'link' => 'prefs_forms.php',
'text' => $formset_class::getName(),
'icon' => $tabs_icons[$formset],
'active' => ($script_name == 'prefs_forms.php' && $formset == $form_param));
$content .= PhpMyAdmin\Util::getHtmlTab($tab, array('form' => $formset))
. "\n";
}
echo PhpMyAdmin\Template::get('list/unordered')->render(
array(
'id' => 'topmenu2',
'class' => 'user_prefs_tabs',
'content' => $content,
)
);
echo '';
// show "configuration saved" message and reload navigation panel if needed
if (!empty($_GET['saved'])) {
Message::rawSuccess(__('Configuration has been saved.'))->display();
}
// warn about using session storage for settings
$relation = new Relation();
$cfgRelation = $relation->getRelationsParam();
if (! $cfgRelation['userconfigwork']) {
$msg = __(
'Your preferences will be saved for current session only. Storing them '
. 'permanently requires %sphpMyAdmin configuration storage%s.'
);
$msg = Sanitize::sanitize(
sprintf($msg, '[doc@linked-tables]', '[/doc]')
);
Message::notice($msg)->display();
}
login/libraries/replication.inc.php 0000644 00000010541 15155311537 0013431 0 ustar 00 fetchResult('SHOW MASTER STATUS');
/**
* set selected master server
*/
if (! empty($_POST['master_connection'])) {
/**
* check for multi-master replication functionality
*/
$server_slave_multi_replication = $GLOBALS['dbi']->fetchResult(
'SHOW ALL SLAVES STATUS'
);
if ($server_slave_multi_replication) {
$GLOBALS['dbi']->query(
"SET @@default_master_connection = '"
. $GLOBALS['dbi']->escapeString(
$_POST['master_connection']
) . "'"
);
$GLOBALS['url_params']['master_connection'] = $_POST['master_connection'];
}
}
/**
* get slave replication from server
*/
$server_slave_replication = $GLOBALS['dbi']->fetchResult('SHOW SLAVE STATUS');
/**
* replication types
*/
$replication_types = array('master', 'slave');
/**
* define variables for master status
*/
$master_variables = array(
'File',
'Position',
'Binlog_Do_DB',
'Binlog_Ignore_DB',
);
/**
* Define variables for slave status
*/
$slave_variables = array(
'Slave_IO_State',
'Master_Host',
'Master_User',
'Master_Port',
'Connect_Retry',
'Master_Log_File',
'Read_Master_Log_Pos',
'Relay_Log_File',
'Relay_Log_Pos',
'Relay_Master_Log_File',
'Slave_IO_Running',
'Slave_SQL_Running',
'Replicate_Do_DB',
'Replicate_Ignore_DB',
'Replicate_Do_Table',
'Replicate_Ignore_Table',
'Replicate_Wild_Do_Table',
'Replicate_Wild_Ignore_Table',
'Last_Errno',
'Last_Error',
'Skip_Counter',
'Exec_Master_Log_Pos',
'Relay_Log_Space',
'Until_Condition',
'Until_Log_File',
'Until_Log_Pos',
'Master_SSL_Allowed',
'Master_SSL_CA_File',
'Master_SSL_CA_Path',
'Master_SSL_Cert',
'Master_SSL_Cipher',
'Master_SSL_Key',
'Seconds_Behind_Master',
);
/**
* define important variables, which need to be watched for
* correct running of replication in slave mode
*
* @usedby PhpMyAdmin\ReplicationGui::getHtmlForReplicationStatusTable()
*/
// TODO change to regexp or something, to allow for negative match.
// To e.g. highlight 'Last_Error'
//
$slave_variables_alerts = array(
'Slave_IO_Running' => 'No',
'Slave_SQL_Running' => 'No',
);
$slave_variables_oks = array(
'Slave_IO_Running' => 'Yes',
'Slave_SQL_Running' => 'Yes',
);
// check which replication is available and
// set $server_{master/slave}_status and assign values
// replication info is more easily passed to functions
$GLOBALS['replication_info'] = array();
foreach ($replication_types as $type) {
if (count(${"server_{$type}_replication"}) > 0) {
$GLOBALS['replication_info'][$type]['status'] = true;
} else {
$GLOBALS['replication_info'][$type]['status'] = false;
}
if ($GLOBALS['replication_info'][$type]['status']) {
if ($type == "master") {
Replication::fillInfo(
$type, 'Do_DB', $server_master_replication[0],
'Binlog_Do_DB'
);
Replication::fillInfo(
$type, 'Ignore_DB', $server_master_replication[0],
'Binlog_Ignore_DB'
);
} elseif ($type == "slave") {
Replication::fillInfo(
$type, 'Do_DB', $server_slave_replication[0],
'Replicate_Do_DB'
);
Replication::fillInfo(
$type, 'Ignore_DB', $server_slave_replication[0],
'Replicate_Ignore_DB'
);
Replication::fillInfo(
$type, 'Do_Table', $server_slave_replication[0],
'Replicate_Do_Table'
);
Replication::fillInfo(
$type, 'Ignore_Table', $server_slave_replication[0],
'Replicate_Ignore_Table'
);
Replication::fillInfo(
$type, 'Wild_Do_Table', $server_slave_replication[0],
'Replicate_Wild_Do_Table'
);
Replication::fillInfo(
$type, 'Wild_Ignore_Table', $server_slave_replication[0],
'Replicate_Wild_Ignore_Table'
);
}
}
}
login/libraries/hash.lib.php 0000644 00000001112 15155311537 0012032 0 ustar 00 0]
Slow_queries / Questions * 100
value >= 5
There is a lot of slow queries compared to the overall amount of Queries.
You might want to increase {long_query_time} or optimize the queries listed in the slow query log
The slow query rate should be below 5%, your value is %s%. | round(value,2)
rule 'Slow query rate' [Questions > 0]
(Slow_queries / Questions * 100) / Uptime
value * 60 * 60 > 1
There is a high percentage of slow queries compared to the server uptime.
You might want to increase {long_query_time} or optimize the queries listed in the slow query log
You have a slow query rate of %s per hour, you should have less than 1% per hour. | ADVISOR_bytime(value,2)
rule 'Long query time'
long_query_time
value >= 10
{long_query_time} is set to 10 seconds or more, thus only slow queries that take above 10 seconds are logged.
It is suggested to set {long_query_time} to a lower value, depending on your environment. Usually a value of 1-5 seconds is suggested.
long_query_time is currently set to %ds. | value
rule 'Slow query logging' [PMA_MYSQL_INT_VERSION < 50600]
log_slow_queries
value == 'OFF'
The slow query log is disabled.
Enable slow query logging by setting {log_slow_queries} to 'ON'. This will help troubleshooting badly performing queries.
log_slow_queries is set to 'OFF'
rule 'Slow query logging' [PMA_MYSQL_INT_VERSION >= 50600]
slow_query_log
value == 'OFF'
The slow query log is disabled.
Enable slow query logging by setting {slow_query_log} to 'ON'. This will help troubleshooting badly performing queries.
slow_query_log is set to 'OFF'
#
# versions
rule 'Release Series'
version
substr(value,0,2) <= '5.' && substr(value,2,1) < 1
The MySQL server version less than 5.1.
You should upgrade, as MySQL 5.1 has improved performance, and MySQL 5.5 even more so.
Current version: %s | value
rule 'Minor Version' [! fired('Release Series')]
version
substr(value,0,2) <= '5.' && substr(value,2,1) <= 1 && substr(value,4,2) < 30
Version less than 5.1.30 (the first GA release of 5.1).
You should upgrade, as recent versions of MySQL 5.1 have improved performance and MySQL 5.5 even more so.
Current version: %s | value
rule 'Minor Version' [! fired('Release Series')]
version
substr(value,0,1) == 5 && substr(value,2,1) == 5 && substr(value,4,2) < 8
Version less than 5.5.8 (the first GA release of 5.5).
You should upgrade, to a stable version of MySQL 5.5.
Current version: %s | value
rule 'Distribution'
version_comment
preg_match('/source/i',value)
Version is compiled from source, not a MySQL official binary.
If you did not compile from source, you may be using a package modified by a distribution. The MySQL manual only is accurate for official MySQL binaries, not any package distributions (such as RedHat, Debian/Ubuntu etc).
'source' found in version_comment
rule 'Distribution'
version_comment
preg_match('/percona/i',value)
The MySQL manual only is accurate for official MySQL binaries.
Percona documentation is at https://www.percona.com/software/documentation/
'percona' found in version_comment
rule 'MySQL Architecture'
system_memory
value > 3072*1024 && !preg_match('/64/',version_compile_machine) && !preg_match('/64/',version_compile_os)
MySQL is not compiled as a 64-bit package.
Your memory capacity is above 3 GiB (assuming the Server is on localhost), so MySQL might not be able to access all of your memory. You might want to consider installing the 64-bit version of MySQL.
Available memory on this host: %s | ADVISOR_formatByteDown(value*1024, 2, 2)
#
# Query cache
rule 'Query caching method' [!fired('Query cache disabled')]
Questions / Uptime
value > 100
Suboptimal caching method.
You are using the MySQL Query cache with a fairly high traffic database. It might be worth considering to use memcached instead of the MySQL Query cache, especially if you have multiple slaves.
The query cache is enabled and the server receives %d queries per second. This rule fires if there is more than 100 queries per second. | round(value,1)
#
# Sorts
rule 'Percentage of sorts that cause temporary tables' [Sort_scan + Sort_range > 0]
Sort_merge_passes / (Sort_scan + Sort_range) * 100
value > 10
Too many sorts are causing temporary tables.
Consider increasing {sort_buffer_size} and/or {read_rnd_buffer_size}, depending on your system memory limits.
%s% of all sorts cause temporary tables, this value should be lower than 10%. | round(value,1)
rule 'Rate of sorts that cause temporary tables'
Sort_merge_passes / Uptime
value * 60 * 60 > 1
Too many sorts are causing temporary tables.
Consider increasing {sort_buffer_size} and/or {read_rnd_buffer_size}, depending on your system memory limits.
Temporary tables average: %s, this value should be less than 1 per hour. | ADVISOR_bytime(value,2)
rule 'Sort rows'
Sort_rows / Uptime
value * 60 >= 1
There are lots of rows being sorted.
While there is nothing wrong with a high amount of row sorting, you might want to make sure that the queries which require a lot of sorting use indexed columns in the ORDER BY clause, as this will result in much faster sorting.
Sorted rows average: %s | ADVISOR_bytime(value,2)
# Joins, scans
rule 'Rate of joins without indexes'
(Select_range_check + Select_scan + Select_full_join) / Uptime
value * 60 * 60 > 1
There are too many joins without indexes.
This means that joins are doing full table scans. Adding indexes for the columns being used in the join conditions will greatly speed up table joins.
Table joins average: %s, this value should be less than 1 per hour | ADVISOR_bytime(value,2)
rule 'Rate of reading first index entry'
Handler_read_first / Uptime
value * 60 * 60 > 1
The rate of reading the first index entry is high.
This usually indicates frequent full index scans. Full index scans are faster than table scans but require lots of CPU cycles in big tables, if those tables that have or had high volumes of UPDATEs and DELETEs, running 'OPTIMIZE TABLE' might reduce the amount of and/or speed up full index scans. Other than that full index scans can only be reduced by rewriting queries.
Index scans average: %s, this value should be less than 1 per hour | ADVISOR_bytime(value,2)
rule 'Rate of reading fixed position'
Handler_read_rnd / Uptime
value * 60 * 60 > 1
The rate of reading data from a fixed position is high.
This indicates that many queries need to sort results and/or do a full table scan, including join queries that do not use indexes. Add indexes where applicable.
Rate of reading fixed position average: %s, this value should be less than 1 per hour | ADVISOR_bytime(value,2)
rule 'Rate of reading next table row'
Handler_read_rnd_next / Uptime
value * 60 * 60 > 1
The rate of reading the next table row is high.
This indicates that many queries are doing full table scans. Add indexes where applicable.
Rate of reading next table row: %s, this value should be less than 1 per hour | ADVISOR_bytime(value,2)
# temp tables
rule 'Different tmp_table_size and max_heap_table_size'
tmp_table_size - max_heap_table_size
value !=0
{tmp_table_size} and {max_heap_table_size} are not the same.
If you have deliberately changed one of either: The server uses the lower value of either to determine the maximum size of in-memory tables. So if you wish to increase the in-memory table limit you will have to increase the other value as well.
Current values are tmp_table_size: %s, max_heap_table_size: %s | ADVISOR_formatByteDown(tmp_table_size, 2, 2), ADVISOR_formatByteDown(max_heap_table_size, 2, 2)
rule 'Percentage of temp tables on disk' [Created_tmp_tables + Created_tmp_disk_tables > 0]
Created_tmp_disk_tables / (Created_tmp_tables + Created_tmp_disk_tables) * 100
value > 25
Many temporary tables are being written to disk instead of being kept in memory.
Increasing {max_heap_table_size} and {tmp_table_size} might help. However some temporary tables are always being written to disk, independent of the value of these variables. To eliminate these you will have to rewrite your queries to avoid those conditions (Within a temporary table: Presence of a BLOB or TEXT column or presence of a column bigger than 512 bytes) as mentioned in the beginning of an Article by the Pythian Group
%s% of all temporary tables are being written to disk, this value should be below 25% | round(value,1)
rule 'Temp disk rate' [!fired('Percentage of temp tables on disk')]
Created_tmp_disk_tables / Uptime
value * 60 * 60 > 1
Many temporary tables are being written to disk instead of being kept in memory.
Increasing {max_heap_table_size} and {tmp_table_size} might help. However some temporary tables are always being written to disk, independent of the value of these variables. To eliminate these you will have to rewrite your queries to avoid those conditions (Within a temporary table: Presence of a BLOB or TEXT column or presence of a column bigger than 512 bytes) as mentioned in the MySQL Documentation
Rate of temporary tables being written to disk: %s, this value should be less than 1 per hour | ADVISOR_bytime(value,2)
#
# MyISAM index cache
rule 'MyISAM key buffer size'
key_buffer_size
value == 0
Key buffer is not initialized. No MyISAM indexes will be cached.
Set {key_buffer_size} depending on the size of your MyISAM indexes. 64M is a good start.
key_buffer_size is 0
rule 'Max % MyISAM key buffer ever used' [key_buffer_size > 0]
Key_blocks_used * key_cache_block_size / key_buffer_size * 100
value < 95
MyISAM key buffer (index cache) % used is low.
You may need to decrease the size of {key_buffer_size}, re-examine your tables to see if indexes have been removed, or examine queries and expectations about what indexes are being used.
max % MyISAM key buffer ever used: %s%, this value should be above 95% | round(value,1)
# Don't fire if above rule fired - we don't need the same advice twice
rule 'Percentage of MyISAM key buffer used' [key_buffer_size > 0 && !fired('Max % MyISAM key buffer ever used')]
( 1 - Key_blocks_unused * key_cache_block_size / key_buffer_size) * 100
value < 95
MyISAM key buffer (index cache) % used is low.
You may need to decrease the size of {key_buffer_size}, re-examine your tables to see if indexes have been removed, or examine queries and expectations about what indexes are being used.
% MyISAM key buffer used: %s%, this value should be above 95% | round(value,1)
rule 'Percentage of index reads from memory' [Key_read_requests > 0]
100 - (Key_reads / Key_read_requests * 100)
value < 95
The % of indexes that use the MyISAM key buffer is low.
You may need to increase {key_buffer_size}.
Index reads from memory: %s%, this value should be above 95% | round(value,1)
#
# other caches
rule 'Rate of table open'
Opened_tables / Uptime
value*60*60 > 10
The rate of opening tables is high.
Opening tables requires disk I/O which is costly. Increasing {table_open_cache} might avoid this.
Opened table rate: %s, this value should be less than 10 per hour | ADVISOR_bytime(value,2)
rule 'Percentage of used open files limit'
Open_files / open_files_limit * 100
value > 85
The number of open files is approaching the max number of open files. You may get a "Too many open files" error.
Consider increasing {open_files_limit}, and check the error log when restarting after changing {open_files_limit}.
The number of opened files is at %s% of the limit. It should be below 85% | round(value,1)
rule 'Rate of open files'
Open_files / Uptime
value * 60 * 60 > 5
The rate of opening files is high.
Consider increasing {open_files_limit}, and check the error log when restarting after changing {open_files_limit}.
Opened files rate: %s, this value should be less than 5 per hour | ADVISOR_bytime(value,2)
rule 'Immediate table locks %' [Table_locks_waited + Table_locks_immediate > 0]
Table_locks_immediate / (Table_locks_waited + Table_locks_immediate) * 100
value < 95
Too many table locks were not granted immediately.
Optimize queries and/or use InnoDB to reduce lock wait.
Immediate table locks: %s%, this value should be above 95% | round(value,1)
rule 'Table lock wait rate'
Table_locks_waited / Uptime
value * 60 * 60 > 1
Too many table locks were not granted immediately.
Optimize queries and/or use InnoDB to reduce lock wait.
Table lock wait rate: %s, this value should be less than 1 per hour | ADVISOR_bytime(value,2)
rule 'Thread cache'
thread_cache_size
value < 1
Thread cache is disabled, resulting in more overhead from new connections to MySQL.
Enable the thread cache by setting {thread_cache_size} > 0.
The thread cache is set to 0
rule 'Thread cache hit rate %' [thread_cache_size > 0]
100 - Threads_created / Connections
value < 80
Thread cache is not efficient.
Increase {thread_cache_size}.
Thread cache hitrate: %s%, this value should be above 80% | round(value,1)
rule 'Threads that are slow to launch' [slow_launch_time > 0]
Slow_launch_threads
value > 0
There are too many threads that are slow to launch.
This generally happens in case of general system overload as it is pretty simple operations. You might want to monitor your system load carefully.
%s thread(s) took longer than %s seconds to start, it should be 0 | value, slow_launch_time
rule 'Slow launch time'
slow_launch_time
value > 2
Slow_launch_time is above 2s.
Set {slow_launch_time} to 1s or 2s to correctly count threads that are slow to launch.
slow_launch_time is set to %s | value
#
#Connections
rule 'Percentage of used connections'
Max_used_connections / max_connections * 100
value > 80
The maximum amount of used connections is getting close to the value of {max_connections}.
Increase {max_connections}, or decrease {wait_timeout} so that connections that do not close database handlers properly get killed sooner. Make sure the code closes database handlers properly.
Max_used_connections is at %s% of max_connections, it should be below 80% | round(value,1)
rule 'Percentage of aborted connections'
Aborted_connects / Connections * 100
value > 1
Too many connections are aborted.
Connections are usually aborted when they cannot be authorized. This article might help you track down the source.
%s% of all connections are aborted. This value should be below 1% | round(value,1)
rule 'Rate of aborted connections'
Aborted_connects / Uptime
value * 60 * 60 > 1
Too many connections are aborted.
Connections are usually aborted when they cannot be authorized. This article might help you track down the source.
Aborted connections rate is at %s, this value should be less than 1 per hour | ADVISOR_bytime(value,2)
rule 'Percentage of aborted clients'
Aborted_clients / Connections * 100
value > 2
Too many clients are aborted.
Clients are usually aborted when they did not close their connection to MySQL properly. This can be due to network issues or code not closing a database handler properly. Check your network and code.
%s% of all clients are aborted. This value should be below 2% | round(value,1)
rule 'Rate of aborted clients'
Aborted_clients / Uptime
value * 60 * 60 > 1
Too many clients are aborted.
Clients are usually aborted when they did not close their connection to MySQL properly. This can be due to network issues or code not closing a database handler properly. Check your network and code.
Aborted client rate is at %s, this value should be less than 1 per hour | ADVISOR_bytime(value,2)
#
# InnoDB
rule 'Is InnoDB disabled?' [PMA_MYSQL_INT_VERSION < 50600]
have_innodb
value != "YES"
You do not have InnoDB enabled.
InnoDB is usually the better choice for table engines.
have_innodb is set to 'value'
rule 'InnoDB log size' [innodb_buffer_pool_size > 0]
innodb_log_file_size / innodb_buffer_pool_size * 100
value < 20 && innodb_log_file_size / (1024 * 1024) < 256
The InnoDB log file size is not an appropriate size, in relation to the InnoDB buffer pool.
Especially on a system with a lot of writes to InnoDB tables you should set {innodb_log_file_size} to 25% of {innodb_buffer_pool_size}. However the bigger this value, the longer the recovery time will be when database crashes, so this value should not be set much higher than 256 MiB. Please note however that you cannot simply change the value of this variable. You need to shutdown the server, remove the InnoDB log files, set the new value in my.cnf, start the server, then check the error logs if everything went fine. See also this blog entry
Your InnoDB log size is at %s% in relation to the InnoDB buffer pool size, it should not be below 20% | round(value,1)
rule 'Max InnoDB log size' [innodb_buffer_pool_size > 0 && innodb_log_file_size / innodb_buffer_pool_size * 100 < 30]
innodb_log_file_size / (1024 * 1024)
value > 256
The InnoDB log file size is inadequately large.
It is usually sufficient to set {innodb_log_file_size} to 25% of the size of {innodb_buffer_pool_size}. A very big {innodb_log_file_size} slows down the recovery time after a database crash considerably. See also this Article. You need to shutdown the server, remove the InnoDB log files, set the new value in my.cnf, start the server, then check the error logs if everything went fine. See also this blog entry
Your absolute InnoDB log size is %s MiB | round(value,1)
rule 'InnoDB buffer pool size' [system_memory > 0]
innodb_buffer_pool_size / system_memory * 100
value < 60
Your InnoDB buffer pool is fairly small.
The InnoDB buffer pool has a profound impact on performance for InnoDB tables. Assign all your remaining memory to this buffer. For database servers that use solely InnoDB as storage engine and have no other services (e.g. a web server) running, you may set this as high as 80% of your available memory. If that is not the case, you need to carefully assess the memory consumption of your other services and non-InnoDB-Tables and set this variable accordingly. If it is set too high, your system will start swapping, which decreases performance significantly. See also this article
You are currently using %s% of your memory for the InnoDB buffer pool. This rule fires if you are assigning less than 60%, however this might be perfectly adequate for your system if you don't have much InnoDB tables or other services running on the same machine. | value
#
# other
rule 'MyISAM concurrent inserts'
concurrent_insert
value === 0 || value === 'NEVER'
Enable {concurrent_insert} by setting it to 1
Setting {concurrent_insert} to 1 reduces contention between readers and writers for a given table. See also MySQL Documentation
concurrent_insert is set to 0
# INSERT DELAYED USAGE
#Delayed_errors 0
#Delayed_insert_threads 0
#Delayed_writes 0
#Not_flushed_delayed_rows
login/libraries/vendor_config.php 0000644 00000003600 15155311537 0013170 0 ustar 00 $db
);
if ($action == 'tbl_create.php') {
$form_params['reload'] = 1;
} else {
if ($action == 'tbl_addfield.php') {
$form_params = array_merge(
$form_params, array(
'field_where' => Util::getValueByKey($_POST, 'field_where'))
);
if (isset($_POST['field_where'])) {
$form_params['after_field'] = $_POST['after_field'];
}
}
$form_params['table'] = $table;
}
if (isset($num_fields)) {
$form_params['orig_num_fields'] = $num_fields;
}
$form_params = array_merge(
$form_params,
array(
'orig_field_where' => Util::getValueByKey($_POST, 'field_where'),
'orig_after_field' => Util::getValueByKey($_POST, 'after_field'),
)
);
if (isset($selected) && is_array($selected)) {
foreach ($selected as $o_fld_nr => $o_fld_val) {
$form_params['selected[' . $o_fld_nr . ']'] = $o_fld_val;
}
}
$is_backup = ($action != 'tbl_create.php' && $action != 'tbl_addfield.php');
$cfgRelation = $relation->getRelationsParam();
$comments_map = $relation->getComments($db, $table);
$move_columns = array();
if (isset($fields_meta)) {
/** @var PhpMyAdmin\DatabaseInterface $dbi */
$dbi = Container::getDefaultContainer()->get('dbi');
$move_columns = $dbi->getTable($db, $table)->getColumnsMeta();
}
$available_mime = array();
if ($cfgRelation['mimework'] && $GLOBALS['cfg']['BrowseMIME']) {
$mime_map = Transformations::getMIME($db, $table);
$available_mime = Transformations::getAvailableMIMEtypes();
}
// workaround for field_fulltext, because its submitted indices contain
// the index as a value, not a key. Inserted here for easier maintenance
// and less code to change in existing files.
if (isset($field_fulltext) && is_array($field_fulltext)) {
foreach ($field_fulltext as $fulltext_nr => $fulltext_indexkey) {
$submit_fulltext[$fulltext_indexkey] = $fulltext_indexkey;
}
}
if (isset($_POST['submit_num_fields'])
|| isset($_POST['submit_partition_change'])
) {
//if adding new fields, set regenerate to keep the original values
$regenerate = 1;
}
$foreigners = $relation->getForeigners($db, $table, '', 'foreign');
$child_references = null;
// From MySQL 5.6.6 onwards columns with foreign keys can be renamed.
// Hence, no need to get child references
if ($GLOBALS['dbi']->getVersion() < 50606) {
$child_references = $relation->getChildReferences($db, $table);
}
for ($columnNumber = 0; $columnNumber < $num_fields; $columnNumber++) {
$type = '';
$length = '';
$columnMeta = array();
$submit_attribute = null;
$extracted_columnspec = array();
if (!empty($regenerate)) {
$columnMeta = array_merge(
$columnMeta,
array(
'Field' => Util::getValueByKey(
$_POST, "field_name.${columnNumber}", false
),
'Type' => Util::getValueByKey(
$_POST, "field_type.${columnNumber}", false
),
'Collation' => Util::getValueByKey(
$_POST, "field_collation.${columnNumber}", ''
),
'Null' => Util::getValueByKey(
$_POST, "field_null.${columnNumber}", ''
),
'DefaultType' => Util::getValueByKey(
$_POST, "field_default_type.${columnNumber}", 'NONE'
),
'DefaultValue' => Util::getValueByKey(
$_POST, "field_default_value.${columnNumber}", ''
),
'Extra' => Util::getValueByKey(
$_POST, "field_extra.${columnNumber}", false
),
'Virtuality' => Util::getValueByKey(
$_POST, "field_virtuality.${columnNumber}", ''
),
'Expression' => Util::getValueByKey(
$_POST, "field_expression.${columnNumber}", ''
),
)
);
$columnMeta['Key'] = '';
$parts = explode(
'_', Util::getValueByKey($_POST, "field_key.${columnNumber}", ''), 2
);
if (count($parts) == 2 && $parts[1] == $columnNumber) {
$columnMeta['Key'] = Util::getValueByKey(
array(
'primary' => 'PRI',
'index' => 'MUL',
'unique' => 'UNI',
'fulltext' => 'FULLTEXT',
'spatial' => 'SPATIAL'
),
$parts[0], ''
);
}
$columnMeta['Comment']
= isset($submit_fulltext[$columnNumber])
&& ($submit_fulltext[$columnNumber] == $columnNumber)
? 'FULLTEXT' : false;
switch ($columnMeta['DefaultType']) {
case 'NONE':
$columnMeta['Default'] = null;
break;
case 'USER_DEFINED':
$columnMeta['Default'] = $columnMeta['DefaultValue'];
break;
case 'NULL':
case 'CURRENT_TIMESTAMP':
case 'current_timestamp()':
$columnMeta['Default'] = $columnMeta['DefaultType'];
break;
}
$length = Util::getValueByKey($_POST, "field_length.${columnNumber}", $length);
$submit_attribute = Util::getValueByKey(
$_POST, "field_attribute.${columnNumber}", false
);
$comments_map[$columnMeta['Field']] = Util::getValueByKey(
$_POST, "field_comments.${columnNumber}"
);
$mime_map[$columnMeta['Field']] = array_merge(
isset($mime_map[$columnMeta['Field']]) ? $mime_map[$columnMeta['Field']] : [],
array(
'mimetype' => Util::getValueByKey($_POST, "field_mimetype.${$columnNumber}"),
'transformation' => Util::getValueByKey(
$_POST, "field_transformation.${$columnNumber}"
),
'transformation_options' => Util::getValueByKey(
$_POST, "field_transformation_options.${$columnNumber}"
),
)
);
} elseif (isset($fields_meta[$columnNumber])) {
$columnMeta = $fields_meta[$columnNumber];
$virtual = array(
'VIRTUAL', 'PERSISTENT', 'VIRTUAL GENERATED', 'STORED GENERATED'
);
if (in_array($columnMeta['Extra'], $virtual)) {
$tableObj = new Table($GLOBALS['table'], $GLOBALS['db']);
$expressions = $tableObj->getColumnGenerationExpression(
$columnMeta['Field']
);
$columnMeta['Expression'] = $expressions[$columnMeta['Field']];
}
switch ($columnMeta['Default']) {
case null:
if (is_null($columnMeta['Default'])) { // null
if ($columnMeta['Null'] == 'YES') {
$columnMeta['DefaultType'] = 'NULL';
$columnMeta['DefaultValue'] = '';
} else {
$columnMeta['DefaultType'] = 'NONE';
$columnMeta['DefaultValue'] = '';
}
} else { // empty
$columnMeta['DefaultType'] = 'USER_DEFINED';
$columnMeta['DefaultValue'] = $columnMeta['Default'];
}
break;
case 'CURRENT_TIMESTAMP':
case 'current_timestamp()':
$columnMeta['DefaultType'] = 'CURRENT_TIMESTAMP';
$columnMeta['DefaultValue'] = '';
break;
default:
$columnMeta['DefaultType'] = 'USER_DEFINED';
if ('text' === substr($columnMeta['Type'], -4)) {
$textDefault = substr($columnMeta['Default'], 1, -1);
$columnMeta['Default'] = stripcslashes($textDefault !== false ? $textDefault : $columnMeta['Default']);
}
$columnMeta['DefaultValue'] = $columnMeta['Default'];
break;
}
}
if (isset($columnMeta['Type'])) {
$extracted_columnspec = Util::extractColumnSpec(
$columnMeta['Type']
);
if ($extracted_columnspec['type'] == 'bit') {
$columnMeta['Default']
= Util::convertBitDefaultValue($columnMeta['Default']);
}
$type = $extracted_columnspec['type'];
if ($length == '') {
$length = $extracted_columnspec['spec_in_brackets'];
}
} else {
// creating a column
$columnMeta['Type'] = '';
}
// Variable tell if current column is bound in a foreign key constraint or not.
// MySQL version from 5.6.6 allow renaming columns with foreign keys
if (isset($columnMeta['Field'])
&& isset($form_params['table'])
&& $GLOBALS['dbi']->getVersion() < 50606
) {
$columnMeta['column_status'] = $relation->checkChildForeignReferences(
$form_params['db'],
$form_params['table'],
$columnMeta['Field'],
$foreigners,
$child_references
);
}
// some types, for example longtext, are reported as
// "longtext character set latin7" when their charset and / or collation
// differs from the ones of the corresponding database.
// rtrim the type, for cases like "float unsigned"
$type = rtrim(
preg_replace('/[\s]character set[\s][\S]+/', '', $type)
);
/**
* old column attributes
*/
if ($is_backup) {
// old column name
if (isset($columnMeta['Field'])) {
$form_params['field_orig[' . $columnNumber . ']']
= $columnMeta['Field'];
if (isset($columnMeta['column_status'])
&& !$columnMeta['column_status']['isEditable']
) {
$form_params['field_name[' . $columnNumber . ']']
= $columnMeta['Field'];
}
} else {
$form_params['field_orig[' . $columnNumber . ']'] = '';
}
// old column type
if (isset($columnMeta['Type'])) {
// keep in uppercase because the new type will be in uppercase
$form_params['field_type_orig[' . $columnNumber . ']'] = mb_strtoupper($type);
if (isset($columnMeta['column_status'])
&& !$columnMeta['column_status']['isEditable']
) {
$form_params['field_type[' . $columnNumber . ']'] = mb_strtoupper($type);
}
} else {
$form_params['field_type_orig[' . $columnNumber . ']'] = '';
}
// old column length
$form_params['field_length_orig[' . $columnNumber . ']'] = $length;
// old column default
$form_params = array_merge(
$form_params,
array(
"field_default_value_orig[${columnNumber}]" => Util::getValueByKey(
$columnMeta, 'Default', ''
),
"field_default_type_orig[${columnNumber}]" => Util::getValueByKey(
$columnMeta, 'DefaultType', ''
),
"field_collation_orig[${columnNumber}]" => Util::getValueByKey(
$columnMeta, 'Collation', ''
),
"field_attribute_orig[${columnNumber}]" => trim(
Util::getValueByKey($extracted_columnspec, 'attribute', '')
),
"field_null_orig[${columnNumber}]" => Util::getValueByKey(
$columnMeta, 'Null', ''
),
"field_extra_orig[${columnNumber}]" => Util::getValueByKey(
$columnMeta, 'Extra', ''
),
"field_comments_orig[${columnNumber}]" => Util::getValueByKey(
$columnMeta, 'Comment', ''
),
"field_virtuality_orig[${columnNumber}]" => Util::getValueByKey(
$columnMeta, 'Virtuality', ''
),
"field_expression_orig[${columnNumber}]" => Util::getValueByKey(
$columnMeta, 'Expression', ''
),
)
);
}
$content_cells[$columnNumber] = array(
'column_number' => $columnNumber,
'column_meta' => $columnMeta,
'type_upper' => mb_strtoupper($type),
'length_values_input_size' => $length_values_input_size,
'length' => $length,
'extracted_columnspec' => $extracted_columnspec,
'submit_attribute' => $submit_attribute,
'comments_map' => $comments_map,
'fields_meta' => isset($fields_meta) ? $fields_meta : null,
'is_backup' => $is_backup,
'move_columns' => $move_columns,
'cfg_relation' => $cfgRelation,
'available_mime' => $available_mime,
'mime_map' => isset($mime_map) ? $mime_map : array()
);
} // end for
include 'libraries/tbl_partition_definition.inc.php';
$html = Template::get('columns_definitions/column_definitions_form')->render([
'is_backup' => $is_backup,
'fields_meta' => isset($fields_meta) ? $fields_meta : null,
'mimework' => $cfgRelation['mimework'],
'action' => $action,
'form_params' => $form_params,
'content_cells' => $content_cells,
'partition_details' => $partitionDetails,
'primary_indexes' => isset($_POST['primary_indexes']) ? $_POST['primary_indexes'] : null,
'unique_indexes' => isset($_POST['unique_indexes']) ? $_POST['unique_indexes'] : null,
'indexes' => isset($_POST['indexes']) ? $_POST['indexes'] : null,
'fulltext_indexes' => isset($_POST['fulltext_indexes']) ? $_POST['fulltext_indexes'] : null,
'spatial_indexes' => isset($_POST['spatial_indexes']) ? $_POST['spatial_indexes'] : null,
'table' => isset($_POST['table']) ? $_POST['table'] : null,
'comment' => isset($_POST['comment']) ? $_POST['comment'] : null,
'tbl_collation' => isset($_POST['tbl_collation']) ? $_POST['tbl_collation'] : null,
'tbl_storage_engine' => isset($_POST['tbl_storage_engine']) ? $_POST['tbl_storage_engine'] : null,
'connection' => isset($_POST['connection']) ? $_POST['connection'] : null,
'change_column' => isset($_POST['change_column']) ? $_POST['change_column'] : null,
'is_virtual_columns_supported' => Util::isVirtualColumnsSupported(),
'browse_mime' => isset($GLOBALS['cfg']['BrowseMIME']) ? $GLOBALS['cfg']['BrowseMIME'] : null,
'server_type' => Util::getServerType(),
'max_rows' => intval($GLOBALS['cfg']['MaxRows']),
'char_editing' => isset($GLOBALS['cfg']['CharEditing']) ? $GLOBALS['cfg']['CharEditing'] : null,
'attribute_types' => $GLOBALS['dbi']->types->getAttributes(),
'privs_available' => ((isset($GLOBALS['col_priv']) ? $GLOBALS['col_priv'] : false)
&& (isset($GLOBALS['is_reload_priv']) ? $GLOBALS['is_reload_priv'] : false)
),
'max_length' => $GLOBALS['dbi']->getVersion() >= 50503 ? 1024 : 255,
'have_partitioning' => Partition::havePartitioning(),
'dbi' => $GLOBALS['dbi'],
'disable_is' => $GLOBALS['cfg']['Server']['DisableIS'],
]);
unset($form_params);
$response = Response::getInstance();
$response->getHeader()->getScripts()->addFiles(
array(
'vendor/jquery/jquery.uitablefilter.js',
'indexes.js'
)
);
$response->addHTML($html);
login/libraries/special_schema_links.inc.php 0000644 00000042735 15155311537 0015272 0 ustar 00 array(
* // Table name
* 'db' => array(
* // Column name
* 'user' => array(
* // Main url param (can be an array where represent sql)
* 'link_param' => 'username',
* // Other url params
* 'link_dependancy_params' => array(
* 0 => array(
* // URL parameter name
* // (can be array where url param has static value)
* 'param_info' => 'hostname',
* // Column name related to url param
* 'column_name' => 'host'
* )
* ),
* // Page to link
* 'default_page' => './server_privileges.php'
* )
* )
* )
* );
*
*/
$GLOBALS['special_schema_links'] = array(
'mysql' => array(
'columns_priv' => array(
'user' => array(
'link_param' => 'username',
'link_dependancy_params' => array(
0 => array(
'param_info' => 'hostname',
'column_name' => 'host'
)
),
'default_page' => './server_privileges.php'
),
'table_name' => array(
'link_param' => 'table',
'link_dependancy_params' => array(
0 => array(
'param_info' => 'db',
'column_name' => 'Db'
),
),
'default_page' => './' . PhpMyAdmin\Util::getScriptNameForOption(
$GLOBALS['cfg']['DefaultTabTable'], 'table'
)
),
'column_name' => array(
'link_param' => 'field',
'link_dependancy_params' => array(
0 => array(
'param_info' => 'db',
'column_name' => 'Db'
),
1 => array(
'param_info' => 'table',
'column_name' => 'Table_name'
)
),
'default_page' => './tbl_structure.php?change_column=1'
),
),
'db' => array(
'user' => array(
'link_param' => 'username',
'link_dependancy_params' => array(
0 => array(
'param_info' => 'hostname',
'column_name' => 'host'
)
),
'default_page' => './server_privileges.php'
)
),
'event' => array(
'name' => array(
'link_param' => 'item_name',
'link_dependancy_params' => array(
0 => array(
'param_info' => 'db',
'column_name' => 'db'
)
),
'default_page' => './db_events.php?edit_item=1'
),
),
'innodb_index_stats' => array(
'table_name' => array(
'link_param' => 'table',
'link_dependancy_params' => array(
0 => array(
'param_info' => 'db',
'column_name' => 'database_name'
),
),
'default_page' => './' . PhpMyAdmin\Util::getScriptNameForOption(
$GLOBALS['cfg']['DefaultTabTable'], 'table'
)
),
'index_name' => array(
'link_param' => 'index',
'link_dependancy_params' => array(
0 => array(
'param_info' => 'db',
'column_name' => 'database_name'
),
1 => array(
'param_info' => 'table',
'column_name' => 'table_name'
)
),
'default_page' => './tbl_structure.php'
),
),
'innodb_table_stats' => array(
'table_name' => array(
'link_param' => 'table',
'link_dependancy_params' => array(
0 => array(
'param_info' => 'db',
'column_name' => 'database_name'
),
),
'default_page' => './' . PhpMyAdmin\Util::getScriptNameForOption(
$GLOBALS['cfg']['DefaultTabTable'], 'table'
)
),
),
'proc' => array(
'name' => array(
'link_param' => 'item_name',
'link_dependancy_params' => array(
0 => array(
'param_info' => 'db',
'column_name' => 'db'
),
1 => array(
'param_info' => 'item_type',
'column_name' => 'type'
)
),
'default_page' => './db_routines.php?edit_item=1'
),
'specific_name' => array(
'link_param' => 'item_name',
'link_dependancy_params' => array(
0 => array(
'param_info' => 'db',
'column_name' => 'db'
),
1 => array(
'param_info' => 'item_type',
'column_name' => 'type'
)
),
'default_page' => './db_routines.php?edit_item=1'
),
),
'proc_priv' => array(
'user' => array(
'link_param' => 'username',
'link_dependancy_params' => array(
0 => array(
'param_info' => 'hostname',
'column_name' => 'Host'
)
),
'default_page' => './server_privileges.php'
),
'routine_name' => array(
'link_param' => 'item_name',
'link_dependancy_params' => array(
0 => array(
'param_info' => 'db',
'column_name' => 'Db'
),
1 => array(
'param_info' => 'item_type',
'column_name' => 'Routine_type'
)
),
'default_page' => './db_routines.php?edit_item=1'
),
),
'proxies_priv' => array(
'user' => array(
'link_param' => 'username',
'link_dependancy_params' => array(
0 => array(
'param_info' => 'hostname',
'column_name' => 'Host'
)
),
'default_page' => './server_privileges.php'
),
),
'tables_priv' => array(
'user' => array(
'link_param' => 'username',
'link_dependancy_params' => array(
0 => array(
'param_info' => 'hostname',
'column_name' => 'Host'
)
),
'default_page' => './server_privileges.php'
),
'table_name' => array(
'link_param' => 'table',
'link_dependancy_params' => array(
0 => array(
'param_info' => 'db',
'column_name' => 'Db'
),
),
'default_page' => './' . PhpMyAdmin\Util::getScriptNameForOption(
$GLOBALS['cfg']['DefaultTabTable'], 'table'
)
),
),
'user' => array(
'user' => array(
'link_param' => 'username',
'link_dependancy_params' => array(
0 => array(
'param_info' => 'hostname',
'column_name' => 'host'
)
),
'default_page' => './server_privileges.php'
)
)
),
'information_schema' => array(
'columns' => array(
'table_name' => array(
'link_param' => 'table',
'link_dependancy_params' => array(
0 => array(
'param_info' => 'db',
'column_name' => 'table_schema'
)
),
'default_page' => './' . PhpMyAdmin\Util::getScriptNameForOption(
$GLOBALS['cfg']['DefaultTabTable'], 'table'
)
),
'column_name' => array(
'link_param' => 'field',
'link_dependancy_params' => array(
0 => array(
'param_info' => 'db',
'column_name' => 'table_schema'
),
1 => array(
'param_info' => 'table',
'column_name' => 'table_name'
)
),
'default_page' => './tbl_structure.php?change_column=1'
)
),
'key_column_usage' => array(
'table_name' => array(
'link_param' => 'table',
'link_dependancy_params' => array(
0 => array(
'param_info' => 'db',
'column_name' => 'constraint_schema'
)
),
'default_page' => './' . PhpMyAdmin\Util::getScriptNameForOption(
$GLOBALS['cfg']['DefaultTabTable'], 'table'
)
),
'column_name' => array(
'link_param' => 'field',
'link_dependancy_params' => array(
0 => array(
'param_info' => 'db',
'column_name' => 'table_schema'
),
1 => array(
'param_info' => 'table',
'column_name' => 'table_name'
)
),
'default_page' => './tbl_structure.php?change_column=1'
),
'referenced_table_name' => array(
'link_param' => 'table',
'link_dependancy_params' => array(
0 => array(
'param_info' => 'db',
'column_name' => 'referenced_table_schema'
)
),
'default_page' => './' . PhpMyAdmin\Util::getScriptNameForOption(
$GLOBALS['cfg']['DefaultTabTable'], 'table'
)
),
'referenced_column_name' => array(
'link_param' => 'field',
'link_dependancy_params' => array(
0 => array(
'param_info' => 'db',
'column_name' => 'referenced_table_schema'
),
1 => array(
'param_info' => 'table',
'column_name' => 'referenced_table_name'
)
),
'default_page' => './tbl_structure.php?change_column=1'
)
),
'partitions' => array(
'table_name' => array(
'link_param' => 'table',
'link_dependancy_params' => array(
0 => array(
'param_info' => 'db',
'column_name' => 'table_schema'
)
),
'default_page' => './' . PhpMyAdmin\Util::getScriptNameForOption(
$GLOBALS['cfg']['DefaultTabTable'], 'table'
)
)
),
'processlist' => array(
'user' => array(
'link_param' => 'username',
'link_dependancy_params' => array(
0 => array(
'param_info' => 'hostname',
'column_name' => 'host'
)
),
'default_page' => './server_privileges.php'
)
),
'referential_constraints' => array(
'table_name' => array(
'link_param' => 'table',
'link_dependancy_params' => array(
0 => array(
'param_info' => 'db',
'column_name' => 'constraint_schema'
)
),
'default_page' => './' . PhpMyAdmin\Util::getScriptNameForOption(
$GLOBALS['cfg']['DefaultTabTable'], 'table'
)
),
'referenced_table_name' => array(
'link_param' => 'table',
'link_dependancy_params' => array(
0 => array(
'param_info' => 'db',
'column_name' => 'constraint_schema'
)
),
'default_page' => './' . PhpMyAdmin\Util::getScriptNameForOption(
$GLOBALS['cfg']['DefaultTabTable'], 'table'
)
)
),
'routines' => array(
'routine_name' => array(
'link_param' => 'item_name',
'link_dependancy_params' => array(
0 => array(
'param_info' => 'db',
'column_name' => 'routine_schema'
),
1 => array(
'param_info' => 'item_type',
'column_name' => 'routine_type'
)
),
'default_page' => './db_routines.php'
),
),
'schemata' => array(
'schema_name' => array(
'link_param' => 'db',
'default_page' => './' . PhpMyAdmin\Util::getScriptNameForOption(
$GLOBALS['cfg']['DefaultTabTable'], 'table'
)
)
),
'statistics' => array(
'table_name' => array(
'link_param' => 'table',
'link_dependancy_params' => array(
0 => array(
'param_info' => 'db',
'column_name' => 'table_schema'
)
),
'default_page' => './' . PhpMyAdmin\Util::getScriptNameForOption(
$GLOBALS['cfg']['DefaultTabTable'], 'table'
)
),
'column_name' => array(
'link_param' => 'field',
'link_dependancy_params' => array(
0 => array(
'param_info' => 'db',
'column_name' => 'table_schema'
),
1 => array(
'param_info' => 'table',
'column_name' => 'table_name'
)
),
'default_page' => './tbl_structure.php?change_column=1'
)
),
'tables' => array(
'table_name' => array(
'link_param' => 'table',
'link_dependancy_params' => array(
0 => array(
'param_info' => 'db',
'column_name' => 'table_schema'
)
),
'default_page' => './' . PhpMyAdmin\Util::getScriptNameForOption(
$GLOBALS['cfg']['DefaultTabTable'], 'table'
)
),
),
'table_constraints' => array(
'table_name' => array(
'link_param' => 'table',
'link_dependancy_params' => array(
0 => array(
'param_info' => 'db',
'column_name' => 'table_schema'
)
),
'default_page' => './' . PhpMyAdmin\Util::getScriptNameForOption(
$GLOBALS['cfg']['DefaultTabTable'], 'table'
)
),
),
'views' => array(
'table_name' => array(
'link_param' => 'table',
'link_dependancy_params' => array(
0 => array(
'param_info' => 'db',
'column_name' => 'table_schema'
)
),
'default_page' => './' . PhpMyAdmin\Util::getScriptNameForOption(
$GLOBALS['cfg']['DefaultTabTable'], 'table'
)
),
),
)
);
login/libraries/information_schema_relations.inc.php 0000644 00000025716 15155311537 0017057 0 ustar 00 array(
'DEFAULT_COLLATE_NAME' => array(
'foreign_db' => 'information_schema',
'foreign_table' => 'COLLATIONS',
'foreign_field' => 'COLLATION_NAME'
)
),
'COLLATIONS' => array(
'CHARACTER_SET_NAME' => array(
'foreign_db' => 'information_schema',
'foreign_table' => 'CHARACTER_SETS',
'foreign_field' => 'CHARACTER_SET_NAME'
)
),
'COLLATION_CHARACTER_SET_APPLICABILITY' => array(
'CHARACTER_SET_NAME' => array(
'foreign_db' => 'information_schema',
'foreign_table' => 'CHARACTER_SETS',
'foreign_field' => 'CHARACTER_SET_NAME'
),
'COLLATION_NAME' => array(
'foreign_db' => 'information_schema',
'foreign_table' => 'COLLATIONS',
'foreign_field' => 'COLLATION_NAME'
)
),
'COLUMNS' => array(
'TABLE_SCHEMA' => array(
'foreign_db' => 'information_schema',
'foreign_table' => 'SCHEMATA',
'foreign_field' => 'SCHEMA_NAME'
),
'CHARACTER_SET_NAME' => array(
'foreign_db' => 'information_schema',
'foreign_table' => 'CHARACTER_SETS',
'foreign_field' => 'CHARACTER_SET_NAME'
),
'COLLATION_NAME' => array(
'foreign_db' => 'information_schema',
'foreign_table' => 'COLLATIONS',
'foreign_field' => 'COLLATION_NAME'
)
),
'COLUMN_PRIVILEGES' => array(
'TABLE_SCHEMA' => array(
'foreign_db' => 'information_schema',
'foreign_table' => 'SCHEMATA',
'foreign_field' => 'SCHEMA_NAME'
)
),
'EVENTS' => array(
'EVENT_SCHEMA' => array(
'foreign_db' => 'information_schema',
'foreign_table' => 'SCHEMATA',
'foreign_field' => 'SCHEMA_NAME'
),
'CHARACTER_SET_CLIENT' => array(
'foreign_db' => 'information_schema',
'foreign_table' => 'CHARACTER_SETS',
'foreign_field' => 'CHARACTER_SET_NAME'
),
'COLLATION_CONNECTION' => array(
'foreign_db' => 'information_schema',
'foreign_table' => 'COLLATIONS',
'foreign_field' => 'COLLATION_NAME'
),
'DATABASE_COLLATION' => array(
'foreign_db' => 'information_schema',
'foreign_table' => 'COLLATIONS',
'foreign_field' => 'COLLATION_NAME'
)
),
'FILES' => array(
'TABLESPACE_NAME' => array(
'foreign_db' => 'information_schema',
'foreign_table' => 'TABLESPACES',
'foreign_field' => 'TABLESPACE_NAME'
),
'TABLE_SCHEMA' => array(
'foreign_db' => 'information_schema',
'foreign_table' => 'SCHEMATA',
'foreign_field' => 'SCHEMA_NAME'
),
'COLLATION_CONNECTION' => array(
'foreign_db' => 'information_schema',
'foreign_table' => 'COLLATIONS',
'foreign_field' => 'COLLATION_NAME'
),
'ENGINE' => array(
'foreign_db' => 'information_schema',
'foreign_table' => 'ENGINES',
'foreign_field' => 'ENGINE'
)
),
'KEY_COLUMN_USAGE' => array(
'CONSTRAINT_SCHEMA' => array(
'foreign_db' => 'information_schema',
'foreign_table' => 'SCHEMATA',
'foreign_field' => 'SCHEMA_NAME'
),
'TABLE_SCHEMA' => array(
'foreign_db' => 'information_schema',
'foreign_table' => 'SCHEMATA',
'foreign_field' => 'SCHEMA_NAME'
),
'REFERENCED_TABLE_SCHEMA' => array(
'foreign_db' => 'information_schema',
'foreign_table' => 'SCHEMATA',
'foreign_field' => 'SCHEMA_NAME'
)
),
'PARAMETERS' => array(
'SPECIFIC_SCHEMA' => array(
'foreign_db' => 'information_schema',
'foreign_table' => 'SCHEMATA',
'foreign_field' => 'SCHEMA_NAME'
),
'CHARACTER_SET_NAME' => array(
'foreign_db' => 'information_schema',
'foreign_table' => 'CHARACTER_SETS',
'foreign_field' => 'CHARACTER_SET_NAME'
),
'COLLATION_NAME' => array(
'foreign_db' => 'information_schema',
'foreign_table' => 'COLLATIONS',
'foreign_field' => 'COLLATION_NAME'
)
),
'PARTITIONS' => array(
'TABLE_SCHEMA' => array(
'foreign_db' => 'information_schema',
'foreign_table' => 'SCHEMATA',
'foreign_field' => 'SCHEMA_NAME'
),
'TABLESPACE_NAME' => array(
'foreign_db' => 'information_schema',
'foreign_table' => 'TABLESPACES',
'foreign_field' => 'TABLESPACE_NAME'
)
),
'PROCESSLIST' => array(
'DB' => array(
'foreign_db' => 'information_schema',
'foreign_table' => 'SCHEMATA',
'foreign_field' => 'SCHEMA_NAME'
)
),
'REFERENTIAL_CONSTRAINTS' => array(
'CONSTRAINT_SCHEMA' => array(
'foreign_db' => 'information_schema',
'foreign_table' => 'SCHEMATA',
'foreign_field' => 'SCHEMA_NAME'
),
'UNIQUE_CONSTRAINT_SCHEMA' => array(
'foreign_db' => 'information_schema',
'foreign_table' => 'SCHEMATA',
'foreign_field' => 'SCHEMA_NAME'
)
),
'ROUTINES' => array(
'ROUTINE_SCHEMA' => array(
'foreign_db' => 'information_schema',
'foreign_table' => 'SCHEMATA',
'foreign_field' => 'SCHEMA_NAME'
),
'CHARACTER_SET_NAME' => array(
'foreign_db' => 'information_schema',
'foreign_table' => 'CHARACTER_SETS',
'foreign_field' => 'CHARACTER_SET_NAME'
),
'COLLATION_NAME' => array(
'foreign_db' => 'information_schema',
'foreign_table' => 'COLLATIONS',
'foreign_field' => 'COLLATION_NAME'
),
'CHARACTER_SET_CLIENT' => array(
'foreign_db' => 'information_schema',
'foreign_table' => 'CHARACTER_SETS',
'foreign_field' => 'CHARACTER_SET_NAME'
),
'COLLATION_CONNECTION' => array(
'foreign_db' => 'information_schema',
'foreign_table' => 'COLLATIONS',
'foreign_field' => 'COLLATION_NAME'
),
'DATABASE_COLLATION' => array(
'foreign_db' => 'information_schema',
'foreign_table' => 'COLLATIONS',
'foreign_field' => 'COLLATION_NAME'
)
),
'SCHEMATA' => array(
'DEFAULT_CHARACTER_SET_NAME' => array(
'foreign_db' => 'information_schema',
'foreign_table' => 'CHARACTER_SETS',
'foreign_field' => 'CHARACTER_SET_NAME'
),
'DEFAULT_COLLATION_NAME' => array(
'foreign_db' => 'information_schema',
'foreign_table' => 'COLLATIONS',
'foreign_field' => 'COLLATION_NAME'
)
),
'SCHEMA_PRIVILEGES' => array(
'TABLE_SCHEMA' => array(
'foreign_db' => 'information_schema',
'foreign_table' => 'SCHEMATA',
'foreign_field' => 'SCHEMA_NAME'
)
),
'STATISTICS' => array(
'TABLE_SCHEMA' => array(
'foreign_db' => 'information_schema',
'foreign_table' => 'SCHEMATA',
'foreign_field' => 'SCHEMA_NAME'
),
'INDEX_SCHEMA' => array(
'foreign_db' => 'information_schema',
'foreign_table' => 'SCHEMATA',
'foreign_field' => 'SCHEMA_NAME'
)
),
'TABLES' => array(
'TABLE_SCHEMA' => array(
'foreign_db' => 'information_schema',
'foreign_table' => 'SCHEMATA',
'foreign_field' => 'SCHEMA_NAME'
),
'TABLE_COLLATION' => array(
'foreign_db' => 'information_schema',
'foreign_table' => 'COLLATIONS',
'foreign_field' => 'COLLATION_NAME'
),
'ENGINE' => array(
'foreign_db' => 'information_schema',
'foreign_table' => 'ENGINES',
'foreign_field' => 'ENGINE'
),
),
'TABLESAPCES' => array(
'ENGINE' => array(
'foreign_db' => 'information_schema',
'foreign_table' => 'ENGINES',
'foreign_field' => 'ENGINE'
)
),
'TABLE_CONSTRAINTS' => array(
'CONSTRAINT_SCHEMA' => array(
'foreign_db' => 'information_schema',
'foreign_table' => 'SCHEMATA',
'foreign_field' => 'SCHEMA_NAME'
),
'TABLE_SCHEMA' => array(
'foreign_db' => 'information_schema',
'foreign_table' => 'SCHEMATA',
'foreign_field' => 'SCHEMA_NAME'
)
),
'TABLE_PRIVILEGES' => array(
'TABLE_SCHEMA' => array(
'foreign_db' => 'information_schema',
'foreign_table' => 'SCHEMATA',
'foreign_field' => 'SCHEMA_NAME'
)
),
'TRIGGERS' => array(
'TRIGGER_SCHEMA' => array(
'foreign_db' => 'information_schema',
'foreign_table' => 'SCHEMATA',
'foreign_field' => 'SCHEMA_NAME'
),
'EVENT_OBJECT_SCHEMA' => array(
'foreign_db' => 'information_schema',
'foreign_table' => 'SCHEMATA',
'foreign_field' => 'SCHEMA_NAME'
),
'CHARACTER_SET_CLIENT' => array(
'foreign_db' => 'information_schema',
'foreign_table' => 'CHARACTER_SETS',
'foreign_field' => 'CHARACTER_SET_NAME'
),
'COLLATION_CONNECTION' => array(
'foreign_db' => 'information_schema',
'foreign_table' => 'COLLATIONS',
'foreign_field' => 'COLLATION_NAME'
),
'DATABASE_COLLATION' => array(
'foreign_db' => 'information_schema',
'foreign_table' => 'COLLATIONS',
'foreign_field' => 'COLLATION_NAME'
)
),
'VIEWS' => array(
'TABLE_SCHEMA' => array(
'foreign_db' => 'information_schema',
'foreign_table' => 'SCHEMATA',
'foreign_field' => 'SCHEMA_NAME'
),
'CHARACTER_SET_CLIENT' => array(
'foreign_db' => 'information_schema',
'foreign_table' => 'CHARACTER_SETS',
'foreign_field' => 'CHARACTER_SET_NAME'
),
'COLLATION_CONNECTION' => array(
'foreign_db' => 'information_schema',
'foreign_table' => 'COLLATIONS',
'foreign_field' => 'COLLATION_NAME'
)
)
);
login/libraries/common.inc.php 0000644 00000033450 15155311537 0012414 0 ustar 00 Currently installed version is: '
. phpversion()
);
}
/**
* for verification in all procedural scripts under libraries
*/
define('PHPMYADMIN', true);
/**
* Load vendor configuration.
*/
require_once './libraries/vendor_config.php';
/**
* Load hash polyfill.
*/
require_once './libraries/hash.lib.php';
/**
* Activate autoloader
*/
if (! @is_readable(AUTOLOAD_FILE)) {
die(
'File ' . AUTOLOAD_FILE . ' missing or not readable. '
. 'Most likely you did not run Composer to '
. 'install library files.'
);
}
require_once AUTOLOAD_FILE;
/**
* Load gettext functions.
*/
PhpMyAdmin\MoTranslator\Loader::loadFunctions();
/**
* initialize the error handler
*/
$GLOBALS['error_handler'] = new ErrorHandler();
/**
* Warning about missing PHP extensions.
*/
Core::checkExtensions();
/**
* Configure required PHP settings.
*/
Core::configure();
/******************************************************************************/
/* start procedural code label_start_procedural */
Core::cleanupPathInfo();
/******************************************************************************/
/* parsing configuration file LABEL_parsing_config_file */
/**
* @global Config $GLOBALS['PMA_Config']
* force reading of config file, because we removed sensitive values
* in the previous iteration
*/
$GLOBALS['PMA_Config'] = new Config(CONFIG_FILE);
/**
* include session handling after the globals, to prevent overwriting
*/
if (! defined('PMA_NO_SESSION')) {
Session::setUp($GLOBALS['PMA_Config'], $GLOBALS['error_handler']);
}
/**
* init some variables LABEL_variables_init
*/
/**
* holds parameters to be passed to next page
* @global array $GLOBALS['url_params']
*/
$GLOBALS['url_params'] = array();
/**
* holds page that should be displayed
* @global string $GLOBALS['goto']
*/
$GLOBALS['goto'] = '';
// Security fix: disallow accessing serious server files via "?goto="
if (Core::checkPageValidity($_REQUEST['goto'])) {
$GLOBALS['goto'] = $_REQUEST['goto'];
$GLOBALS['url_params']['goto'] = $_REQUEST['goto'];
} else {
$GLOBALS['PMA_Config']->removeCookie('goto');
unset($_REQUEST['goto'], $_GET['goto'], $_POST['goto']);
}
/**
* returning page
* @global string $GLOBALS['back']
*/
if (Core::checkPageValidity($_REQUEST['back'])) {
$GLOBALS['back'] = $_REQUEST['back'];
} else {
$GLOBALS['PMA_Config']->removeCookie('back');
unset($_REQUEST['back'], $_GET['back'], $_POST['back']);
}
/**
* Check whether user supplied token is valid, if not remove any possibly
* dangerous stuff from request.
*
* remember that some objects in the session with session_start and __wakeup()
* could access this variables before we reach this point
* f.e. PhpMyAdmin\Config: fontsize
*
* Check for token mismatch only if the Request method is POST
* GET Requests would never have token and therefore checking
* mis-match does not make sense
*
* @todo variables should be handled by their respective owners (objects)
* f.e. lang, server in PhpMyAdmin\Config
*/
$token_mismatch = true;
$token_provided = false;
if ($_SERVER['REQUEST_METHOD'] == 'POST') {
if (Core::isValid($_POST['token'])) {
$token_provided = true;
$token_mismatch = ! @hash_equals($_SESSION[' PMA_token '], $_POST['token']);
}
if ($token_mismatch) {
/* Warn in case the mismatch is result of failed setting of session cookie */
if (isset($_POST['set_session']) && $_POST['set_session'] != session_id()) {
trigger_error(
__(
'Failed to set session cookie. Maybe you are using '
. 'HTTP instead of HTTPS to access phpMyAdmin.'
),
E_USER_ERROR
);
}
/**
* We don't allow any POST operation parameters if the token is mismatched
* or is not provided
*/
$whitelist = array('ajax_request');
PhpMyAdmin\Sanitize::removeRequestVars($whitelist);
}
}
/**
* current selected database
* @global string $GLOBALS['db']
*/
Core::setGlobalDbOrTable('db');
/**
* current selected table
* @global string $GLOBALS['table']
*/
Core::setGlobalDbOrTable('table');
/**
* Store currently selected recent table.
* Affect $GLOBALS['db'] and $GLOBALS['table']
*/
if (Core::isValid($_REQUEST['selected_recent_table'])) {
$recent_table = json_decode($_REQUEST['selected_recent_table'], true);
$GLOBALS['db']
= (array_key_exists('db', $recent_table) && is_string($recent_table['db'])) ?
$recent_table['db'] : '';
$GLOBALS['url_params']['db'] = $GLOBALS['db'];
$GLOBALS['table']
= (array_key_exists('table', $recent_table) && is_string($recent_table['table'])) ?
$recent_table['table'] : '';
$GLOBALS['url_params']['table'] = $GLOBALS['table'];
}
/**
* SQL query to be executed
* @global string $GLOBALS['sql_query']
*/
$GLOBALS['sql_query'] = '';
if (Core::isValid($_POST['sql_query'])) {
$GLOBALS['sql_query'] = $_POST['sql_query'];
}
//$_REQUEST['set_theme'] // checked later in this file LABEL_theme_setup
//$_REQUEST['server']; // checked later in this file
//$_REQUEST['lang']; // checked by LABEL_loading_language_file
/******************************************************************************/
/* loading language file LABEL_loading_language_file */
/**
* lang detection is done here
*/
$language = LanguageManager::getInstance()->selectLanguage();
$language->activate();
/**
* check for errors occurred while loading configuration
* this check is done here after loading language files to present errors in locale
*/
$GLOBALS['PMA_Config']->checkPermissions();
$GLOBALS['PMA_Config']->checkErrors();
/* Check server configuration */
Core::checkConfiguration();
/* Check request for possible attacks */
Core::checkRequest();
/******************************************************************************/
/* setup servers LABEL_setup_servers */
$GLOBALS['PMA_Config']->checkServers();
/**
* current server
* @global integer $GLOBALS['server']
*/
$GLOBALS['server'] = $GLOBALS['PMA_Config']->selectServer();
$GLOBALS['url_params']['server'] = $GLOBALS['server'];
/**
* BC - enable backward compatibility
* exports all configuration settings into $GLOBALS ($GLOBALS['cfg'])
*/
$GLOBALS['PMA_Config']->enableBc();
/******************************************************************************/
/* setup themes LABEL_theme_setup */
ThemeManager::initializeTheme();
if (! defined('PMA_MINIMUM_COMMON')) {
/**
* save some settings in cookies
* @todo should be done in PhpMyAdmin\Config
*/
$GLOBALS['PMA_Config']->setCookie('pma_lang', $GLOBALS['lang']);
ThemeManager::getInstance()->setThemeCookie();
if (! empty($cfg['Server'])) {
/**
* Loads the proper database interface for this server
*/
DatabaseInterface::load();
// get LoginCookieValidity from preferences cache
// no generic solution for loading preferences from cache as some settings
// need to be kept for processing in
// PhpMyAdmin\Config::loadUserPreferences()
$cache_key = 'server_' . $GLOBALS['server'];
if (isset($_SESSION['cache'][$cache_key]['userprefs']['LoginCookieValidity'])
) {
$value
= $_SESSION['cache'][$cache_key]['userprefs']['LoginCookieValidity'];
$GLOBALS['PMA_Config']->set('LoginCookieValidity', $value);
$GLOBALS['cfg']['LoginCookieValidity'] = $value;
unset($value);
}
unset($cache_key);
// Gets the authentication library that fits the $cfg['Server'] settings
// and run authentication
/**
* the required auth type plugin
*/
$auth_class = 'PhpMyAdmin\\Plugins\\Auth\\Authentication' . ucfirst(strtolower($cfg['Server']['auth_type']));
if (! @class_exists($auth_class)) {
Core::fatalError(
__('Invalid authentication method set in configuration:')
. ' ' . $cfg['Server']['auth_type']
);
}
if (isset($_POST['pma_password']) && strlen($_POST['pma_password']) > 256) {
$_POST['pma_password'] = substr($_POST['pma_password'], 0, 256);
}
$auth_plugin = new $auth_class();
$auth_plugin->authenticate();
// Try to connect MySQL with the control user profile (will be used to
// get the privileges list for the current user but the true user link
// must be open after this one so it would be default one for all the
// scripts)
$controllink = false;
if ($cfg['Server']['controluser'] != '') {
$controllink = $GLOBALS['dbi']->connect(
DatabaseInterface::CONNECT_CONTROL
);
}
// Connects to the server (validates user's login)
/** @var DatabaseInterface $userlink */
$userlink = $GLOBALS['dbi']->connect(DatabaseInterface::CONNECT_USER);
if ($userlink === false) {
$auth_plugin->showFailure('mysql-denied');
}
if (! $controllink) {
/*
* Open separate connection for control queries, this is needed
* to avoid problems with table locking used in main connection
* and phpMyAdmin issuing queries to configuration storage, which
* is not locked by that time.
*/
$controllink = $GLOBALS['dbi']->connect(
DatabaseInterface::CONNECT_USER,
null,
DatabaseInterface::CONNECT_CONTROL
);
}
$auth_plugin->rememberCredentials();
$auth_plugin->checkTwoFactor();
/* Log success */
Logging::logUser($cfg['Server']['user']);
if ($GLOBALS['dbi']->getVersion() < $cfg['MysqlMinVersion']['internal']) {
Core::fatalError(
__('You should upgrade to %s %s or later.'),
array('MySQL', $cfg['MysqlMinVersion']['human'])
);
}
// Sets the default delimiter (if specified).
if (!empty($_REQUEST['sql_delimiter'])) {
PhpMyAdmin\SqlParser\Lexer::$DEFAULT_DELIMITER = $_REQUEST['sql_delimiter'];
}
// TODO: Set SQL modes too.
} else { // end server connecting
$response = Response::getInstance();
$response->getHeader()->disableMenuAndConsole();
$response->getFooter()->setMinimal();
}
/**
* check if profiling was requested and remember it
* (note: when $cfg['ServerDefault'] = 0, constant is not defined)
*/
if (isset($_REQUEST['profiling'])
&& Util::profilingSupported()
) {
$_SESSION['profiling'] = true;
} elseif (isset($_REQUEST['profiling_form'])) {
// the checkbox was unchecked
unset($_SESSION['profiling']);
}
/**
* Inclusion of profiling scripts is needed on various
* pages like sql, tbl_sql, db_sql, tbl_select
*/
$response = Response::getInstance();
if (isset($_SESSION['profiling'])) {
$scripts = $response->getHeader()->getScripts();
$scripts->addFile('chart.js');
$scripts->addFile('vendor/jqplot/jquery.jqplot.js');
$scripts->addFile('vendor/jqplot/plugins/jqplot.pieRenderer.js');
$scripts->addFile('vendor/jqplot/plugins/jqplot.highlighter.js');
$scripts->addFile('vendor/jquery/jquery.tablesorter.js');
}
/*
* There is no point in even attempting to process
* an ajax request if there is a token mismatch
*/
if ($response->isAjax() && $_SERVER['REQUEST_METHOD'] == 'POST' && $token_mismatch) {
$response->setRequestStatus(false);
$response->addJSON(
'message',
Message::error(__('Error: Token mismatch'))
);
exit;
}
}
// load user preferences
$GLOBALS['PMA_Config']->loadUserPreferences();
/* Tell tracker that it can actually work */
Tracker::enable();
if (! defined('PMA_MINIMUM_COMMON')
&& ! empty($GLOBALS['server'])
&& isset($GLOBALS['cfg']['ZeroConf'])
&& $GLOBALS['cfg']['ZeroConf'] == true
) {
$GLOBALS['dbi']->postConnectControl();
}
login/libraries/db_table_exists.inc.php 0000644 00000006531 15155311537 0014257 0 ustar 00 0) {
$is_db = @$GLOBALS['dbi']->selectDb($db);
} else {
$is_db = false;
}
if (! $is_db) {
// not a valid db name -> back to the welcome page
if (! defined('IS_TRANSFORMATION_WRAPPER')) {
$response = Response::getInstance();
if ($response->isAjax()) {
$response->setRequestStatus(false);
$response->addJSON(
'message',
Message::error(__('No databases selected.'))
);
} else {
$url_params = array('reload' => 1);
if (isset($message)) {
$url_params['message'] = $message;
}
if (! empty($sql_query)) {
$url_params['sql_query'] = $sql_query;
}
if (isset($show_as_php)) {
$url_params['show_as_php'] = $show_as_php;
}
Core::sendHeaderLocation(
'./index.php'
. Url::getCommonRaw($url_params)
);
}
exit;
}
}
} // end if (ensures db exists)
if (empty($is_table)
&& !defined('PMA_SUBMIT_MULT')
&& !defined('TABLE_MAY_BE_ABSENT')
) {
// Not a valid table name -> back to the db_sql.php
if (strlen($table) > 0) {
$is_table = $GLOBALS['dbi']->getCachedTableContent(array($db, $table), false);
if (! $is_table) {
$_result = $GLOBALS['dbi']->tryQuery(
'SHOW TABLES LIKE \''
. $GLOBALS['dbi']->escapeString($table) . '\';',
PhpMyAdmin\DatabaseInterface::CONNECT_USER,
PhpMyAdmin\DatabaseInterface::QUERY_STORE
);
$is_table = @$GLOBALS['dbi']->numRows($_result);
$GLOBALS['dbi']->freeResult($_result);
}
} else {
$is_table = false;
}
if (! $is_table) {
if (!defined('IS_TRANSFORMATION_WRAPPER')) {
if (strlen($table) > 0) {
// SHOW TABLES doesn't show temporary tables, so try select
// (as it can happen just in case temporary table, it should be
// fast):
/**
* @todo should this check really
* only happen if IS_TRANSFORMATION_WRAPPER?
*/
$_result = $GLOBALS['dbi']->tryQuery(
'SELECT COUNT(*) FROM ' . PhpMyAdmin\Util::backquote($table)
. ';',
PhpMyAdmin\DatabaseInterface::CONNECT_USER,
PhpMyAdmin\DatabaseInterface::QUERY_STORE
);
$is_table = ($_result && @$GLOBALS['dbi']->numRows($_result));
$GLOBALS['dbi']->freeResult($_result);
}
if (! $is_table) {
include './db_sql.php';
exit;
}
}
if (! $is_table) {
exit;
}
}
} // end if (ensures table exists)
login/libraries/config.default.php 0000644 00000211122 15155311537 0013236 0 ustar 00
* N N OOO !! DDDD OOO N N OOO TTTTT EEEE DDDD I TTTTT !!
* NN N O O !! D D O O NN N O O T E D D I T !!
* N N N O O !! D D O O N N N O O T EEEE D D I T !!
* N NN O O D D O O N NN O O T E D D I T
* N N OOO !! DDDD OOO N N OOO T EEEE DDDD I T !!
*
*
* DO NOT EDIT THIS FILE, EDIT config.inc.php INSTEAD !!!
*
* phpMyAdmin default configuration, you can copy values from here to your
* config.inc.php
*
* All directives are explained in the documentation
*
* @package PhpMyAdmin
*/
/**
* Your phpMyAdmin URL.
*
* Complete the variable below with the full URL ie
* https://example.com/path_to_your_phpMyAdmin_directory/
*
* It must contain characters that are valid for a URL, and the path is
* case sensitive on some Web servers, for example Unix-based servers.
*
* In most cases you can leave this variable empty, as the correct value
* will be detected automatically. However, we recommend that you do
* test to see that the auto-detection code works in your system. A good
* test is to browse a table, then edit a row and save it. There will be
* an error message if phpMyAdmin cannot auto-detect the correct value.
*
* @global string $cfg['PmaAbsoluteUri']
*/
$cfg['PmaAbsoluteUri'] = '';
/**
* Configure authentication logging destination
*
* @global string $cfg['AuthLog']
*/
$cfg['AuthLog'] = 'auto';
/**
* Whether to log successful authentication attempts
*
* @global boolean $cfg['AuthLogSuccess']
*/
$cfg['AuthLogSuccess'] = false;
/**
* Disable the default warning that is displayed on the DB Details Structure page if
* any of the required Tables for the configuration storage could not be found
*
* @global boolean $cfg['PmaNoRelation_DisableWarning']
*/
$cfg['PmaNoRelation_DisableWarning'] = false;
/**
* Disable the default warning that is displayed if Suhosin is detected
*
* @global boolean $cfg['SuhosinDisableWarning']
*/
$cfg['SuhosinDisableWarning'] = false;
/**
* Disable the default warning that is displayed if session.gc_maxlifetime
* is less than `LoginCookieValidity`
*
* @global boolean $cfg['LoginCookieValidityDisableWarning']
*/
$cfg['LoginCookieValidityDisableWarning'] = false;
/**
* Disable the default warning about MySQL reserved words in column names
*
* @global boolean $cfg['ReservedWordDisableWarning']
*/
$cfg['ReservedWordDisableWarning'] = false;
/**
* Show warning about incomplete translations on certain threshold.
*
* @global boolean $cfg['TranslationWarningThreshold']
*/
$cfg['TranslationWarningThreshold'] = 80;
/**
* Allows phpMyAdmin to be included from a other document in a frame;
* setting this to true is a potential security hole
*
* @global boolean $cfg['AllowThirdPartyFraming']
*/
$cfg['AllowThirdPartyFraming'] = false;
/**
* The 'cookie' auth_type uses AES algorithm to encrypt the password. If
* at least one server configuration uses 'cookie' auth_type, enter here a
* pass phrase that will be used by AES. The maximum length seems to be 46
* characters.
*
* @global string $cfg['blowfish_secret']
*/
$cfg['blowfish_secret'] = '';
/*******************************************************************************
* Server(s) configuration
*
* The $cfg['Servers'] array starts with $cfg['Servers'][1]. Do not use
* $cfg['Servers'][0]. You can disable a server configuration entry by setting host
* to ''. If you want more than one server, just copy following section
* (including $i incrementation) several times. There is no need to define
* full server array, just define values you need to change.
*
* @global array $cfg['Servers']
*/
$cfg['Servers'] = array();
$i = 1;
/**
* MySQL hostname or IP address
*
* @global string $cfg['Servers'][$i]['host']
*/
$cfg['Servers'][$i]['host'] = 'localhost';
/**
* MySQL port - leave blank for default port
*
* @global string $cfg['Servers'][$i]['port']
*/
$cfg['Servers'][$i]['port'] = '';
/**
* Path to the socket - leave blank for default socket
*
* @global string $cfg['Servers'][$i]['socket']
*/
$cfg['Servers'][$i]['socket'] = '';
/**
* Use SSL for connecting to MySQL server?
*
* @global boolean $cfg['Servers'][$i]['ssl']
*/
$cfg['Servers'][$i]['ssl'] = false;
/**
* Path to the key file when using SSL for connecting to the MySQL server
*
* @global string $cfg['Servers'][$i]['ssl_key']
*/
$cfg['Servers'][$i]['ssl_key'] = null;
/**
* Path to the cert file when using SSL for connecting to the MySQL server
*
* @global string $cfg['Servers'][$i]['ssl_cert']
*/
$cfg['Servers'][$i]['ssl_cert'] = null;
/**
* Path to the CA file when using SSL for connecting to the MySQL server
*
* @global string $cfg['Servers'][$i]['ssl_ca']
*/
$cfg['Servers'][$i]['ssl_ca'] = null;
/**
* Directory containing trusted SSL CA certificates in PEM format
*
* @global string $cfg['Servers'][$i]['ssl_ca_path']
*/
$cfg['Servers'][$i]['ssl_ca_path'] = null;
/**
* List of allowable ciphers for SSL connections to the MySQL server
*
* @global string $cfg['Servers'][$i]['ssl_ciphers']
*/
$cfg['Servers'][$i]['ssl_ciphers'] = null;
/**
* MySQL 5.6 or later triggers the mysqlnd driver in PHP to validate the
* peer_name of the SSL certifcate
* For most self-signed certificates this is a problem. Setting this to false
* will disable the check and allow the connection (PHP 5.6.16 or later)
*
* @link https://bugs.php.net/68344
* @global string $cfg['Servers'][$i]['ssl_verify']
*/
$cfg['Servers'][$i]['ssl_verify'] = true;
/**
* Use compressed protocol for the MySQL connection
*
* @global boolean $cfg['Servers'][$i]['compress']
*/
$cfg['Servers'][$i]['compress'] = false;
/**
* MySQL control host. This permits to use a host different than the
* main host, for the phpMyAdmin configuration storage. If left empty,
* $cfg['Servers'][$i]['host'] is used instead.
*
* @global string $cfg['Servers'][$i]['controlhost']
*/
$cfg['Servers'][$i]['controlhost'] = '';
/**
* MySQL control port. This permits to use a port different than the
* main port, for the phpMyAdmin configuration storage. If left empty,
* $cfg['Servers'][$i]['port'] is used instead.
*
* @global string $cfg['Servers'][$i]['controlport']
*/
$cfg['Servers'][$i]['controlport'] = '';
/**
* MySQL control user settings (this user must have read-only
* access to the "mysql/user" and "mysql/db" tables). The controluser is also
* used for all relational features (pmadb)
*
* @global string $cfg['Servers'][$i]['controluser']
*/
$cfg['Servers'][$i]['controluser'] = '';
/**
* MySQL control user settings (this user must have read-only
* access to the "mysql/user" and "mysql/db" tables). The controluser is also
* used for all relational features (pmadb)
*
* @global string $cfg['Servers'][$i]['controlpass']
*/
$cfg['Servers'][$i]['controlpass'] = '';
/**
* Authentication method (valid choices: config, http, signon or cookie)
*
* @global string $cfg['Servers'][$i]['auth_type']
*/
$cfg['Servers'][$i]['auth_type'] = 'cookie';
/**
* HTTP Basic Auth Realm name to display (only used with 'HTTP' auth_type)
*
* @global string $cfg['Servers'][$i]['auth_http_realm']
*/
$cfg['Servers'][$i]['auth_http_realm'] = '';
/**
* MySQL user
*
* @global string $cfg['Servers'][$i]['user']
*/
$cfg['Servers'][$i]['user'] = 'root';
/**
* MySQL password (only needed with 'config' auth_type)
*
* @global string $cfg['Servers'][$i]['password']
*/
$cfg['Servers'][$i]['password'] = '';
/**
* Session to use for 'signon' authentication method
*
* @global string $cfg['Servers'][$i]['SignonSession']
*/
$cfg['Servers'][$i]['SignonSession'] = '';
/**
* Cookie params to match session to use for 'signon' authentication method
* It should be an associative array matching result of session_get_cookie_params() in other system
*
* @global array $cfg['Servers'][$i]['SignonCookieParams']
*/
$cfg['Servers'][$i]['SignonCookieParams'] = array();
/**
* PHP script to use for 'signon' authentication method
*
* @global string $cfg['Servers'][$i]['SignonScript']
*/
$cfg['Servers'][$i]['SignonScript'] = '';
/**
* URL where to redirect user to login for 'signon' authentication method
*
* @global string $cfg['Servers'][$i]['SignonURL']
*/
$cfg['Servers'][$i]['SignonURL'] = '';
/**
* URL where to redirect user after logout
*
* @global string $cfg['Servers'][$i]['LogoutURL']
*/
$cfg['Servers'][$i]['LogoutURL'] = '';
/**
* If set to a db-name, only this db is displayed in navigation panel
* It may also be an array of db-names
*
* @global string $cfg['Servers'][$i]['only_db']
*/
$cfg['Servers'][$i]['only_db'] = '';
/**
* Database name to be hidden from listings
*
* @global string $cfg['Servers'][$i]['hide_db']
*/
$cfg['Servers'][$i]['hide_db'] = '';
/**
* Verbose name for this host - leave blank to show the hostname
* (for HTTP authentication, all non-US-ASCII characters will be stripped)
*
* @global string $cfg['Servers'][$i]['verbose']
*/
$cfg['Servers'][$i]['verbose'] = '';
/**
* Database used for Relation, Bookmark and PDF Features
* (see sql/create_tables.sql)
* - leave blank for no support
* SUGGESTED: 'phpmyadmin'
*
* @global string $cfg['Servers'][$i]['pmadb']
*/
$cfg['Servers'][$i]['pmadb'] = '';
/**
* Bookmark table
* - leave blank for no bookmark support
* SUGGESTED: 'pma__bookmark'
*
* @global string $cfg['Servers'][$i]['bookmarktable']
*/
$cfg['Servers'][$i]['bookmarktable'] = '';
/**
* table to describe the relation between links (see doc)
* - leave blank for no relation-links support
* SUGGESTED: 'pma__relation'
*
* @global string $cfg['Servers'][$i]['relation']
*/
$cfg['Servers'][$i]['relation'] = '';
/**
* table to describe the display fields
* - leave blank for no display fields support
* SUGGESTED: 'pma__table_info'
*
* @global string $cfg['Servers'][$i]['table_info']
*/
$cfg['Servers'][$i]['table_info'] = '';
/**
* table to describe the tables position for the designer and PDF schema
* - leave blank for no PDF schema support
* SUGGESTED: 'pma__table_coords'
*
* @global string $cfg['Servers'][$i]['table_coords']
*/
$cfg['Servers'][$i]['table_coords'] = '';
/**
* table to describe pages of relationpdf
* - leave blank if you don't want to use this
* SUGGESTED: 'pma__pdf_pages'
*
* @global string $cfg['Servers'][$i]['pdf_pages']
*/
$cfg['Servers'][$i]['pdf_pages'] = '';
/**
* table to store column information
* - leave blank for no column comments/mime types
* SUGGESTED: 'pma__column_info'
*
* @global string $cfg['Servers'][$i]['column_info']
*/
$cfg['Servers'][$i]['column_info'] = '';
/**
* table to store SQL history
* - leave blank for no SQL query history
* SUGGESTED: 'pma__history'
*
* @global string $cfg['Servers'][$i]['history']
*/
$cfg['Servers'][$i]['history'] = '';
/**
* table to store recently used tables
* - leave blank for no "persistent" recently used tables
* SUGGESTED: 'pma__recent'
*/
$cfg['Servers'][$i]['recent'] = '';
/**
* table to store favorite tables
* - leave blank for no favorite tables
* SUGGESTED: 'pma__favorite'
*/
$cfg['Servers'][$i]['favorite'] = '';
/**
* table to store UI preferences for tables
* - leave blank for no "persistent" UI preferences
* SUGGESTED: 'pma__table_uiprefs'
*/
$cfg['Servers'][$i]['table_uiprefs'] = '';
/**
* table to store SQL tracking
* - leave blank for no SQL tracking
* SUGGESTED: 'pma__tracking'
*
* @global string $cfg['Servers'][$i]['tracking']
*/
$cfg['Servers'][$i]['tracking'] = '';
/**
* table to store user preferences
* - leave blank to disable server storage
* SUGGESTED: 'pma__userconfig'
*
* @global string $cfg['Servers'][$i]['userconfig']
*/
$cfg['Servers'][$i]['userconfig'] = '';
/**
* table to store users and their assignment to user groups
* - leave blank to disable configurable menus feature
* SUGGESTED: 'pma__users'
*
* @global string $cfg['Servers'][$i]['users']
*/
$cfg['Servers'][$i]['users'] = '';
/**
* table to store allowed menu items for each user group
* - leave blank to disable configurable menus feature
* SUGGESTED: 'pma__usergroups'
*
* @global string $cfg['Servers'][$i]['usergroups']
*/
$cfg['Servers'][$i]['usergroups'] = '';
/**
* table to store information about item hidden from navigation tree
* - leave blank to disable hide/show navigation items feature
* SUGGESTED: 'pma__navigationhiding'
*
* @global string $cfg['Servers'][$i]['navigationhiding']
*/
$cfg['Servers'][$i]['navigationhiding'] = '';
/**
* table to store information about saved searches from query-by-example on a db
* - leave blank to disable saved searches feature
* SUGGESTED: 'pma__savedsearches'
*
* @global string $cfg['Servers'][$i]['savedsearches']
*/
$cfg['Servers'][$i]['savedsearches'] = '';
/**
* table to store central list of columns per database
* - leave blank to disable central list of columns feature
* SUGGESTED: 'pma__central_columns'
*
* @global string $cfg['Servers'][$i]['central_columns']
*/
$cfg['Servers'][$i]['central_columns'] = '';
/**
* table to store designer settings
* - leave blank to disable the storage of designer settings
* SUGGESTED: 'pma__designer_settings'
*
* @global string $cfg['Servers'][$i]['designer_settings']
*/
$cfg['Servers'][$i]['designer_settings'] = '';
/**
* table to store export templates
* - leave blank to disable saved searches feature
* SUGGESTED: 'pma__export_templates'
*
* @global string $cfg['Servers'][$i]['export_templates']
*/
$cfg['Servers'][$i]['export_templates'] = '';
/**
* Maximum number of records saved in $cfg['Servers'][$i]['table_uiprefs'] table.
*
* In case where tables in databases is modified (e.g. dropped or renamed),
* table_uiprefs may contains invalid data (referring to tables which are not
* exist anymore).
* This configuration make sure that we only keep N (N = MaxTableUiprefs)
* newest record in table_uiprefs and automatically delete older records.
*
* @global integer $cfg['Servers'][$i]['userconfig'] = '';
*/
$cfg['Servers'][$i]['MaxTableUiprefs'] = 100;
/**
* Sets the time zone used by phpMyAdmin. Possible values are explained at
* https://dev.mysql.com/doc/refman/5.7/en/time-zone-support.html
*
* @global string $cfg['Servers'][$i]['SessionTimeZone'] = ''
*/
$cfg['Servers'][$i]['SessionTimeZone'] = '';
/**
* whether to allow root login
*
* @global boolean $cfg['Servers'][$i]['AllowRoot']
*/
$cfg['Servers'][$i]['AllowRoot'] = true;
/**
* whether to allow login of any user without a password
*
* @global boolean $cfg['Servers'][$i]['AllowNoPassword']
*/
$cfg['Servers'][$i]['AllowNoPassword'] = false;
/**
* Host authentication order, leave blank to not use
*
* @global string $cfg['Servers'][$i]['AllowDeny']['order']
*/
$cfg['Servers'][$i]['AllowDeny']['order'] = '';
/**
* Host authentication rules, leave blank for defaults
*
* @global array $cfg['Servers'][$i]['AllowDeny']['rules']
*/
$cfg['Servers'][$i]['AllowDeny']['rules'] = array();
/**
* Disable use of INFORMATION_SCHEMA.
*
* @see https://github.com/phpmyadmin/phpmyadmin/issues/8970
* @see https://bugs.mysql.com/19588
* @global boolean $cfg['Servers'][$i]['DisableIS']
*/
$cfg['Servers'][$i]['DisableIS'] = false;
/**
* Whether the tracking mechanism creates
* versions for tables and views automatically.
*
* @global bool $cfg['Servers'][$i]['tracking_version_auto_create']
*/
$cfg['Servers'][$i]['tracking_version_auto_create'] = false;
/**
* Defines the list of statements
* the auto-creation uses for new versions.
*
* @global string $cfg['Servers'][$i]['tracking_default_statements']
*/
$cfg['Servers'][$i]['tracking_default_statements']
= 'CREATE TABLE,ALTER TABLE,DROP TABLE,RENAME TABLE,CREATE INDEX,' .
'DROP INDEX,INSERT,UPDATE,DELETE,TRUNCATE,REPLACE,CREATE VIEW,' .
'ALTER VIEW,DROP VIEW,CREATE DATABASE,ALTER DATABASE,DROP DATABASE';
/**
* Whether a DROP VIEW IF EXISTS statement will be added
* as first line to the log when creating a view.
*
* @global bool $cfg['Servers'][$i]['tracking_add_drop_view']
*/
$cfg['Servers'][$i]['tracking_add_drop_view'] = true;
/**
* Whether a DROP TABLE IF EXISTS statement will be added
* as first line to the log when creating a table.
*
* @global bool $cfg['Servers'][$i]['tracking_add_drop_table']
*/
$cfg['Servers'][$i]['tracking_add_drop_table'] = true;
/**
* Whether a DROP DATABASE IF EXISTS statement will be added
* as first line to the log when creating a database.
*
* @global bool $cfg['Servers'][$i]['tracking_add_drop_database']
*/
$cfg['Servers'][$i]['tracking_add_drop_database'] = true;
/**
* Default server (0 = no default server)
*
* If you have more than one server configured, you can set $cfg['ServerDefault']
* to any one of them to auto-connect to that server when phpMyAdmin is started,
* or set it to 0 to be given a list of servers without logging in
* If you have only one server configured, $cfg['ServerDefault'] *MUST* be
* set to that server.
*
* @global integer $cfg['ServerDefault']
*/
$cfg['ServerDefault'] = 1;
/*
* Other core phpMyAdmin settings
*/
/**
* whether version check is active
*
* @global boolean $cfg['VersionCheck']
*/
if (defined('VERSION_CHECK_DEFAULT')) {
$cfg['VersionCheck'] = VERSION_CHECK_DEFAULT;
} else {
$cfg['VersionCheck'] = true;
}
/**
* The url of the proxy to be used when retrieving the information about
* the latest version of phpMyAdmin or error reporting. You need this if
* the server where phpMyAdmin is installed does not have direct access to
* the internet.
* The format is: "hostname:portnumber"
*
* @global string $cfg['ProxyUrl']
*/
$cfg['ProxyUrl'] = "";
/**
* The username for authenticating with the proxy. By default, no
* authentication is performed. If a username is supplied, Basic
* Authentication will be performed. No other types of authentication
* are currently supported.
*
* @global string $cfg['ProxyUser']
*/
$cfg['ProxyUser'] = "";
/**
* The password for authenticating with the proxy.
*
* @global string $cfg['ProxyPass']
*/
$cfg['ProxyPass'] = "";
/**
* maximum number of db's displayed in database list
*
* @global integer $cfg['MaxDbList']
*/
$cfg['MaxDbList'] = 100;
/**
* maximum number of tables displayed in table list
*
* @global integer $cfg['MaxTableList']
*/
$cfg['MaxTableList'] = 250;
/**
* whether to show hint or not
*
* @global boolean $cfg['ShowHint']
*/
$cfg['ShowHint'] = true;
/**
* maximum number of characters when a SQL query is displayed
*
* @global integer $cfg['MaxCharactersInDisplayedSQL']
*/
$cfg['MaxCharactersInDisplayedSQL'] = 1000;
/**
* use GZIP output buffering if possible (true|false|'auto')
*
* @global string $cfg['OBGzip']
*/
$cfg['OBGzip'] = 'auto';
/**
* use persistent connections to MySQL database
*
* @global boolean $cfg['PersistentConnections']
*/
$cfg['PersistentConnections'] = false;
/**
* maximum execution time in seconds (0 for no limit)
*
* @global integer $cfg['ExecTimeLimit']
*/
$cfg['ExecTimeLimit'] = 300;
/**
* Path for storing session data (session_save_path PHP parameter).
*
* @global integer $cfg['SessionSavePath']
*/
$cfg['SessionSavePath'] = '';
/**
* maximum allocated bytes ('-1' for no limit, '0' for no change)
* this is a string because '16M' is a valid value; we must put here
* a string as the default value so that /setup accepts strings
*
* @global string $cfg['MemoryLimit']
*/
$cfg['MemoryLimit'] = '-1';
/**
* mark used tables, make possible to show locked tables (since MySQL 3.23.30)
*
* @global boolean $cfg['SkipLockedTables']
*/
$cfg['SkipLockedTables'] = false;
/**
* show SQL queries as run
*
* @global boolean $cfg['ShowSQL']
*/
$cfg['ShowSQL'] = true;
/**
* retain SQL input on Ajax execute
*
* @global boolean $cfg['RetainQueryEditor']
*/
$cfg['RetainQueryBox'] = false;
/**
* use CodeMirror syntax highlighting for editing SQL
*
* @global boolean $cfg['CodemirrorEnable']
*/
$cfg['CodemirrorEnable'] = true;
/**
* use the parser to find any errors in the query before executing
*
* @global boolean $cfg['LintEnable']
*/
$cfg['LintEnable'] = true;
/**
* show a 'Drop database' link to normal users
*
* @global boolean $cfg['AllowUserDropDatabase']
*/
$cfg['AllowUserDropDatabase'] = false;
/**
* confirm some commands that can result in loss of data
*
* @global boolean $cfg['Confirm']
*/
$cfg['Confirm'] = true;
/**
* recall previous login in cookie authentication mode or not
*
* @global boolean $cfg['LoginCookieRecall']
*/
$cfg['LoginCookieRecall'] = true;
/**
* validity of cookie login (in seconds; 1440 matches php.ini's
* session.gc_maxlifetime)
*
* @global integer $cfg['LoginCookieValidity']
*/
$cfg['LoginCookieValidity'] = 1440;
/**
* how long login cookie should be stored (in seconds)
*
* @global integer $cfg['LoginCookieStore']
*/
$cfg['LoginCookieStore'] = 0;
/**
* whether to delete all login cookies on logout
*
* @global boolean $cfg['LoginCookieDeleteAll']
*/
$cfg['LoginCookieDeleteAll'] = true;
/**
* whether to enable the "database search" feature or not
*
* @global boolean $cfg['UseDbSearch']
*/
$cfg['UseDbSearch'] = true;
/**
* if set to true, PMA continues computing multiple-statement queries
* even if one of the queries failed
*
* @global boolean $cfg['IgnoreMultiSubmitErrors']
*/
$cfg['IgnoreMultiSubmitErrors'] = false;
/**
* allow login to any user entered server in cookie based authentication
*
* @global boolean $cfg['AllowArbitraryServer']
*/
$cfg['AllowArbitraryServer'] = false;
/**
* restrict by IP (with regular expression) the MySQL servers the user can enter
* when $cfg['AllowArbitraryServer'] = true
*
* @global string $cfg['ArbitraryServerRegexp']
*/
$cfg['ArbitraryServerRegexp'] = '';
/**
* if reCaptcha is enabled it needs public key to connect with the service
*
* @global string $cfg['CaptchaLoginPublicKey']
*/
$cfg['CaptchaLoginPublicKey'] = '';
/**
* if reCaptcha is enabled it needs private key to connect with the service
*
* @global string $cfg['CaptchaLoginPrivateKey']
*/
$cfg['CaptchaLoginPrivateKey'] = '';
/*******************************************************************************
* Navigation panel setup
*/
/**
* In the navigation panel, replaces the database tree with a selector
*
* @global boolean $cfg['ShowDatabasesNavigationAsTree']
*/
$cfg['ShowDatabasesNavigationAsTree'] = true;
/**
* maximum number of first level databases displayed in navigation panel
*
* @global integer $cfg['FirstLevelNavigationItems']
*/
$cfg['FirstLevelNavigationItems'] = 100;
/**
* maximum number of items displayed in navigation panel
*
* @global integer $cfg['MaxNavigationItems']
*/
$cfg['MaxNavigationItems'] = 50;
/**
* turn the select-based light menu into a tree
*
* @global boolean $cfg['NavigationTreeEnableGrouping']
*/
$cfg['NavigationTreeEnableGrouping'] = true;
/**
* the separator to sub-tree the select-based light menu tree
*
* @global string $cfg['NavigationTreeDbSeparator']
*/
$cfg['NavigationTreeDbSeparator'] = '_';
/**
* Which string will be used to generate table prefixes
* to split/nest tables into multiple categories
*
* @global string $cfg['NavigationTreeTableSeparator']
*/
$cfg['NavigationTreeTableSeparator'] = '__';
/**
* How many sublevels should be displayed when splitting up tables
* by the above Separator
*
* @global integer $cfg['NavigationTreeTableLevel']
*/
$cfg['NavigationTreeTableLevel'] = 1;
/**
* link with main panel by highlighting the current db/table
*
* @global boolean $cfg['NavigationLinkWithMainPanel']
*/
$cfg['NavigationLinkWithMainPanel'] = true;
/**
* display logo at top of navigation panel
*
* @global boolean $cfg['NavigationDisplayLogo']
*/
$cfg['NavigationDisplayLogo'] = true;
/**
* where should logo link point to (can also contain an external URL)
*
* @global string $cfg['NavigationLogoLink']
*/
$cfg['NavigationLogoLink'] = 'index.php';
/**
* whether to open the linked page in the main window ('main') or
* in a new window ('new')
*
* @global string $cfg['NavigationLogoLinkWindow']
*/
$cfg['NavigationLogoLinkWindow'] = 'main';
/**
* number of recently used tables displayed in the navigation panel
*
* @global integer $cfg['NumRecentTables']
*/
$cfg['NumRecentTables'] = 10;
/**
* number of favorite tables displayed in the navigation panel
*
* @global integer $cfg['NumFavoriteTables']
*/
$cfg['NumFavoriteTables'] = 10;
/**
* display a JavaScript table filter in the navigation panel
* when more then x tables are present
*
* @global boolean $cfg['NavigationTreeDisplayItemFilterMinimum']
*/
$cfg['NavigationTreeDisplayItemFilterMinimum'] = 30;
/**
* display server choice at top of navigation panel
*
* @global boolean $cfg['NavigationDisplayServers']
*/
$cfg['NavigationDisplayServers'] = true;
/**
* server choice as links
*
* @global boolean $cfg['DisplayServersList']
*/
$cfg['DisplayServersList'] = false;
/**
* display a JavaScript database filter in the navigation panel
* when more then x databases are present
*
* @global boolean $cfg['NavigationTreeDisplayDbFilterMinimum']
*/
$cfg['NavigationTreeDisplayDbFilterMinimum'] = 30;
/**
* target of the navigation panel quick access icon
*
* Possible values:
* 'structure.php' = fields list
* 'sql' = SQL form
* 'search' = search page
* 'insert' = insert row page
* 'browse' = browse page
*
* @global string $cfg['NavigationTreeDefaultTabTable']
*/
$cfg['NavigationTreeDefaultTabTable'] = 'structure';
/**
* target of the navigation panel quick second access icon
*
* Possible values:
* 'structure' = fields list
* 'sql' = SQL form
* 'search' = search page
* 'insert' = insert row page
* 'browse' = browse page
* '' = no link
*
* @global string $cfg['NavigationTreeDefaultTabTable2']
*/
$cfg['NavigationTreeDefaultTabTable2'] = '';
/**
* Enables the possibility of navigation tree expansion
*
* @global boolean $cfg['NavigationTreeEnableExpansion']
*/
$cfg['NavigationTreeEnableExpansion'] = true;
/**
* Show tables in navigation panel
*
* @global boolean $cfg['NavigationTreeShowTables']
*/
$cfg['NavigationTreeShowTables'] = true;
/**
* Show views in navigation panel
*
* @global boolean $cfg['NavigationTreeShowViews']
*/
$cfg['NavigationTreeShowViews'] = true;
/**
* Show functions in navigation panel
*
* @global boolean $cfg['NavigationTreeShowFunctions']
*/
$cfg['NavigationTreeShowFunctions'] = true;
/**
* Show procedures in navigation panel
*
* @global boolean $cfg['NavigationTreeShowProcedures']
*/
$cfg['NavigationTreeShowProcedures'] = true;
/**
* Show events in navigation panel
*
* @global boolean $cfg['NavigationTreeShowEvents']
*/
$cfg['NavigationTreeShowEvents'] = true;
/**
* Width of navigation panel
*
* @global integer $cfg['NavigationWidth']
*/
$cfg['NavigationWidth'] = 240;
/*******************************************************************************
* In the main panel, at startup...
*/
/**
* allow to display statistics and space usage in the pages about database
* details and table properties
*
* @global boolean $cfg['ShowStats']
*/
$cfg['ShowStats'] = true;
/**
* show PHP info link
*
* @global boolean $cfg['ShowPhpInfo']
*/
$cfg['ShowPhpInfo'] = false;
/**
* show MySQL server and web server information
*
* @global boolean $cfg['ShowServerInfo']
*/
$cfg['ShowServerInfo'] = true;
/**
* show change password link
*
* @global boolean $cfg['ShowChgPassword']
*/
$cfg['ShowChgPassword'] = true;
/**
* show create database form
*
* @global boolean $cfg['ShowCreateDb']
*/
$cfg['ShowCreateDb'] = true;
/*******************************************************************************
* Database structure
*/
/** show charset column in database structure (true|false)?
*
* @global boolean $cfg['ShowDbStructureCharset']
*/
$cfg['ShowDbStructureCharset'] = false;
/**
* show comment column in database structure (true|false)?
*
* @global boolean $cfg['ShowDbStructureComment']
*/
$cfg['ShowDbStructureComment'] = false;
/**
* show creation timestamp column in database structure (true|false)?
*
* @global boolean $cfg['ShowDbStructureCreation']
*/
$cfg['ShowDbStructureCreation'] = false;
/**
* show last update timestamp column in database structure (true|false)?
*
* @global boolean $cfg['ShowDbStructureLastUpdate']
*/
$cfg['ShowDbStructureLastUpdate'] = false;
/**
* show last check timestamp column in database structure (true|false)?
*
* @global boolean $cfg['ShowDbStructureLastCheck']
*/
$cfg['ShowDbStructureLastCheck'] = false;
/**
* allow hide action columns to drop down menu in database structure (true|false)?
*
* @global boolean $cfg['HideStructureActions']
*/
$cfg['HideStructureActions'] = true;
/**
* Show column comments in table structure view (true|false)?
*
* @global boolean $cfg['ShowColumnComments']
*/
$cfg['ShowColumnComments'] = true;
/*******************************************************************************
* In browse mode...
*/
/**
* Use icons instead of text for the navigation bar buttons (table browse)
* ('text'|'icons'|'both')
*
* @global string $cfg['TableNavigationLinksMode']
*/
$cfg['TableNavigationLinksMode'] = 'icons';
/**
* Defines whether a user should be displayed a "show all (records)"
* button in browse mode or not.
*
* @global boolean $cfg['ShowAll']
*/
$cfg['ShowAll'] = false;
/**
* Number of rows displayed when browsing a result set. If the result
* set contains more rows, "Previous" and "Next".
* Possible values: 25,50,100,250,500
*
* @global integer $cfg['MaxRows']
*/
$cfg['MaxRows'] = 25;
/**
* default for 'ORDER BY' clause (valid values are 'ASC', 'DESC' or 'SMART' -ie
* descending order for fields of type TIME, DATE, DATETIME & TIMESTAMP,
* ascending order else-)
*
* @global string $cfg['Order']
*/
$cfg['Order'] = 'SMART';
/**
* grid editing: save edited cell(s) in browse-mode at once
*
* @global boolean $cfg['SaveCellsAtOnce']
*/
$cfg['SaveCellsAtOnce'] = false;
/**
* grid editing: which action triggers it, or completely disable the feature
*
* Possible values:
* 'click'
* 'double-click'
* 'disabled'
*
* @global string $cfg['GridEditing']
*/
$cfg['GridEditing'] ='double-click';
/**
* Options > Relational display
*
* Possible values:
* 'K' for key value
* 'D' for display column
*
* @global string $cfg['RelationalDisplay']
*
*/
$cfg['RelationalDisplay'] = 'K';
/*******************************************************************************
* In edit mode...
*/
/**
* disallow editing of binary fields
* valid values are:
* false allow editing
* 'blob' allow editing except for BLOB fields
* 'noblob' disallow editing except for BLOB fields
* 'all' disallow editing
*
* @global string $cfg['ProtectBinary']
*/
$cfg['ProtectBinary'] = 'blob';
/**
* Display the function fields in edit/insert mode
*
* @global boolean $cfg['ShowFunctionFields']
*/
$cfg['ShowFunctionFields'] = true;
/**
* Display the type fields in edit/insert mode
*
* @global boolean $cfg['ShowFieldTypesInDataEditView']
*/
$cfg['ShowFieldTypesInDataEditView'] = true;
/**
* Which editor should be used for CHAR/VARCHAR fields:
* input - allows limiting of input length
* textarea - allows newlines in fields
*
* @global string $cfg['CharEditing']
*/
$cfg['CharEditing'] = 'input';
/**
* The minimum size for character input fields
*
* @global integer $cfg['MinSizeForInputField']
*/
$cfg['MinSizeForInputField'] = 4;
/**
* The maximum size for character input fields
*
* @global integer $cfg['MinSizeForInputField']
*/
$cfg['MaxSizeForInputField'] = 60;
/**
* How many rows can be inserted at one time
*
* @global integer $cfg['InsertRows']
*/
$cfg['InsertRows'] = 2;
/**
* Sort order for items in a foreign-key drop-down list.
* 'content' is the referenced data, 'id' is the key value.
*
* @global array $cfg['ForeignKeyDropdownOrder']
*/
$cfg['ForeignKeyDropdownOrder'] = array('content-id', 'id-content');
/**
* A drop-down list will be used if fewer items are present
*
* @global integer $cfg['ForeignKeyMaxLimit']
*/
$cfg['ForeignKeyMaxLimit'] = 100;
/**
* Whether to disable foreign key checks while importing
*
* @global boolean $cfg['DefaultForeignKeyChecks']
*/
$cfg['DefaultForeignKeyChecks'] = 'default';
/*******************************************************************************
* For the export features...
*/
/**
* Allow for the use of zip compression (requires zip support to be enabled)
*
* @global boolean $cfg['ZipDump']
*/
$cfg['ZipDump'] = true;
/**
* Allow for the use of gzip compression (requires zlib)
*
* @global boolean $cfg['GZipDump']
*/
$cfg['GZipDump'] = true;
/**
* Allow for the use of bzip2 decompression (requires bz2 extension)
*
* @global boolean $cfg['BZipDump']
*/
$cfg['BZipDump'] = true;
/**
* Will compress gzip exports on the fly without the need for much memory.
* If you encounter problems with created gzip files disable this feature.
*
* @global boolean $cfg['CompressOnFly']
*/
$cfg['CompressOnFly'] = true;
/*******************************************************************************
* Tabs display settings
*/
/**
* How to display the menu tabs ('icons'|'text'|'both')
*
* @global boolean $cfg['TabsMode']
*/
$cfg['TabsMode'] = 'both';
/**
* How to display various action links ('icons'|'text'|'both')
*
* @global boolean $cfg['ActionLinksMode']
*/
$cfg['ActionLinksMode'] = 'both';
/**
* How many columns should be used for table display of a database?
* (a value larger than 1 results in some information being hidden)
*
* @global integer $cfg['PropertiesNumColumns']
*/
$cfg['PropertiesNumColumns'] = 1;
/**
* Possible values:
* 'welcome' = the welcome page
* (recommended for multiuser setups)
* 'databases' = list of databases
* 'status' = runtime information
* 'variables' = MySQL server variables
* 'privileges' = user management
*
* @global string $cfg['DefaultTabServer']
*/
$cfg['DefaultTabServer'] = 'welcome';
/**
* Possible values:
* 'structure' = tables list
* 'sql' = SQL form
* 'search' = search query
* 'operations' = operations on database
*
* @global string $cfg['DefaultTabDatabase']
*/
$cfg['DefaultTabDatabase'] = 'structure';
/**
* Possible values:
* 'structure' = fields list
* 'sql' = SQL form
* 'search' = search page
* 'insert' = insert row page
* 'browse' = browse page
*
* @global string $cfg['DefaultTabTable']
*/
$cfg['DefaultTabTable'] = 'browse';
/**
* Whether to display image or text or both image and text in table row
* action segment. Value can be either of ``image``, ``text`` or ``both``.
*/
$cfg['RowActionType'] = 'both';
/*******************************************************************************
* Export defaults
*/
$cfg['Export'] = array();
/**
* codegen/csv/excel/htmlexcel/htmlword/latex/ods/odt/pdf/sql/texytext/xml/yaml
*
* @global string $cfg['Export']['format']
*/
$cfg['Export']['format'] = 'sql';
/**
* quick/custom/custom-no-form
*
* @global string $cfg['Export']['format']
*/
$cfg['Export']['method'] = 'quick';
/**
* none/zip/gzip
*
* @global string $cfg['Export']['compression']
*/
$cfg['Export']['compression'] = 'none';
/**
* Whether to LOCK TABLES before exporting
*
* @global boolean $cfg['Export']['lock_tables']
*/
$cfg['Export']['lock_tables'] = false;
/**
* Whether to export databases/tables as separate files
*
* @global boolean $cfg['Export']['as_separate_files']
*/
$cfg['Export']['as_separate_files'] = false;
/**
*
*
* @global boolean $cfg['Export']['asfile']
*/
$cfg['Export']['asfile'] = true;
/**
*
*
* @global string $cfg['Export']['charset']
*/
$cfg['Export']['charset'] = '';
/**
*
*
* @global boolean $cfg['Export']['onserver']
*/
$cfg['Export']['onserver'] = false;
/**
*
*
* @global boolean $cfg['Export']['onserver_overwrite']
*/
$cfg['Export']['onserver_overwrite'] = false;
/**
*
*
* @global boolean $cfg['Export']['quick_export_onserver']
*/
$cfg['Export']['quick_export_onserver'] = false;
/**
*
*
* @global boolean $cfg['Export']['quick_export_onserver_overwrite']
*/
$cfg['Export']['quick_export_onserver_overwrite'] = false;
/**
*
*
* @global boolean $cfg['Export']['remember_file_template']
*/
$cfg['Export']['remember_file_template'] = true;
/**
*
*
* @global string $cfg['Export']['file_template_table']
*/
$cfg['Export']['file_template_table'] = '@TABLE@';
/**
*
*
* @global string $cfg['Export']['file_template_database']
*/
$cfg['Export']['file_template_database'] = '@DATABASE@';
/**
*
*
* @global string $cfg['Export']['file_template_server']
*/
$cfg['Export']['file_template_server'] = '@SERVER@';
/**
*
*
* @global string $cfg['Export']['codegen_structure_or_data']
*/
$cfg['Export']['codegen_structure_or_data'] = 'data';
/**
*
*
* @global $cfg['Export']['codegen_format']
*/
$cfg['Export']['codegen_format'] = 0;
/**
*
*
* @global boolean $cfg['Export']['ods_columns']
*/
$cfg['Export']['ods_columns'] = false;
/**
*
*
* @global string $cfg['Export']['ods_null']
*/
$cfg['Export']['ods_null'] = 'NULL';
/**
*
*
* @global string $cfg['Export']['odt_structure_or_data']
*/
$cfg['Export']['odt_structure_or_data'] = 'structure_and_data';
/**
*
*
* @global boolean $cfg['Export']['odt_columns']
*/
$cfg['Export']['odt_columns'] = true;
/**
*
*
* @global boolean $cfg['Export']['odt_relation']
*/
$cfg['Export']['odt_relation'] = true;
/**
*
*
* @global boolean $cfg['Export']['odt_comments']
*/
$cfg['Export']['odt_comments'] = true;
/**
*
*
* @global boolean $cfg['Export']['odt_mime']
*/
$cfg['Export']['odt_mime'] = true;
/**
*
*
* @global string $cfg['Export']['odt_null']
*/
$cfg['Export']['odt_null'] = 'NULL';
/**
*
*
* @global boolean $cfg['Export']['htmlword_structure_or_data']
*/
$cfg['Export']['htmlword_structure_or_data'] = 'structure_and_data';
/**
*
*
* @global boolean $cfg['Export']['htmlword_columns']
*/
$cfg['Export']['htmlword_columns'] = false;
/**
*
*
* @global string $cfg['Export']['htmlword_null']
*/
$cfg['Export']['htmlword_null'] = 'NULL';
/**
*
*
* @global string $cfg['Export']['texytext_structure_or_data']
*/
$cfg['Export']['texytext_structure_or_data'] = 'structure_and_data';
/**
*
*
* @global boolean $cfg['Export']['texytext_columns']
*/
$cfg['Export']['texytext_columns'] = false;
/**
*
*
* @global string $cfg['Export']['texytext_null']
*/
$cfg['Export']['texytext_null'] = 'NULL';
/**
*
*
* @global boolean $cfg['Export']['csv_columns']
*/
$cfg['Export']['csv_columns'] = false;
/**
*
*
* @global string $cfg['Export']['csv_structure_or_data']
*/
$cfg['Export']['csv_structure_or_data'] = 'data';
/**
*
*
* @global string $cfg['Export']['csv_null']
*/
$cfg['Export']['csv_null'] = 'NULL';
/**
*
*
* @global string $cfg['Export']['csv_separator']
*/
$cfg['Export']['csv_separator'] = ',';
/**
*
*
* @global string $cfg['Export']['csv_enclosed']
*/
$cfg['Export']['csv_enclosed'] = '"';
/**
*
*
* @global string $cfg['Export']['csv_escaped']
*/
$cfg['Export']['csv_escaped'] = '"';
/**
*
*
* @global string $cfg['Export']['csv_terminated']
*/
$cfg['Export']['csv_terminated'] = 'AUTO';
/**
*
*
* @global string $cfg['Export']['csv_removeCRLF']
*/
$cfg['Export']['csv_removeCRLF'] = false;
/**
*
*
* @global boolean $cfg['Export']['excel_columns']
*/
$cfg['Export']['excel_columns'] = true;
/**
*
*
* @global string $cfg['Export']['excel_null']
*/
$cfg['Export']['excel_null'] = 'NULL';
/**
* win/mac
*
* @global string $cfg['Export']['excel_edition']
*/
$cfg['Export']['excel_edition'] = 'win';
/**
*
*
* @global string $cfg['Export']['excel_removeCRLF']
*/
$cfg['Export']['excel_removeCRLF'] = false;
/**
*
*
* @global string $cfg['Export']['excel_structure_or_data']
*/
$cfg['Export']['excel_structure_or_data'] = 'data';
/**
*
*
* @global string $cfg['Export']['latex_structure_or_data']
*/
$cfg['Export']['latex_structure_or_data'] = 'structure_and_data';
/**
*
*
* @global boolean $cfg['Export']['latex_columns']
*/
$cfg['Export']['latex_columns'] = true;
/**
*
*
* @global boolean $cfg['Export']['latex_relation']
*/
$cfg['Export']['latex_relation'] = true;
/**
*
*
* @global boolean $cfg['Export']['latex_comments']
*/
$cfg['Export']['latex_comments'] = true;
/**
*
*
* @global boolean $cfg['Export']['latex_mime']
*/
$cfg['Export']['latex_mime'] = true;
/**
*
*
* @global string $cfg['Export']['latex_null']
*/
$cfg['Export']['latex_null'] = '\textit{NULL}';
/**
*
*
* @global boolean $cfg['Export']['latex_caption']
*/
$cfg['Export']['latex_caption'] = true;
/**
*
*
* @global string $cfg['Export']['latex_structure_caption']
*/
$cfg['Export']['latex_structure_caption'] = 'strLatexStructure';
/**
*
*
* @global string $cfg['Export']['latex_structure_continued_caption']
*/
$cfg['Export']['latex_structure_continued_caption']
= 'strLatexStructure strLatexContinued';
/**
*
*
* @global string $cfg['Export']['latex_data_caption']
*/
$cfg['Export']['latex_data_caption'] = 'strLatexContent';
/**
*
*
* @global string $cfg['Export']['latex_data_continued_caption']
*/
$cfg['Export']['latex_data_continued_caption'] = 'strLatexContent strLatexContinued';
/**
*
*
* @global string $cfg['Export']['latex_data_label']
*/
$cfg['Export']['latex_data_label'] = 'tab:@TABLE@-data';
/**
*
*
* @global string $cfg['Export']['latex_structure_label']
*/
$cfg['Export']['latex_structure_label'] = 'tab:@TABLE@-structure';
/**
*
*
* @global string $cfg['Export']['mediawiki_structure_or_data']
*/
$cfg['Export']['mediawiki_structure_or_data'] = 'data';
/**
*
*
* @global boolean $cfg['Export']['mediawiki_caption']
*/
$cfg['Export']['mediawiki_caption'] = true;
/**
*
*
* @global boolean $cfg['Export']['mediawiki_headers']
*/
$cfg['Export']['mediawiki_headers'] = true;
/**
*
*
* @global string $cfg['Export']['ods_structure_or_data']
*/
$cfg['Export']['ods_structure_or_data'] = 'data';
/**
*
*
* @global string $cfg['Export']['pdf_structure_or_data']
*/
$cfg['Export']['pdf_structure_or_data'] = 'data';
/**
*
*
* @global string $cfg['Export']['phparray_structure_or_data']
*/
$cfg['Export']['phparray_structure_or_data'] = 'data';
/**
*
*
* @global string $cfg['Export']['json_structure_or_data']
*/
$cfg['Export']['json_structure_or_data'] = 'data';
/**
* Export functions
*
* @global string $cfg['Export']['json_pretty_print']
*/
$cfg['Export']['json_pretty_print'] = false;
/**
* Export functions
*
* @global string $cfg['Export']['json_unicode']
*/
$cfg['Export']['json_unicode'] = true;
/**
*
*
* @global string $cfg['Export']['sql_structure_or_data']
*/
$cfg['Export']['sql_structure_or_data'] = 'structure_and_data';
/**
*
*
* @global string $cfg['Export']['sql_compatibility']
*/
$cfg['Export']['sql_compatibility'] = 'NONE';
/**
* Whether to include comments in SQL export.
*
* @global string $cfg['Export']['sql_include_comments']
*/
$cfg['Export']['sql_include_comments'] = true;
/**
*
*
* @global boolean $cfg['Export']['sql_disable_fk']
*/
$cfg['Export']['sql_disable_fk'] = false;
/**
*
*
* @global boolean $cfg['Export']['sql_views_as_tables']
*/
$cfg['Export']['sql_views_as_tables'] = false;
/**
*
*
* @global boolean $cfg['Export']['sql_metadata']
*/
$cfg['Export']['sql_metadata'] = false;
/**
*
*
* @global boolean $cfg['Export']['sql_use_transaction']
*/
$cfg['Export']['sql_use_transaction'] = true;
/**
*
*
* @global boolean $cfg['Export']['sql_create_database']
*/
$cfg['Export']['sql_create_database'] = false;
/**
*
*
* @global boolean $cfg['Export']['sql_drop_database']
*/
$cfg['Export']['sql_drop_database'] = false;
/**
*
*
* @global boolean $cfg['Export']['sql_drop_table']
*/
$cfg['Export']['sql_drop_table'] = false;
/**
*
*
* true by default for correct behavior when dealing with exporting
* of VIEWs and the stand-in table
* @global boolean $cfg['Export']['sql_if_not_exists']
*/
$cfg['Export']['sql_if_not_exists'] = false;
/**
*
*
* @global boolean $cfg['Export']['sql_procedure_function']
*/
$cfg['Export']['sql_procedure_function'] = true;
/**
*
*
* @global boolean $cfg['Export']['sql_create_table']
*/
$cfg['Export']['sql_create_table'] = true;
/**
*
*
* @global boolean $cfg['Export']['sql_create_view']
*/
$cfg['Export']['sql_create_view'] = true;
/**
*
*
* @global boolean $cfg['Export']['sql_create_trigger']
*/
$cfg['Export']['sql_create_trigger'] = true;
/**
*
*
* @global boolean $cfg['Export']['sql_auto_increment']
*/
$cfg['Export']['sql_auto_increment'] = true;
/**
*
*
* @global boolean $cfg['Export']['sql_backquotes']
*/
$cfg['Export']['sql_backquotes'] = true;
/**
*
*
* @global boolean $cfg['Export']['sql_dates']
*/
$cfg['Export']['sql_dates'] = false;
/**
*
*
* @global boolean $cfg['Export']['sql_relation']
*/
$cfg['Export']['sql_relation'] = false;
/**
*
*
* @global boolean $cfg['Export']['sql_truncate']
*/
$cfg['Export']['sql_truncate'] = false;
/**
*
*
* @global boolean $cfg['Export']['sql_delayed']
*/
$cfg['Export']['sql_delayed'] = false;
/**
*
*
* @global boolean $cfg['Export']['sql_ignore']
*/
$cfg['Export']['sql_ignore'] = false;
/**
* Export time in UTC.
*
* @global boolean $cfg['Export']['sql_utc_time']
*/
$cfg['Export']['sql_utc_time'] = true;
/**
*
*
* @global boolean $cfg['Export']['sql_hex_for_binary']
*/
$cfg['Export']['sql_hex_for_binary'] = true;
/**
* insert/update/replace
*
* @global string $cfg['Export']['sql_type']
*/
$cfg['Export']['sql_type'] = 'INSERT';
/**
*
*
* @global integer $cfg['Export']['sql_max_query_size']
*/
$cfg['Export']['sql_max_query_size'] = 50000;
/**
*
*
* @global boolean $cfg['Export']['sql_mime']
*/
$cfg['Export']['sql_mime'] = false;
/**
* \n is replaced by new line
*
* @global string $cfg['Export']['sql_header_comment']
*/
$cfg['Export']['sql_header_comment'] = '';
/**
* Whether to use complete inserts, extended inserts, both, or neither
*
* @global string $cfg['Export']['sql_insert_syntax']
*/
$cfg['Export']['sql_insert_syntax'] = 'both';
/**
*
*
* @global string $cfg['Export']['pdf_report_title']
*/
$cfg['Export']['pdf_report_title'] = '';
/**
*
*
*@global string $cfg['Export']['xml_structure_or_data']
*/
$cfg['Export']['xml_structure_or_data'] = 'data';
/**
* Export schema for each structure
*
* @global string $cfg['Export']['xml_export_struc']
*/
$cfg['Export']['xml_export_struc'] = true;
/**
* Export events
*
* @global string $cfg['Export']['xml_export_events']
*/
$cfg['Export']['xml_export_events'] = true;
/**
* Export functions
*
* @global string $cfg['Export']['xml_export_functions']
*/
$cfg['Export']['xml_export_functions'] = true;
/**
* Export procedures
*
* @global string $cfg['Export']['xml_export_procedures']
*/
$cfg['Export']['xml_export_procedures'] = true;
/**
* Export schema for each table
*
* @global string $cfg['Export']['xml_export_tables']
*/
$cfg['Export']['xml_export_tables'] = true;
/**
* Export triggers
*
* @global string $cfg['Export']['xml_export_triggers']
*/
$cfg['Export']['xml_export_triggers'] = true;
/**
* Export views
*
* @global string $cfg['Export']['xml_export_views']
*/
$cfg['Export']['xml_export_views'] = true;
/**
* Export contents data
*
* @global string $cfg['Export']['xml_export_contents']
*/
$cfg['Export']['xml_export_contents'] = true;
/**
*
*
* @global string $cfg['Export']['yaml_structure_or_data']
*/
$cfg['Export']['yaml_structure_or_data'] = 'data';
/*******************************************************************************
* Import defaults
*/
$cfg['Import'] = array();
/**
*
*
* @global string $cfg['Import']['format']
*/
$cfg['Import']['format'] = 'sql';
/**
* Default charset for import.
*
* @global string $cfg['Import']['charset']
*/
$cfg['Import']['charset'] = '';
/**
*
*
* @global boolean $cfg['Import']['allow_interrupt']
*/
$cfg['Import']['allow_interrupt'] = true;
/**
*
*
* @global integer $cfg['Import']['skip_queries']
*/
$cfg['Import']['skip_queries'] = 0;
/**
*
*
* @global string $cfg['Import']['sql_compatibility']
*/
$cfg['Import']['sql_compatibility'] = 'NONE';
/**
*
*
* @global string $cfg['Import']['sql_no_auto_value_on_zero']
*/
$cfg['Import']['sql_no_auto_value_on_zero'] = true;
/**
*
*
* @global string $cfg['Import']['sql_read_as_multibytes']
*/
$cfg['Import']['sql_read_as_multibytes'] = false;
/**
*
*
* @global boolean $cfg['Import']['csv_replace']
*/
$cfg['Import']['csv_replace'] = false;
/**
*
*
* @global boolean $cfg['Import']['csv_ignore']
*/
$cfg['Import']['csv_ignore'] = false;
/**
*
*
* @global string $cfg['Import']['csv_terminated']
*/
$cfg['Import']['csv_terminated'] = ',';
/**
*
*
* @global string $cfg['Import']['csv_enclosed']
*/
$cfg['Import']['csv_enclosed'] = '"';
/**
*
*
* @global string $cfg['Import']['csv_escaped']
*/
$cfg['Import']['csv_escaped'] = '"';
/**
*
*
* @global string $cfg['Import']['csv_new_line']
*/
$cfg['Import']['csv_new_line'] = 'auto';
/**
*
*
* @global string $cfg['Import']['csv_columns']
*/
$cfg['Import']['csv_columns'] = '';
/**
*
*
* @global string $cfg['Import']['csv_col_names']
*/
$cfg['Import']['csv_col_names'] = false;
/**
*
*
* @global boolean $cfg['Import']['ldi_replace']
*/
$cfg['Import']['ldi_replace'] = false;
/**
*
*
* @global boolean $cfg['Import']['ldi_ignore']
*/
$cfg['Import']['ldi_ignore'] = false;
/**
*
*
* @global string $cfg['Import']['ldi_terminated']
*/
$cfg['Import']['ldi_terminated'] = ';';
/**
*
*
* @global string $cfg['Import']['ldi_enclosed']
*/
$cfg['Import']['ldi_enclosed'] = '"';
/**
*
*
* @global string $cfg['Import']['ldi_escaped']
*/
$cfg['Import']['ldi_escaped'] = '\\';
/**
*
*
* @global string $cfg['Import']['ldi_new_line']
*/
$cfg['Import']['ldi_new_line'] = 'auto';
/**
*
*
* @global string $cfg['Import']['ldi_columns']
*/
$cfg['Import']['ldi_columns'] = '';
/**
* 'auto' for auto-detection, true or false for forcing
*
* @global string $cfg['Import']['ldi_local_option']
*/
$cfg['Import']['ldi_local_option'] = 'auto';
/**
*
*
* @global string $cfg['Import']['ods_col_names']
*/
$cfg['Import']['ods_col_names'] = false;
/**
*
*
* @global string $cfg['Import']['ods_empty_rows']
*/
$cfg['Import']['ods_empty_rows'] = true;
/**
*
*
* @global string $cfg['Import']['ods_recognize_percentages']
*/
$cfg['Import']['ods_recognize_percentages'] = true;
/**
*
*
* @global string $cfg['Import']['ods_recognize_currency']
*/
$cfg['Import']['ods_recognize_currency'] = true;
/*******************************************************************************
* Schema export defaults
*/
$cfg['Schema'] = array();
/**
* pdf/eps/dia/svg
*
* @global string $cfg['Schema']['format']
*/
$cfg['Schema']['format'] = 'pdf';
/**
*
*
* @global string $cfg['Schema']['pdf_show_color']
*/
$cfg['Schema']['pdf_show_color'] = true;
/**
*
*
* @global string $cfg['Schema']['pdf_show_keys']
*/
$cfg['Schema']['pdf_show_keys'] = false;
/**
*
*
* @global string $cfg['Schema']['pdf_all_tables_same_width']
*/
$cfg['Schema']['pdf_all_tables_same_width'] = false;
/**
* L/P
*
* @global string $cfg['Schema']['pdf_orientation']
*/
$cfg['Schema']['pdf_orientation'] = 'L';
/**
*
*
* @global string $cfg['Schema']['pdf_paper']
*/
$cfg['Schema']['pdf_paper'] = 'A4';
/**
*
*
* @global string $cfg['Schema']['pdf_show_grid']
*/
$cfg['Schema']['pdf_show_grid'] = false;
/**
*
*
* @global string $cfg['Schema']['pdf_with_doc']
*/
$cfg['Schema']['pdf_with_doc'] = true;
/**
*
*
* @global string $cfg['Schema']['pdf_table_order']
*/
$cfg['Schema']['pdf_table_order'] = '';
/**
*
*
* @global string $cfg['Schema']['dia_show_color']
*/
$cfg['Schema']['dia_show_color'] = true;
/**
*
*
* @global string $cfg['Schema']['dia_show_keys']
*/
$cfg['Schema']['dia_show_keys'] = false;
/**
* L/P
*
* @global string $cfg['Schema']['dia_orientation']
*/
$cfg['Schema']['dia_orientation'] = 'L';
/**
*
*
* @global string $cfg['Schema']['dia_paper']
*/
$cfg['Schema']['dia_paper'] = 'A4';
/**
*
*
* @global string $cfg['Schema']['eps_show_color']
*/
$cfg['Schema']['eps_show_color'] = true;
/**
*
*
* @global string $cfg['Schema']['eps_show_keys']
*/
$cfg['Schema']['eps_show_keys'] = false;
/**
*
*
* @global string $cfg['Schema']['eps_all_tables_same_width']
*/
$cfg['Schema']['eps_all_tables_same_width'] = false;
/**
* L/P
*
* @global string $cfg['Schema']['eps_orientation']
*/
$cfg['Schema']['eps_orientation'] = 'L';
/**
*
*
* @global string $cfg['Schema']['svg_show_color']
*/
$cfg['Schema']['svg_show_color'] = true;
/**
*
*
* @global string $cfg['Schema']['svg_show_keys']
*/
$cfg['Schema']['svg_show_keys'] = false;
/**
*
*
* @global string $cfg['Schema']['svg_all_tables_same_width']
*/
$cfg['Schema']['svg_all_tables_same_width'] = false;
/*******************************************************************************
* PDF options
*/
/**
*
*
* @global array $cfg['PDFPageSizes']
*/
$cfg['PDFPageSizes'] = array('A3', 'A4', 'A5', 'letter', 'legal');
/**
*
*
* @global string $cfg['PDFDefaultPageSize']
*/
$cfg['PDFDefaultPageSize'] = 'A4';
/*******************************************************************************
* Language and character set conversion settings
*/
/**
* Default language to use, if not browser-defined or user-defined
*
* @global string $cfg['DefaultLang']
*/
$cfg['DefaultLang'] = 'en';
/**
* Default connection collation
*
* @global string $cfg['DefaultConnectionCollation']
*/
$cfg['DefaultConnectionCollation'] = 'utf8mb4_unicode_ci';
/**
* Force: always use this language, e.g. 'en'
*
* @global string $cfg['Lang']
*/
$cfg['Lang'] = '';
/**
* Regular expression to limit listed languages, e.g. '^(cs|en)' for Czech and
* English only
*
* @global string $cfg['FilterLanguages']
*/
$cfg['FilterLanguages'] = '';
/**
* You can select here which functions will be used for character set conversion.
* Possible values are:
* auto - automatically use available one (first is tested iconv, then
* recode)
* iconv - use iconv or libiconv functions
* recode - use recode_string function
* mb - use mbstring extension
* none - disable encoding conversion
*
* @global string $cfg['RecodingEngine']
*/
$cfg['RecodingEngine'] = 'auto';
/**
* Specify some parameters for iconv used in character set conversion. See iconv
* documentation for details:
* https://www.gnu.org/savannah-checkouts/gnu/libiconv/documentation/libiconv-1.15/iconv_open.3.html
*
* @global string $cfg['IconvExtraParams']
*/
$cfg['IconvExtraParams'] = '//TRANSLIT';
/**
* Available character sets for MySQL conversion. currently contains all which could
* be found in lang/* files and few more.
* Character sets will be shown in same order as here listed, so if you frequently
* use some of these move them to the top.
*
* @global array $cfg['AvailableCharsets']
*/
$cfg['AvailableCharsets'] = array(
'iso-8859-1',
'iso-8859-2',
'iso-8859-3',
'iso-8859-4',
'iso-8859-5',
'iso-8859-6',
'iso-8859-7',
'iso-8859-8',
'iso-8859-9',
'iso-8859-10',
'iso-8859-11',
'iso-8859-12',
'iso-8859-13',
'iso-8859-14',
'iso-8859-15',
'windows-1250',
'windows-1251',
'windows-1252',
'windows-1256',
'windows-1257',
'koi8-r',
'big5',
'gb2312',
'utf-16',
'utf-8',
'utf-7',
'x-user-defined',
'euc-jp',
'ks_c_5601-1987',
'tis-620',
'SHIFT_JIS',
'SJIS',
'SJIS-win',
);
/*******************************************************************************
* Customization & design
*
* The graphical settings are now located in themes/theme-name/layout.inc.php
*/
/**
* enable the left panel pointer
* see also LeftPointerColor
* in layout.inc.php
*
* @global boolean $cfg['NavigationTreePointerEnable']
*/
$cfg['NavigationTreePointerEnable'] = true;
/**
* enable the browse pointer
* see also BrowsePointerColor
* in layout.inc.php
*
* @global boolean $cfg['BrowsePointerEnable']
*/
$cfg['BrowsePointerEnable'] = true;
/**
* enable the browse marker
* see also BrowseMarkerColor
* in layout.inc.php
*
* @global boolean $cfg['BrowseMarkerEnable']
*/
$cfg['BrowseMarkerEnable'] = true;
/**
* textarea size (columns) in edit mode
* (this value will be emphasized (*2) for SQL
* query textareas and (*1.25) for query window)
*
* @global integer $cfg['TextareaCols']
*/
$cfg['TextareaCols'] = 40;
/**
* textarea size (rows) in edit mode
*
* @global integer $cfg['TextareaRows']
*/
$cfg['TextareaRows'] = 15;
/**
* double size of textarea size for LONGTEXT columns
*
* @global boolean $cfg['LongtextDoubleTextarea']
*/
$cfg['LongtextDoubleTextarea'] = true;
/**
* auto-select when clicking in the textarea of the query-box
*
* @global boolean $cfg['TextareaAutoSelect']
*/
$cfg['TextareaAutoSelect'] = false;
/**
* textarea size (columns) for CHAR/VARCHAR
*
* @global integer $cfg['CharTextareaCols']
*/
$cfg['CharTextareaCols'] = 40;
/**
* textarea size (rows) for CHAR/VARCHAR
*
* @global integer $cfg['CharTextareaRows']
*/
$cfg['CharTextareaRows'] = 2;
/**
* Max field data length in browse mode for all non-numeric fields
*
* @global integer $cfg['LimitChars']
*/
$cfg['LimitChars'] = 50;
/**
* Where to show the edit/copy/delete links in browse mode
* Possible values are 'left', 'right', 'both' and 'none'.
*
* @global string $cfg['RowActionLinks']
*/
$cfg['RowActionLinks'] = 'left';
/**
* Whether to show row links (Edit, Copy, Delete) and checkboxes for
* multiple row operations even when the selection does not have a unique key.
*
* @global boolean $cfg['RowActionLinksWithoutUnique']
*/
$cfg['RowActionLinksWithoutUnique'] = false;
/**
* Default sort order by primary key.
* @global string $cfg['TablePrimaryKeyOrder']
*/
$cfg['TablePrimaryKeyOrder'] = 'NONE';
/**
* remember the last way a table sorted
*
* @global string $cfg['RememberSorting']
*/
$cfg['RememberSorting'] = true;
/**
* shows column comments in 'browse' mode.
*
* @global boolean $cfg['ShowBrowseComments']
*/
$cfg['ShowBrowseComments'] = true;
/**
* shows column comments in 'table property' mode.
*
* @global boolean $cfg['ShowPropertyComments']
*/
$cfg['ShowPropertyComments']= true;
/**
* repeat header names every X cells? (0 = deactivate)
*
* @global integer $cfg['RepeatCells']
*/
$cfg['RepeatCells'] = 100;
/**
* Set to true if you want DB-based query history.If false, this utilizes
* JS-routines to display query history (lost by window close)
*
* @global boolean $cfg['QueryHistoryDB']
*/
$cfg['QueryHistoryDB'] = false;
/**
* When using DB-based query history, how many entries should be kept?
*
* @global integer $cfg['QueryHistoryMax']
*/
$cfg['QueryHistoryMax'] = 25;
/**
* Use MIME-Types (stored in column comments table) for
*
* @global boolean $cfg['BrowseMIME']
*/
$cfg['BrowseMIME'] = true;
/**
* When approximate count < this, PMA will get exact count for table rows.
*
* @global integer $cfg['MaxExactCount']
*/
$cfg['MaxExactCount'] = 50000;
/**
* Zero means that no row count is done for views; see the doc
*
* @global integer $cfg['MaxExactCountViews']
*/
$cfg['MaxExactCountViews'] = 0;
/**
* Sort table and database in natural order
*
* @global boolean $cfg['NaturalOrder']
*/
$cfg['NaturalOrder'] = true;
/**
* Initial state for sliders
* (open | closed | disabled)
*
* @global string $cfg['InitialSlidersState']
*/
$cfg['InitialSlidersState'] = 'closed';
/**
* User preferences: disallow these settings
* For possible setting names look in libraries/config/user_preferences.forms.php
*
* @global array $cfg['UserprefsDisallow']
*/
$cfg['UserprefsDisallow'] = array();
/**
* User preferences: enable the Developer tab
*/
$cfg['UserprefsDeveloperTab'] = false;
/*******************************************************************************
* Window title settings
*/
/**
* title of browser window when a table is selected
*
* @global string $cfg['TitleTable']
*/
$cfg['TitleTable'] = '@HTTP_HOST@ / @VSERVER@ / @DATABASE@ / @TABLE@ | @PHPMYADMIN@';
/**
* title of browser window when a database is selected
*
* @global string $cfg['TitleDatabase']
*/
$cfg['TitleDatabase'] = '@HTTP_HOST@ / @VSERVER@ / @DATABASE@ | @PHPMYADMIN@';
/**
* title of browser window when a server is selected
*
* @global string $cfg['TitleServer']
*/
$cfg['TitleServer'] = '@HTTP_HOST@ / @VSERVER@ | @PHPMYADMIN@';
/**
* title of browser window when nothing is selected
* @global string $cfg['TitleDefault']
*/
$cfg['TitleDefault'] = '@HTTP_HOST@ | @PHPMYADMIN@';
/*******************************************************************************
* theme manager
*/
/**
* if you want to use selectable themes and if ThemesPath not empty
* set it to true, else set it to false (default is false);
*
* @global boolean $cfg['ThemeManager']
*/
$cfg['ThemeManager'] = true;
/**
* set up default theme, you can set up here an valid
* path to themes or 'original' for the original pma-theme
*
* @global string $cfg['ThemeDefault']
*/
$cfg['ThemeDefault'] = 'pmahomme';
/**
* allow different theme for each configured server
*
* @global boolean $cfg['ThemePerServer']
*/
$cfg['ThemePerServer'] = false;
/**
* Font size to use by default
*/
$cfg['FontSize'] = '82%';
/*******************************************************************************
*
*/
/**
* Default query for table
*
* @global string $cfg['DefaultQueryTable']
*/
$cfg['DefaultQueryTable'] = 'SELECT * FROM @TABLE@ WHERE 1';
/**
* Default query for database
*
* @global string $cfg['DefaultQueryDatabase']
*/
$cfg['DefaultQueryDatabase'] = '';
/*******************************************************************************
* SQL Query box settings
* These are the links display in all of the SQL Query boxes
*
* @global array $cfg['SQLQuery']
*/
$cfg['SQLQuery'] = array();
/**
* Display an "Edit" link on the results page to change a query
*
* @global boolean $cfg['SQLQuery']['Edit']
*/
$cfg['SQLQuery']['Edit'] = true;
/**
* Display an "Explain SQL" link on the results page
*
* @global boolean $cfg['SQLQuery']['Explain']
*/
$cfg['SQLQuery']['Explain'] = true;
/**
* Display a "Create PHP code" link on the results page to wrap a query in PHP
*
* @global boolean $cfg['SQLQuery']['ShowAsPHP']
*/
$cfg['SQLQuery']['ShowAsPHP'] = true;
/**
* Display a "Refresh" link on the results page
*
* @global boolean $cfg['SQLQuery']['Refresh']
*/
$cfg['SQLQuery']['Refresh'] = true;
/**
* Enables autoComplete for table & column names in SQL queries
*
* default = 'true'
*/
$cfg['EnableAutocompleteForTablesAndColumns'] = true;
/*******************************************************************************
* Web server upload/save/import directories
*/
/**
* Directory for uploaded files that can be executed by phpMyAdmin.
* For example './upload'. Leave empty for no upload directory support.
* Use %u for username inclusion.
*
* @global string $cfg['UploadDir']
*/
$cfg['UploadDir'] = '';
/**
* Directory where phpMyAdmin can save exported data on server.
* For example './save'. Leave empty for no save directory support.
* Use %u for username inclusion.
*
* @global string $cfg['SaveDir']
*/
$cfg['SaveDir'] = '';
/**
* Directory where phpMyAdmin can save temporary files.
*
* @global string $cfg['TempDir']
*/
if (defined('TEMP_DIR')) {
$cfg['TempDir'] = TEMP_DIR;
} else {
$cfg['TempDir'] = './tmp/';
}
/**
* Misc. settings
*/
/**
* Is GD >= 2 available? Set to yes/no/auto. 'auto' does auto-detection,
* which is the only safe way to determine GD version.
*
* @global string $cfg['GD2Available']
*/
$cfg['GD2Available'] = 'auto';
/**
* Lists proxy IP and HTTP header combinations which are trusted for IP allow/deny
*
* @global array $cfg['TrustedProxies']
*/
$cfg['TrustedProxies'] = array();
/**
* We normally check the permissions on the configuration file to ensure
* it's not world writable. However, phpMyAdmin could be installed on
* a NTFS filesystem mounted on a non-Windows server, in which case the
* permissions seems wrong but in fact cannot be detected. In this case
* a sysadmin would set the following to false.
*/
$cfg['CheckConfigurationPermissions'] = true;
/**
* Limit for length of URL in links. When length would be above this limit, it
* is replaced by form with button.
* This is required as some web servers (IIS) have problems with long URLs.
* The recommended limit is 2000
* (see https://www.boutell.com/newfaq/misc/urllength.html) but we put
* 1000 to accommodate Suhosin, see bug #3358750.
*/
$cfg['LinkLengthLimit'] = 1000;
/**
* Additional string to allow in CSP headers.
*/
$cfg['CSPAllow'] = '';
/**
* Disable the table maintenance mass operations, like optimizing or
* repairing the selected tables of a database. An accidental execution
* of such a maintenance task can enormously slow down a bigger database.
*/
$cfg['DisableMultiTableMaintenance'] = false;
/**
* Whether or not to query the user before sending the error report to
* the phpMyAdmin team when a JavaScript error occurs
*
* Available options
* (ask | always | never)
*
* @global string $cfg['SendErrorReports']
*/
$cfg['SendErrorReports'] = 'ask';
/**
* Whether Enter or Ctrl+Enter executes queries in the console.
*
* @global boolean $cfg['ConsoleEnterExecutes']
*/
$cfg['ConsoleEnterExecutes'] = false;
/**
* Zero Configuration mode.
*
* @global boolean $cfg['ZeroConf']
*/
$cfg['ZeroConf'] = true;
/*******************************************************************************
* Developers ONLY!
*
* @global array $cfg['DBG']
*/
$cfg['DBG'] = array();
/**
* Output executed queries and their execution times
*
* @global boolean $cfg['DBG']['sql']
*/
$cfg['DBG']['sql'] = false;
/**
* Log executed queries and their execution times to syslog
*
* @global boolean $cfg['DBG']['sqllog']
*/
$cfg['DBG']['sqllog'] = false;
/**
* Enable to let server present itself as demo server.
*
* @global boolean $cfg['DBG']['demo']
*/
$cfg['DBG']['demo'] = false;
/**
* Enable Simple two-factor authentication
*
* @global boolean $cfg['DBG']['simple2fa']
*/
$cfg['DBG']['simple2fa'] = false;
/*******************************************************************************
* MySQL settings
*/
/**
* Default functions for above defined groups
*
* @global array $cfg['DefaultFunctions']
*/
$cfg['DefaultFunctions'] = array(
'FUNC_CHAR' => '',
'FUNC_DATE' => '',
'FUNC_NUMBER' => '',
'FUNC_SPATIAL' => 'GeomFromText',
'FUNC_UUID' => 'UUID',
'first_timestamp' => 'NOW',
);
/**
* Max rows retrieved for zoom search
*/
$cfg['maxRowPlotLimit'] = 500;
/**
* Show Git revision if applicable
*
* @global boolean $cfg['ShowGitRevision']
*/
$cfg['ShowGitRevision'] = true;
/**
* MySQL minimal version required
*
* @global array $cfg['MysqlMinVersion']
*/
$cfg['MysqlMinVersion'] = array(
'internal' => 50500,
'human' => '5.5.0'
);
/**
* Disable shortcuts
*
* @global array $cfg['DisableShortcutKeys']
*/
$cfg['DisableShortcutKeys'] = false;
/**
* Console configuration
*
* This is mostly meant for user preferences.
*/
$cfg['Console'] = [
'StartHistory' => false,
'AlwaysExpand' => false,
'CurrentQuery' => true,
'EnterExecutes' => false,
'DarkTheme' => false,
'Mode' => 'info',
'Height' => 92,
'GroupQueries' => false,
'OrderBy' => 'exec',
'Order' => 'asc',
];
/*******************************************************************************
* Default options for transformations
*/
/**
* Initialize default transformations array
*
* @global array $cfg['DefaultTransformations']
*/
$cfg['DefaultTransformations'] = array();
/**
* Default transformations for Substring
*
* @global array $cfg['DefaultTransformations']['Substring']
*/
$cfg['DefaultTransformations']['Substring'] = array(0, 'all', '…');
/**
* Default transformations for Bool2Text
*
* @global array $cfg['DefaultTransformations']['Bool2Text']
*/
$cfg['DefaultTransformations']['Bool2Text'] = array('T', 'F');
/**
* Default transformations for External
*
* @global array $cfg['DefaultTransformations']['External']
*/
$cfg['DefaultTransformations']['External'] = array(0, '-f /dev/null -i -wrap -q', 1, 1);
/**
* Default transformations for PreApPend
*
* @global array $cfg['DefaultTransformations']['PreApPend']
*/
$cfg['DefaultTransformations']['PreApPend'] = array('', '');
/**
* Default transformations for Hex
*
* @global array $cfg['DefaultTransformations']['Hex']
*/
$cfg['DefaultTransformations']['Hex'] = array('2');
/**
* Default transformations for DateFormat
*
* @global array $cfg['DefaultTransformations']['DateFormat']
*/
$cfg['DefaultTransformations']['DateFormat'] = array(0, '', 'local');
/**
* Default transformations for Inline
*
* @global array $cfg['DefaultTransformations']['Inline']
*/
$cfg['DefaultTransformations']['Inline'] = array('100', 100);
$cfg['DefaultTransformations']['Inline']['wrapper_link'] = null;
/**
* Default transformations for TextImageLink
*
* @global array $cfg['DefaultTransformations']['TextImageLink']
*/
$cfg['DefaultTransformations']['TextImageLink'] = array(null, 100, 50);
/**
* Default transformations for TextLink
*
* @global array $cfg['DefaultTransformations']['TextLink']
*/
$cfg['DefaultTransformations']['TextLink'] = array(null, null, null);
login/libraries/tbl_common.inc.php 0000644 00000002346 15155311537 0013255 0 ustar 00 isSystemSchema($db);
/**
* Set parameters for links
* @deprecated
*/
$url_query = Url::getCommon(array('db' => $db, 'table' => $table));
/**
* Set parameters for links
*/
$url_params = array();
$url_params['db'] = $db;
$url_params['table'] = $table;
/**
* Defines the urls to return to in case of error in a sql statement
*/
$err_url_0 = PhpMyAdmin\Util::getScriptNameForOption(
$GLOBALS['cfg']['DefaultTabDatabase'], 'database'
)
. Url::getCommon(array('db' => $db));
$err_url = PhpMyAdmin\Util::getScriptNameForOption(
$GLOBALS['cfg']['DefaultTabTable'], 'table'
)
. Url::getCommon($url_params);
/**
* Ensures the database and the table exist (else move to the "parent" script)
* Skip test if we are exporting as we can't tell whether a table name is an alias (which would fail the test).
*/
if (basename($_SERVER['PHP_SELF']) != 'tbl_export.php') {
require_once './libraries/db_table_exists.inc.php';
}
login/libraries/classes/SubPartition.php 0000644 00000007040 15155311537 0014430 0 ustar 00 db = $row['TABLE_SCHEMA'];
$this->table = $row['TABLE_NAME'];
$this->loadData($row);
}
/**
* Loads data from the fetched row from information_schema.PARTITIONS
*
* @param array $row fetched row
*
* @return void
*/
protected function loadData(array $row)
{
$this->name = $row['SUBPARTITION_NAME'];
$this->ordinal = $row['SUBPARTITION_ORDINAL_POSITION'];
$this->method = $row['SUBPARTITION_METHOD'];
$this->expression = $row['SUBPARTITION_EXPRESSION'];
$this->loadCommonData($row);
}
/**
* Loads some data that is common to both partitions and sub partitions
*
* @param array $row fetched row
*
* @return void
*/
protected function loadCommonData(array $row)
{
$this->rows = $row['TABLE_ROWS'];
$this->dataLength = $row['DATA_LENGTH'];
$this->indexLength = $row['INDEX_LENGTH'];
$this->comment = $row['PARTITION_COMMENT'];
}
/**
* Return the partition name
*
* @return string partition name
*/
public function getName()
{
return $this->name;
}
/**
* Return the ordinal of the partition
*
* @return number the ordinal
*/
public function getOrdinal()
{
return $this->ordinal;
}
/**
* Returns the partition method
*
* @return string partition method
*/
public function getMethod()
{
return $this->method;
}
/**
* Returns the partition expression
*
* @return string partition expression
*/
public function getExpression()
{
return $this->expression;
}
/**
* Returns the number of data rows
*
* @return integer number of rows
*/
public function getRows()
{
return $this->rows;
}
/**
* Returns the data length
*
* @return integer data length
*/
public function getDataLength()
{
return $this->dataLength;
}
/**
* Returns the index length
*
* @return integer index length
*/
public function getIndexLength()
{
return $this->indexLength;
}
/**
* Returns the partition comment
*
* @return string partition comment
*/
public function getComment()
{
return $this->comment;
}
}
login/libraries/classes/TwoFactor.php 0000644 00000016152 15155311537 0013721 0 ustar 00 initRelationParamsCache();
$this->userPreferences = new UserPreferences();
$this->user = $user;
$this->_available = $this->getAvailable();
$this->config = $this->readConfig();
$this->_writable = ($this->config['type'] == 'db');
$this->_backend = $this->getBackend();
}
/**
* Reads the configuration
*
* @return array
*/
public function readConfig()
{
$result = [];
$config = $this->userPreferences->load();
if (isset($config['config_data']['2fa'])) {
$result = $config['config_data']['2fa'];
}
$result['type'] = $config['type'];
if (! isset($result['backend'])) {
$result['backend'] = '';
}
if (! isset($result['settings'])) {
$result['settings'] = [];
}
return $result;
}
/**
* Get any property of this class
*
* @param string $property name of the property
*
* @return mixed|void if property exist, value of the relevant property
*/
public function __get($property)
{
switch ($property) {
case 'backend':
return $this->_backend;
case 'available':
return $this->_available;
case 'writable':
return $this->_writable;
case 'showSubmit':
$backend = $this->_backend;
return $backend::$showSubmit;
}
}
/**
* Returns list of available backends
*
* @return array
*/
public function getAvailable()
{
$result = [];
if ($GLOBALS['cfg']['DBG']['simple2fa']) {
$result[] = 'simple';
}
if (class_exists('PragmaRX\Google2FA\Google2FA') && class_exists('BaconQrCode\Renderer\Image\Png')) {
$result[] = 'application';
}
if (class_exists('Samyoul\U2F\U2FServer\U2FServer')) {
$result[] = 'key';
}
return $result;
}
/**
* Returns list of missing dependencies
*
* @return array
*/
public function getMissingDeps()
{
$result = [];
if (!class_exists('PragmaRX\Google2FA\Google2FA')) {
$result[] = [
'class' => \PhpMyAdmin\Plugins\TwoFactor\Application::getName(),
'dep' => 'pragmarx/google2fa',
];
}
if (!class_exists('BaconQrCode\Renderer\Image\Png')) {
$result[] = [
'class' => \PhpMyAdmin\Plugins\TwoFactor\Application::getName(),
'dep' => 'bacon/bacon-qr-code',
];
}
if (!class_exists('Samyoul\U2F\U2FServer\U2FServer')) {
$result[] = [
'class' => \PhpMyAdmin\Plugins\TwoFactor\Key::getName(),
'dep' => 'samyoul/u2f-php-server',
];
}
return $result;
}
/**
* Returns class name for given name
*
* @param string $name Backend name
*
* @return string
*/
public function getBackendClass($name)
{
$result = 'PhpMyAdmin\\Plugins\\TwoFactorPlugin';
if (in_array($name, $this->_available)) {
$result = 'PhpMyAdmin\\Plugins\\TwoFactor\\' . ucfirst($name);
} elseif (! empty($name)) {
$result = 'PhpMyAdmin\\Plugins\\TwoFactor\\Invalid';
}
return $result;
}
/**
* Returns backend for current user
*
* @return PhpMyAdmin\Plugins\TwoFactorPlugin
*/
public function getBackend()
{
$name = $this->getBackendClass($this->config['backend']);
return new $name($this);
}
/**
* Checks authentication, returns true on success
*
* @param boolean $skip_session Skip session cache
*
* @return boolean
*/
public function check($skip_session = false)
{
if ($skip_session) {
return $this->_backend->check();
}
if (empty($_SESSION['two_factor_check'])) {
$_SESSION['two_factor_check'] = $this->_backend->check();
}
return $_SESSION['two_factor_check'];
}
/**
* Renders user interface to enter two-factor authentication
*
* @return string HTML code
*/
public function render()
{
return $this->_backend->getError() . $this->_backend->render();
}
/**
* Renders user interface to configure two-factor authentication
*
* @return string HTML code
*/
public function setup()
{
return $this->_backend->getError() . $this->_backend->setup();
}
/**
* Saves current configuration.
*
* @return true|PhpMyAdmin\Message
*/
public function save()
{
return $this->userPreferences->persistOption('2fa', $this->config, null);
}
/**
* Changes two-factor authentication settings
*
* The object might stay in partialy changed setup
* if configuration fails.
*
* @param string $name Backend name
*
* @return boolean
*/
public function configure($name)
{
$this->config = [
'backend' => $name
];
if ($name === '') {
$cls = $this->getBackendClass($name);
$this->config['settings'] = [];
$this->_backend = new $cls($this);
} else {
if (! in_array($name, $this->_available)) {
return false;
}
$cls = $this->getBackendClass($name);
$this->config['settings'] = [];
$this->_backend = new $cls($this);
if (! $this->_backend->configure()) {
return false;
}
}
$result = $this->save();
if ($result !== true) {
$result->display();
}
return true;
}
/**
* Returns array with all available backends
*
* @return array
*/
public function getAllBackends()
{
$all = array_merge([''], $this->available);
$backends = [];
foreach ($all as $name) {
$cls = $this->getBackendClass($name);
$backends[] = [
'id' => $cls::$id,
'name' => $cls::getName(),
'description' => $cls::getDescription(),
];
}
return $backends;
}
}
login/libraries/classes/Util.php 0000644 00000505764 15155311537 0012742 0 ustar 00 ';
if ($include_icon) {
$button .= self::getImage($icon, $alternate);
}
if ($include_icon && $include_text) {
$button .= ' ';
}
if ($include_text) {
$button .= $alternate;
}
$button .= $menu_icon ? '' : '';
return $button;
}
/**
* Returns an HTML IMG tag for a particular image from a theme
*
* The image name should match CSS class defined in icons.css.php
*
* @param string $image The name of the file to get
* @param string $alternate Used to set 'alt' and 'title' attributes
* of the image
* @param array $attributes An associative array of other attributes
*
* @return string an html IMG tag
*/
public static function getImage($image, $alternate = '', array $attributes = array())
{
$alternate = htmlspecialchars($alternate);
// Set $url accordingly
if (isset($GLOBALS['pmaThemeImage'])) {
$url = $GLOBALS['pmaThemeImage'] . $image;
} else {
$url = './themes/pmahomme/' . $image;
}
if (isset($attributes['class'])) {
$attributes['class'] = "icon ic_$image " . $attributes['class'];
} else {
$attributes['class'] = "icon ic_$image";
}
// set all other attributes
$attr_str = '';
foreach ($attributes as $key => $value) {
if (! in_array($key, array('alt', 'title'))) {
$attr_str .= " $key=\"$value\"";
}
}
// override the alt attribute
if (isset($attributes['alt'])) {
$alt = $attributes['alt'];
} else {
$alt = $alternate;
}
// override the title attribute
if (isset($attributes['title'])) {
$title = $attributes['title'];
} else {
$title = $alternate;
}
// generate the IMG tag
$template = '';
$retval = sprintf($template, $title, $alt, $attr_str);
return $retval;
}
/**
* Returns the formatted maximum size for an upload
*
* @param integer $max_upload_size the size
*
* @return string the message
*
* @access public
*/
public static function getFormattedMaximumUploadSize($max_upload_size)
{
// I have to reduce the second parameter (sensitiveness) from 6 to 4
// to avoid weird results like 512 kKib
list($max_size, $max_unit) = self::formatByteDown($max_upload_size, 4);
return '(' . sprintf(__('Max: %s%s'), $max_size, $max_unit) . ')';
}
/**
* Generates a hidden field which should indicate to the browser
* the maximum size for upload
*
* @param integer $max_size the size
*
* @return string the INPUT field
*
* @access public
*/
public static function generateHiddenMaxFileSize($max_size)
{
return '';
}
/**
* Add slashes before "_" and "%" characters for using them in MySQL
* database, table and field names.
* Note: This function does not escape backslashes!
*
* @param string $name the string to escape
*
* @return string the escaped string
*
* @access public
*/
public static function escapeMysqlWildcards($name)
{
return strtr($name, array('_' => '\\_', '%' => '\\%'));
} // end of the 'escapeMysqlWildcards()' function
/**
* removes slashes before "_" and "%" characters
* Note: This function does not unescape backslashes!
*
* @param string $name the string to escape
*
* @return string the escaped string
*
* @access public
*/
public static function unescapeMysqlWildcards($name)
{
return strtr($name, array('\\_' => '_', '\\%' => '%'));
} // end of the 'unescapeMysqlWildcards()' function
/**
* removes quotes (',",`) from a quoted string
*
* checks if the string is quoted and removes this quotes
*
* @param string $quoted_string string to remove quotes from
* @param string $quote type of quote to remove
*
* @return string unqoted string
*/
public static function unQuote($quoted_string, $quote = null)
{
$quotes = array();
if ($quote === null) {
$quotes[] = '`';
$quotes[] = '"';
$quotes[] = "'";
} else {
$quotes[] = $quote;
}
foreach ($quotes as $quote) {
if (mb_substr($quoted_string, 0, 1) === $quote
&& mb_substr($quoted_string, -1, 1) === $quote
) {
$unquoted_string = mb_substr($quoted_string, 1, -1);
// replace escaped quotes
$unquoted_string = str_replace(
$quote . $quote,
$quote,
$unquoted_string
);
return $unquoted_string;
}
}
return $quoted_string;
}
/**
* format sql strings
*
* @param string $sqlQuery raw SQL string
* @param boolean $truncate truncate the query if it is too long
*
* @return string the formatted sql
*
* @global array $cfg the configuration array
*
* @access public
* @todo move into PMA_Sql
*/
public static function formatSql($sqlQuery, $truncate = false)
{
global $cfg;
if ($truncate
&& mb_strlen($sqlQuery) > $cfg['MaxCharactersInDisplayedSQL']
) {
$sqlQuery = mb_substr(
$sqlQuery,
0,
$cfg['MaxCharactersInDisplayedSQL']
) . '[...]';
}
return '
' . "\n"
. htmlspecialchars($sqlQuery) . "\n"
. '
';
} // end of the "formatSql()" function
/**
* Displays a link to the documentation as an icon
*
* @param string $link documentation link
* @param string $target optional link target
* @param boolean $bbcode optional flag indicating whether to output bbcode
*
* @return string the html link
*
* @access public
*/
public static function showDocLink($link, $target = 'documentation', $bbcode = false)
{
if($bbcode){
return "[a@$link@$target][dochelpicon][/a]";
}
return ''
. self::getImage('b_help', __('Documentation'))
. '';
} // end of the 'showDocLink()' function
/**
* Get a URL link to the official MySQL documentation
*
* @param string $link contains name of page/anchor that is being linked
* @param string $anchor anchor to page part
*
* @return string the URL link
*
* @access public
*/
public static function getMySQLDocuURL($link, $anchor = '')
{
// Fixup for newly used names:
$link = str_replace('_', '-', mb_strtolower($link));
if (empty($link)) {
$link = 'index';
}
$mysql = '5.5';
$lang = 'en';
if (isset($GLOBALS['dbi'])) {
$serverVersion = $GLOBALS['dbi']->getVersion();
if ($serverVersion >= 50700) {
$mysql = '5.7';
} elseif ($serverVersion >= 50600) {
$mysql = '5.6';
} elseif ($serverVersion >= 50500) {
$mysql = '5.5';
}
}
$url = 'https://dev.mysql.com/doc/refman/'
. $mysql . '/' . $lang . '/' . $link . '.html';
if (! empty($anchor)) {
$url .= '#' . $anchor;
}
return Core::linkURL($url);
}
/**
* Displays a link to the official MySQL documentation
*
* @param string $link contains name of page/anchor that is being linked
* @param bool $big_icon whether to use big icon (like in left frame)
* @param string $anchor anchor to page part
* @param bool $just_open whether only the opening tag should be returned
*
* @return string the html link
*
* @access public
*/
public static function showMySQLDocu(
$link,
$big_icon = false,
$anchor = '',
$just_open = false
) {
$url = self::getMySQLDocuURL($link, $anchor);
$open_link = '';
if ($just_open) {
return $open_link;
} elseif ($big_icon) {
return $open_link
. self::getImage('b_sqlhelp', __('Documentation')) . '';
}
return self::showDocLink($url, 'mysql_doc');
} // end of the 'showMySQLDocu()' function
/**
* Returns link to documentation.
*
* @param string $page Page in documentation
* @param string $anchor Optional anchor in page
*
* @return string URL
*/
public static function getDocuLink($page, $anchor = '')
{
/* Construct base URL */
$url = $page . '.html';
if (!empty($anchor)) {
$url .= '#' . $anchor;
}
/* Check if we have built local documentation, however
* provide consistent URL for testsuite
*/
if (! defined('TESTSUITE') && @file_exists('doc/html/index.html')) {
if ($GLOBALS['PMA_Config']->get('is_setup')) {
return '../doc/html/' . $url;
}
return './doc/html/' . $url;
}
return Core::linkURL('https://docs.phpmyadmin.net/en/latest/' . $url);
}
/**
* Displays a link to the phpMyAdmin documentation
*
* @param string $page Page in documentation
* @param string $anchor Optional anchor in page
* @param boolean $bbcode Optional flag indicating whether to output bbcode
*
* @return string the html link
*
* @access public
*/
public static function showDocu($page, $anchor = '', $bbcode = false)
{
return self::showDocLink(self::getDocuLink($page, $anchor), 'documentation', $bbcode);
} // end of the 'showDocu()' function
/**
* Displays a link to the PHP documentation
*
* @param string $target anchor in documentation
*
* @return string the html link
*
* @access public
*/
public static function showPHPDocu($target)
{
$url = Core::getPHPDocLink($target);
return self::showDocLink($url);
} // end of the 'showPHPDocu()' function
/**
* Returns HTML code for a tooltip
*
* @param string $message the message for the tooltip
*
* @return string
*
* @access public
*/
public static function showHint($message)
{
if ($GLOBALS['cfg']['ShowHint']) {
$classClause = ' class="pma_hint"';
} else {
$classClause = '';
}
return ''
. self::getImage('b_help')
. '' . $message . ''
. '';
}
/**
* Displays a MySQL error message in the main panel when $exit is true.
* Returns the error message otherwise.
*
* @param string|bool $server_msg Server's error message.
* @param string $sql_query The SQL query that failed.
* @param bool $is_modify_link Whether to show a "modify" link or not.
* @param string $back_url URL for the "back" link (full path is
* not required).
* @param bool $exit Whether execution should be stopped or
* the error message should be returned.
*
* @return string
*
* @global string $table The current table.
* @global string $db The current database.
*
* @access public
*/
public static function mysqlDie(
$server_msg = '',
$sql_query = '',
$is_modify_link = true,
$back_url = '',
$exit = true
) {
global $table, $db;
/**
* Error message to be built.
* @var string $error_msg
*/
$error_msg = '';
// Checking for any server errors.
if (empty($server_msg)) {
$server_msg = $GLOBALS['dbi']->getError();
}
// Finding the query that failed, if not specified.
if ((empty($sql_query) && (!empty($GLOBALS['sql_query'])))) {
$sql_query = $GLOBALS['sql_query'];
}
$sql_query = trim($sql_query);
/**
* The lexer used for analysis.
* @var Lexer $lexer
*/
$lexer = new Lexer($sql_query);
/**
* The parser used for analysis.
* @var Parser $parser
*/
$parser = new Parser($lexer->list);
/**
* The errors found by the lexer and the parser.
* @var array $errors
*/
$errors = ParserError::get(array($lexer, $parser));
if (empty($sql_query)) {
$formatted_sql = '';
} elseif (count($errors)) {
$formatted_sql = htmlspecialchars($sql_query);
} else {
$formatted_sql = self::formatSql($sql_query, true);
}
$error_msg .= '
' . __('Error') . '
';
// For security reasons, if the MySQL refuses the connection, the query
// is hidden so no details are revealed.
if ((!empty($sql_query)) && (!(mb_strstr($sql_query, 'connect')))) {
// Static analysis errors.
if (!empty($errors)) {
$error_msg .= '
' . __('Static analysis:')
. '
';
$error_msg .= '
' . sprintf(
__('%d errors were found during analysis.'),
count($errors)
) . '
' . "\n";
// The error message will be displayed within a CODE segment.
// To preserve original formatting, but allow word-wrapping,
// a couple of replacements are done.
// All non-single blanks and TAB-characters are replaced with their
// HTML-counterpart
$server_msg = str_replace(
array(' ', "\t"),
array(' ', ' '),
$server_msg
);
// Replace line breaks
$server_msg = nl2br($server_msg);
$error_msg .= '' . $server_msg . ' ';
}
$error_msg .= '
';
$_SESSION['Import_message']['message'] = $error_msg;
if (!$exit) {
return $error_msg;
}
/**
* If this is an AJAX request, there is no "Back" link and
* `Response()` is used to send the response.
*/
$response = Response::getInstance();
if ($response->isAjax()) {
$response->setRequestStatus(false);
$response->addJSON('message', $error_msg);
exit;
}
if (!empty($back_url)) {
if (mb_strstr($back_url, '?')) {
$back_url .= '&no_history=true';
} else {
$back_url .= '?no_history=true';
}
$_SESSION['Import_message']['go_back_url'] = $back_url;
$error_msg .= '' . "\n\n";
}
exit($error_msg);
}
/**
* Check the correct row count
*
* @param string $db the db name
* @param array $table the table infos
*
* @return int $rowCount the possibly modified row count
*
*/
private static function _checkRowCount($db, array $table)
{
$rowCount = 0;
if ($table['Rows'] === null) {
// Do not check exact row count here,
// if row count is invalid possibly the table is defect
// and this would break the navigation panel;
// but we can check row count if this is a view or the
// information_schema database
// since Table::countRecords() returns a limited row count
// in this case.
// set this because Table::countRecords() can use it
$tbl_is_view = $table['TABLE_TYPE'] == 'VIEW';
if ($tbl_is_view || $GLOBALS['dbi']->isSystemSchema($db)) {
$rowCount = $GLOBALS['dbi']
->getTable($db, $table['Name'])
->countRecords();
}
}
return $rowCount;
}
/**
* returns array with tables of given db with extended information and grouped
*
* @param string $db name of db
* @param string $tables name of tables
* @param integer $limit_offset list offset
* @param int|bool $limit_count max tables to return
*
* @return array (recursive) grouped table list
*/
public static function getTableList(
$db,
$tables = null,
$limit_offset = 0,
$limit_count = false
) {
$sep = $GLOBALS['cfg']['NavigationTreeTableSeparator'];
if ($tables === null) {
$tables = $GLOBALS['dbi']->getTablesFull(
$db,
'',
false,
$limit_offset,
$limit_count
);
if ($GLOBALS['cfg']['NaturalOrder']) {
uksort($tables, 'strnatcasecmp');
}
}
if (count($tables) < 1) {
return $tables;
}
$default = array(
'Name' => '',
'Rows' => 0,
'Comment' => '',
'disp_name' => '',
);
$table_groups = array();
foreach ($tables as $table_name => $table) {
$table['Rows'] = self::_checkRowCount($db, $table);
// in $group we save the reference to the place in $table_groups
// where to store the table info
if ($GLOBALS['cfg']['NavigationTreeEnableGrouping']
&& $sep && mb_strstr($table_name, $sep)
) {
$parts = explode($sep, $table_name);
$group =& $table_groups;
$i = 0;
$group_name_full = '';
$parts_cnt = count($parts) - 1;
while (($i < $parts_cnt)
&& ($i < $GLOBALS['cfg']['NavigationTreeTableLevel'])
) {
$group_name = $parts[$i] . $sep;
$group_name_full .= $group_name;
if (! isset($group[$group_name])) {
$group[$group_name] = array();
$group[$group_name]['is' . $sep . 'group'] = true;
$group[$group_name]['tab' . $sep . 'count'] = 1;
$group[$group_name]['tab' . $sep . 'group']
= $group_name_full;
} elseif (! isset($group[$group_name]['is' . $sep . 'group'])) {
$table = $group[$group_name];
$group[$group_name] = array();
$group[$group_name][$group_name] = $table;
$group[$group_name]['is' . $sep . 'group'] = true;
$group[$group_name]['tab' . $sep . 'count'] = 1;
$group[$group_name]['tab' . $sep . 'group']
= $group_name_full;
} else {
$group[$group_name]['tab' . $sep . 'count']++;
}
$group =& $group[$group_name];
$i++;
}
} else {
if (! isset($table_groups[$table_name])) {
$table_groups[$table_name] = array();
}
$group =& $table_groups;
}
$table['disp_name'] = $table['Name'];
$group[$table_name] = array_merge($default, $table);
}
return $table_groups;
}
/* ----------------------- Set of misc functions ----------------------- */
/**
* Adds backquotes on both sides of a database, table or field name.
* and escapes backquotes inside the name with another backquote
*
* example:
*
* echo backquote('owner`s db'); // `owner``s db`
*
*
*
* @param mixed $a_name the database, table or field name to "backquote"
* or array of it
* @param boolean $do_it a flag to bypass this function (used by dump
* functions)
*
* @return mixed the "backquoted" database, table or field name
*
* @access public
*/
public static function backquote($a_name, $do_it = true)
{
if (is_array($a_name)) {
foreach ($a_name as &$data) {
$data = self::backquote($data, $do_it);
}
return $a_name;
}
if (! $do_it) {
if (!(Context::isKeyword($a_name) & Token::FLAG_KEYWORD_RESERVED)
) {
return $a_name;
}
}
// '0' is also empty for php :-(
if (strlen($a_name) > 0 && $a_name !== '*') {
return '`' . str_replace('`', '``', $a_name) . '`';
}
return $a_name;
} // end of the 'backquote()' function
/**
* Adds backquotes on both sides of a database, table or field name.
* in compatibility mode
*
* example:
*
* echo backquoteCompat('owner`s db'); // `owner``s db`
*
*
*
* @param mixed $a_name the database, table or field name to
* "backquote" or array of it
* @param string $compatibility string compatibility mode (used by dump
* functions)
* @param boolean $do_it a flag to bypass this function (used by dump
* functions)
*
* @return mixed the "backquoted" database, table or field name
*
* @access public
*/
public static function backquoteCompat(
$a_name,
$compatibility = 'MSSQL',
$do_it = true
) {
if (is_array($a_name)) {
foreach ($a_name as &$data) {
$data = self::backquoteCompat($data, $compatibility, $do_it);
}
return $a_name;
}
if (! $do_it) {
if (!Context::isKeyword($a_name)) {
return $a_name;
}
}
// @todo add more compatibility cases (ORACLE for example)
switch ($compatibility) {
case 'MSSQL':
$quote = '"';
break;
default:
$quote = "`";
break;
}
// '0' is also empty for php :-(
if (strlen($a_name) > 0 && $a_name !== '*') {
return $quote . $a_name . $quote;
}
return $a_name;
} // end of the 'backquoteCompat()' function
/**
* Prepare the message and the query
* usually the message is the result of the query executed
*
* @param Message|string $message the message to display
* @param string $sql_query the query to display
* @param string $type the type (level) of the message
*
* @return string
*
* @access public
*/
public static function getMessage(
$message,
$sql_query = null,
$type = 'notice'
) {
global $cfg;
$retval = '';
if (null === $sql_query) {
if (! empty($GLOBALS['display_query'])) {
$sql_query = $GLOBALS['display_query'];
} elseif (! empty($GLOBALS['unparsed_sql'])) {
$sql_query = $GLOBALS['unparsed_sql'];
} elseif (! empty($GLOBALS['sql_query'])) {
$sql_query = $GLOBALS['sql_query'];
} else {
$sql_query = '';
}
}
$render_sql = $cfg['ShowSQL'] == true && ! empty($sql_query) && $sql_query !== ';';
if (isset($GLOBALS['using_bookmark_message'])) {
$retval .= $GLOBALS['using_bookmark_message']->getDisplay();
unset($GLOBALS['using_bookmark_message']);
}
if ($render_sql) {
$retval .= '
';
}
if ($render_sql) {
$query_too_big = false;
$queryLength = mb_strlen($sql_query);
if ($queryLength > $cfg['MaxCharactersInDisplayedSQL']) {
// when the query is large (for example an INSERT of binary
// data), the parser chokes; so avoid parsing the query
$query_too_big = true;
$query_base = mb_substr(
$sql_query,
0,
$cfg['MaxCharactersInDisplayedSQL']
) . '[...]';
} else {
$query_base = $sql_query;
}
// Html format the query to be displayed
// If we want to show some sql code it is easiest to create it here
/* SQL-Parser-Analyzer */
if (! empty($GLOBALS['show_as_php'])) {
$new_line = '\\n" ' . "\n" . ' . "';
$query_base = htmlspecialchars(addslashes($query_base));
$query_base = preg_replace(
'/((\015\012)|(\015)|(\012))/',
$new_line,
$query_base
);
$query_base = '
';
}
return $retval;
} // end of the 'getMessage()' function
/**
* Execute an EXPLAIN query and formats results similar to MySQL command line
* utility.
*
* @param string $sqlQuery EXPLAIN query
*
* @return string query resuls
*/
private static function _generateRowQueryOutput($sqlQuery)
{
$ret = '';
$result = $GLOBALS['dbi']->query($sqlQuery);
if ($result) {
$devider = '+';
$columnNames = '|';
$fieldsMeta = $GLOBALS['dbi']->getFieldsMeta($result);
foreach ($fieldsMeta as $meta) {
$devider .= '---+';
$columnNames .= ' ' . $meta->name . ' |';
}
$devider .= "\n";
$ret .= $devider . $columnNames . "\n" . $devider;
while ($row = $GLOBALS['dbi']->fetchRow($result)) {
$values = '|';
foreach ($row as $value) {
if (is_null($value)) {
$value = 'NULL';
}
$values .= ' ' . $value . ' |';
}
$ret .= $values . "\n";
}
$ret .= $devider;
}
return $ret;
}
/**
* Verifies if current MySQL server supports profiling
*
* @access public
*
* @return boolean whether profiling is supported
*/
public static function profilingSupported()
{
if (!self::cacheExists('profiling_supported')) {
// 5.0.37 has profiling but for example, 5.1.20 does not
// (avoid a trip to the server for MySQL before 5.0.37)
// and do not set a constant as we might be switching servers
if ($GLOBALS['dbi']->fetchValue("SELECT @@have_profiling")
) {
self::cacheSet('profiling_supported', true);
} else {
self::cacheSet('profiling_supported', false);
}
}
return self::cacheGet('profiling_supported');
}
/**
* Formats $value to byte view
*
* @param double|int $value the value to format
* @param int $limes the sensitiveness
* @param int $comma the number of decimals to retain
*
* @return array the formatted value and its unit
*
* @access public
*/
public static function formatByteDown($value, $limes = 6, $comma = 0)
{
if ($value === null) {
return null;
}
$byteUnits = array(
/* l10n: shortcuts for Byte */
__('B'),
/* l10n: shortcuts for Kilobyte */
__('KiB'),
/* l10n: shortcuts for Megabyte */
__('MiB'),
/* l10n: shortcuts for Gigabyte */
__('GiB'),
/* l10n: shortcuts for Terabyte */
__('TiB'),
/* l10n: shortcuts for Petabyte */
__('PiB'),
/* l10n: shortcuts for Exabyte */
__('EiB')
);
$dh = pow(10, $comma);
$li = pow(10, $limes);
$unit = $byteUnits[0];
for ($d = 6, $ex = 15; $d >= 1; $d--, $ex-=3) {
$unitSize = $li * pow(10, $ex);
if (isset($byteUnits[$d]) && $value >= $unitSize) {
// use 1024.0 to avoid integer overflow on 64-bit machines
$value = round($value / (pow(1024, $d) / $dh)) /$dh;
$unit = $byteUnits[$d];
break 1;
} // end if
} // end for
if ($unit != $byteUnits[0]) {
// if the unit is not bytes (as represented in current language)
// reformat with max length of 5
// 4th parameter=true means do not reformat if value < 1
$return_value = self::formatNumber($value, 5, $comma, true, false);
} else {
// do not reformat, just handle the locale
$return_value = self::formatNumber($value, 0);
}
return array(trim($return_value), $unit);
} // end of the 'formatByteDown' function
/**
* Formats $value to the given length and appends SI prefixes
* with a $length of 0 no truncation occurs, number is only formatted
* to the current locale
*
* examples:
*
* echo formatNumber(123456789, 6); // 123,457 k
* echo formatNumber(-123456789, 4, 2); // -123.46 M
* echo formatNumber(-0.003, 6); // -3 m
* echo formatNumber(0.003, 3, 3); // 0.003
* echo formatNumber(0.00003, 3, 2); // 0.03 m
* echo formatNumber(0, 6); // 0
*
*
* @param double $value the value to format
* @param integer $digits_left number of digits left of the comma
* @param integer $digits_right number of digits right of the comma
* @param boolean $only_down do not reformat numbers below 1
* @param boolean $noTrailingZero removes trailing zeros right of the comma
* (default: true)
*
* @return string the formatted value and its unit
*
* @access public
*/
public static function formatNumber(
$value,
$digits_left = 3,
$digits_right = 0,
$only_down = false,
$noTrailingZero = true
) {
if ($value == 0) {
return '0';
}
$originalValue = $value;
//number_format is not multibyte safe, str_replace is safe
if ($digits_left === 0) {
$value = number_format(
$value,
$digits_right,
/* l10n: Decimal separator */
__('.'),
/* l10n: Thousands separator */
__(',')
);
if (($originalValue != 0) && (floatval($value) == 0)) {
$value = ' <' . (1 / pow(10, $digits_right));
}
return $value;
}
// this units needs no translation, ISO
$units = array(
-8 => 'y',
-7 => 'z',
-6 => 'a',
-5 => 'f',
-4 => 'p',
-3 => 'n',
-2 => 'µ',
-1 => 'm',
0 => ' ',
1 => 'k',
2 => 'M',
3 => 'G',
4 => 'T',
5 => 'P',
6 => 'E',
7 => 'Z',
8 => 'Y'
);
/* l10n: Decimal separator */
$decimal_sep = __('.');
/* l10n: Thousands separator */
$thousands_sep = __(',');
// check for negative value to retain sign
if ($value < 0) {
$sign = '-';
$value = abs($value);
} else {
$sign = '';
}
$dh = pow(10, $digits_right);
/*
* This gives us the right SI prefix already,
* but $digits_left parameter not incorporated
*/
$d = floor(log10($value) / 3);
/*
* Lowering the SI prefix by 1 gives us an additional 3 zeros
* So if we have 3,6,9,12.. free digits ($digits_left - $cur_digits)
* to use, then lower the SI prefix
*/
$cur_digits = floor(log10($value / pow(1000, $d))+1);
if ($digits_left > $cur_digits) {
$d -= floor(($digits_left - $cur_digits)/3);
}
if ($d < 0 && $only_down) {
$d = 0;
}
$value = round($value / (pow(1000, $d) / $dh)) /$dh;
$unit = $units[$d];
// number_format is not multibyte safe, str_replace is safe
$formattedValue = number_format(
$value,
$digits_right,
$decimal_sep,
$thousands_sep
);
// If we don't want any zeros, remove them now
if ($noTrailingZero && strpos($formattedValue, $decimal_sep) !== false) {
$formattedValue = preg_replace('/' . preg_quote($decimal_sep) . '?0+$/', '', $formattedValue);
}
if ($originalValue != 0 && floatval($value) == 0) {
return ' <' . number_format(
(1 / pow(10, $digits_right)),
$digits_right,
$decimal_sep,
$thousands_sep
)
. ' ' . $unit;
}
return $sign . $formattedValue . ' ' . $unit;
} // end of the 'formatNumber' function
/**
* Returns the number of bytes when a formatted size is given
*
* @param string $formatted_size the size expression (for example 8MB)
*
* @return integer The numerical part of the expression (for example 8)
*/
public static function extractValueFromFormattedSize($formatted_size)
{
$return_value = -1;
if (preg_match('/^[0-9]+GB$/', $formatted_size)) {
$return_value = mb_substr($formatted_size, 0, -2)
* pow(1024, 3);
} elseif (preg_match('/^[0-9]+MB$/', $formatted_size)) {
$return_value = mb_substr($formatted_size, 0, -2)
* pow(1024, 2);
} elseif (preg_match('/^[0-9]+K$/', $formatted_size)) {
$return_value = mb_substr($formatted_size, 0, -1)
* pow(1024, 1);
}
return $return_value;
}// end of the 'extractValueFromFormattedSize' function
/**
* Writes localised date
*
* @param integer $timestamp the current timestamp
* @param string $format format
*
* @return string the formatted date
*
* @access public
*/
public static function localisedDate($timestamp = -1, $format = '')
{
$month = array(
/* l10n: Short month name */
__('Jan'),
/* l10n: Short month name */
__('Feb'),
/* l10n: Short month name */
__('Mar'),
/* l10n: Short month name */
__('Apr'),
/* l10n: Short month name */
_pgettext('Short month name', 'May'),
/* l10n: Short month name */
__('Jun'),
/* l10n: Short month name */
__('Jul'),
/* l10n: Short month name */
__('Aug'),
/* l10n: Short month name */
__('Sep'),
/* l10n: Short month name */
__('Oct'),
/* l10n: Short month name */
__('Nov'),
/* l10n: Short month name */
__('Dec'));
$day_of_week = array(
/* l10n: Short week day name for Sunday */
_pgettext('Short week day name', 'Sun'),
/* l10n: Short week day name for Monday */
__('Mon'),
/* l10n: Short week day name for Tuesday */
__('Tue'),
/* l10n: Short week day name for Wednesday */
__('Wed'),
/* l10n: Short week day name for Thursday */
__('Thu'),
/* l10n: Short week day name for Friday */
__('Fri'),
/* l10n: Short week day name for Saturday */
__('Sat'));
if ($format == '') {
/* l10n: See https://www.php.net/manual/en/function.strftime.php */
$format = __('%B %d, %Y at %I:%M %p');
}
if ($timestamp == -1) {
$timestamp = time();
}
$date = preg_replace(
'@%[aA]@',
$day_of_week[(int)strftime('%w', $timestamp)],
$format
);
$date = preg_replace(
'@%[bB]@',
$month[(int)strftime('%m', $timestamp)-1],
$date
);
/* Fill in AM/PM */
$hours = (int)date('H', $timestamp);
if ($hours >= 12) {
$am_pm = _pgettext('AM/PM indication in time', 'PM');
} else {
$am_pm = _pgettext('AM/PM indication in time', 'AM');
}
$date = preg_replace('@%[pP]@', $am_pm, $date);
$ret = strftime($date, $timestamp);
// Some OSes such as Win8.1 Traditional Chinese version did not produce UTF-8
// output here. See https://github.com/phpmyadmin/phpmyadmin/issues/10598
if (mb_detect_encoding($ret, 'UTF-8', true) != 'UTF-8') {
$ret = date('Y-m-d H:i:s', $timestamp);
}
return $ret;
} // end of the 'localisedDate()' function
/**
* returns a tab for tabbed navigation.
* If the variables $link and $args ar left empty, an inactive tab is created
*
* @param array $tab array with all options
* @param array $url_params tab specific URL parameters
*
* @return string html code for one tab, a link if valid otherwise a span
*
* @access public
*/
public static function getHtmlTab(array $tab, array $url_params = array())
{
// default values
$defaults = array(
'text' => '',
'class' => '',
'active' => null,
'link' => '',
'sep' => '?',
'attr' => '',
'args' => '',
'warning' => '',
'fragment' => '',
'id' => '',
);
$tab = array_merge($defaults, $tab);
// determine additional style-class
if (empty($tab['class'])) {
if (! empty($tab['active'])
|| Core::isValid($GLOBALS['active_page'], 'identical', $tab['link'])
) {
$tab['class'] = 'active';
} elseif (is_null($tab['active']) && empty($GLOBALS['active_page'])
&& (basename($GLOBALS['PMA_PHP_SELF']) == $tab['link'])
) {
$tab['class'] = 'active';
}
}
// build the link
if (! empty($tab['link'])) {
// If there are any tab specific URL parameters, merge those with
// the general URL parameters
if (! empty($tab['args']) && is_array($tab['args'])) {
$url_params = array_merge($url_params, $tab['args']);
}
$tab['link'] = htmlentities($tab['link']) . Url::getCommon($url_params);
}
if (! empty($tab['fragment'])) {
$tab['link'] .= $tab['fragment'];
}
// display icon
if (isset($tab['icon'])) {
// avoid generating an alt tag, because it only illustrates
// the text that follows and if browser does not display
// images, the text is duplicated
$tab['text'] = self::getIcon(
$tab['icon'],
$tab['text'],
false,
true,
'TabsMode'
);
} elseif (empty($tab['text'])) {
// check to not display an empty link-text
$tab['text'] = '?';
trigger_error(
'empty linktext in function ' . __FUNCTION__ . '()',
E_USER_NOTICE
);
}
//Set the id for the tab, if set in the params
$tabId = (empty($tab['id']) ? null : $tab['id']);
$item = array();
if (!empty($tab['link'])) {
$item = array(
'content' => $tab['text'],
'url' => array(
'href' => empty($tab['link']) ? null : $tab['link'],
'id' => $tabId,
'class' => 'tab' . htmlentities($tab['class']),
),
);
} else {
$item['content'] = '' . $tab['text'] . '';
}
$item['class'] = $tab['class'] == 'active' ? 'active' : '';
return Template::get('list/item')
->render($item);
} // end of the 'getHtmlTab()' function
/**
* returns html-code for a tab navigation
*
* @param array $tabs one element per tab
* @param array $url_params additional URL parameters
* @param string $menu_id HTML id attribute for the menu container
* @param bool $resizable whether to add a "resizable" class
*
* @return string html-code for tab-navigation
*/
public static function getHtmlTabs(
array $tabs,
array $url_params,
$menu_id,
$resizable = false
) {
$class = '';
if ($resizable) {
$class = ' class="resizable-menu"';
}
$tab_navigation = '
' . "\n";
return $tab_navigation;
}
/**
* Displays a link, or a link with code to trigger POST request.
*
* POST is used in following cases:
*
* - URL is too long
* - URL components are over Suhosin limits
* - There is SQL query in the parameters
*
* @param string $url the URL
* @param string $message the link message
* @param mixed $tag_params string: js confirmation; array: additional tag
* params (f.e. style="")
* @param string $target target
*
* @return string the results to be echoed or saved in an array
*/
public static function linkOrButton(
$url, $message, $tag_params = array(), $target = ''
) {
$url_length = strlen($url);
if (! is_array($tag_params)) {
$tmp = $tag_params;
$tag_params = array();
if (! empty($tmp)) {
$tag_params['onclick'] = 'return confirmLink(this, \''
. Sanitize::escapeJsString($tmp) . '\')';
}
unset($tmp);
}
if (! empty($target)) {
$tag_params['target'] = $target;
if ($target === '_blank' && strncmp($url, 'url.php?', 8) == 0) {
$tag_params['rel'] = 'noopener noreferrer';
}
}
// Suhosin: Check that each query parameter is not above maximum
$in_suhosin_limits = true;
if ($url_length <= $GLOBALS['cfg']['LinkLengthLimit']) {
$suhosin_get_MaxValueLength = ini_get('suhosin.get.max_value_length');
if ($suhosin_get_MaxValueLength) {
$query_parts = self::splitURLQuery($url);
foreach ($query_parts as $query_pair) {
if (strpos($query_pair, '=') === false) {
continue;
}
list(, $eachval) = explode('=', $query_pair);
if (strlen($eachval) > $suhosin_get_MaxValueLength
) {
$in_suhosin_limits = false;
break;
}
}
}
}
$tag_params_strings = array();
if (($url_length > $GLOBALS['cfg']['LinkLengthLimit'])
|| ! $in_suhosin_limits
// Has as sql_query without a signature
|| ( strpos($url, 'sql_query=') !== false && strpos($url, 'sql_signature=') === false)
|| strpos($url, 'view[as]=') !== false
) {
$parts = explode('?', $url, 2);
/*
* The data-post indicates that client should do POST
* this is handled in js/ajax.js
*/
$tag_params_strings[] = 'data-post="' . (isset($parts[1]) ? $parts[1] : '') . '"';
$url = $parts[0];
if(array_key_exists('class', $tag_params)
&& strpos($tag_params['class'], 'create_view') !== false
) {
$url .= '?' . explode('&', $parts[1], 2)[0];
}
}
foreach ($tag_params as $par_name => $par_value) {
$tag_params_strings[] = $par_name . '="' . htmlspecialchars($par_value) . '"';
}
// no whitespace within an else Safari will make it part of the link
return ''
. $message . '';
} // end of the 'linkOrButton()' function
/**
* Splits a URL string by parameter
*
* @param string $url the URL
*
* @return array the parameter/value pairs, for example [0] db=sakila
*/
public static function splitURLQuery($url)
{
// decode encoded url separators
$separator = Url::getArgSeparator();
// on most places separator is still hard coded ...
if ($separator !== '&') {
// ... so always replace & with $separator
$url = str_replace(htmlentities('&'), $separator, $url);
$url = str_replace('&', $separator, $url);
}
$url = str_replace(htmlentities($separator), $separator, $url);
// end decode
$url_parts = parse_url($url);
if (! empty($url_parts['query'])) {
return explode($separator, $url_parts['query']);
}
return array();
}
/**
* Returns a given timespan value in a readable format.
*
* @param int $seconds the timespan
*
* @return string the formatted value
*/
public static function timespanFormat($seconds)
{
$days = floor($seconds / 86400);
if ($days > 0) {
$seconds -= $days * 86400;
}
$hours = floor($seconds / 3600);
if ($days > 0 || $hours > 0) {
$seconds -= $hours * 3600;
}
$minutes = floor($seconds / 60);
if ($days > 0 || $hours > 0 || $minutes > 0) {
$seconds -= $minutes * 60;
}
return sprintf(
__('%s days, %s hours, %s minutes and %s seconds'),
(string)$days,
(string)$hours,
(string)$minutes,
(string)$seconds
);
}
/**
* Function added to avoid path disclosures.
* Called by each script that needs parameters, it displays
* an error message and, by default, stops the execution.
*
* @param string[] $params The names of the parameters needed by the calling
* script
* @param boolean $request Check parameters in request
*
* @return void
*
* @access public
*/
public static function checkParameters($params, $request=false)
{
$reported_script_name = basename($GLOBALS['PMA_PHP_SELF']);
$found_error = false;
$error_message = '';
if ($request) {
$array = $_REQUEST;
} else {
$array = $GLOBALS;
}
foreach ($params as $param) {
if (! isset($array[$param])) {
$error_message .= $reported_script_name
. ': ' . __('Missing parameter:') . ' '
. $param
. self::showDocu('faq', 'faqmissingparameters',true)
. '[br]';
$found_error = true;
}
}
if ($found_error) {
Core::fatalError($error_message);
}
} // end function
/**
* Function to generate unique condition for specified row.
*
* @param resource $handle current query result
* @param integer $fields_cnt number of fields
* @param array $fields_meta meta information about fields
* @param array $row current row
* @param boolean $force_unique generate condition only on pk
* or unique
* @param string|boolean $restrict_to_table restrict the unique condition
* to this table or false if
* none
* @param array|null $analyzed_sql_results the analyzed query
*
* @access public
*
* @return array the calculated condition and whether condition is unique
*/
public static function getUniqueCondition(
$handle, $fields_cnt, array $fields_meta, array $row, $force_unique = false,
$restrict_to_table = false, $analyzed_sql_results = null
) {
$primary_key = '';
$unique_key = '';
$nonprimary_condition = '';
$preferred_condition = '';
$primary_key_array = array();
$unique_key_array = array();
$nonprimary_condition_array = array();
$condition_array = array();
for ($i = 0; $i < $fields_cnt; ++$i) {
$con_val = '';
$field_flags = $GLOBALS['dbi']->fieldFlags($handle, $i);
$meta = $fields_meta[$i];
// do not use a column alias in a condition
if (! isset($meta->orgname) || strlen($meta->orgname) === 0) {
$meta->orgname = $meta->name;
if (!empty($analyzed_sql_results['statement']->expr)) {
foreach ($analyzed_sql_results['statement']->expr as $expr) {
if ((empty($expr->alias)) || (empty($expr->column))) {
continue;
}
if (strcasecmp($meta->name, $expr->alias) == 0) {
$meta->orgname = $expr->column;
break;
}
}
}
}
// Do not use a table alias in a condition.
// Test case is:
// select * from galerie x WHERE
//(select count(*) from galerie y where y.datum=x.datum)>1
//
// But orgtable is present only with mysqli extension so the
// fix is only for mysqli.
// Also, do not use the original table name if we are dealing with
// a view because this view might be updatable.
// (The isView() verification should not be costly in most cases
// because there is some caching in the function).
if (isset($meta->orgtable)
&& ($meta->table != $meta->orgtable)
&& ! $GLOBALS['dbi']->getTable($GLOBALS['db'], $meta->table)->isView()
) {
$meta->table = $meta->orgtable;
}
// If this field is not from the table which the unique clause needs
// to be restricted to.
if ($restrict_to_table && $restrict_to_table != $meta->table) {
continue;
}
// to fix the bug where float fields (primary or not)
// can't be matched because of the imprecision of
// floating comparison, use CONCAT
// (also, the syntax "CONCAT(field) IS NULL"
// that we need on the next "if" will work)
if ($meta->type == 'real') {
$con_key = 'CONCAT(' . self::backquote($meta->table) . '.'
. self::backquote($meta->orgname) . ')';
} else {
$con_key = self::backquote($meta->table) . '.'
. self::backquote($meta->orgname);
} // end if... else...
$condition = ' ' . $con_key . ' ';
if (! isset($row[$i]) || is_null($row[$i])) {
$con_val = 'IS NULL';
} else {
// timestamp is numeric on some MySQL 4.1
// for real we use CONCAT above and it should compare to string
if ($meta->numeric
&& ($meta->type != 'timestamp')
&& ($meta->type != 'real')
) {
$con_val = '= ' . $row[$i];
} elseif ((($meta->type == 'blob') || ($meta->type == 'string'))
&& stristr($field_flags, 'BINARY')
&& ! empty($row[$i])
) {
// hexify only if this is a true not empty BLOB or a BINARY
// do not waste memory building a too big condition
if (mb_strlen($row[$i]) < 1000) {
// use a CAST if possible, to avoid problems
// if the field contains wildcard characters % or _
$con_val = '= CAST(0x' . bin2hex($row[$i]) . ' AS BINARY)';
} elseif ($fields_cnt == 1) {
// when this blob is the only field present
// try settling with length comparison
$condition = ' CHAR_LENGTH(' . $con_key . ') ';
$con_val = ' = ' . mb_strlen($row[$i]);
} else {
// this blob won't be part of the final condition
$con_val = null;
}
} elseif (in_array($meta->type, self::getGISDatatypes())
&& ! empty($row[$i])
) {
// do not build a too big condition
if (mb_strlen($row[$i]) < 5000) {
$condition .= '=0x' . bin2hex($row[$i]) . ' AND';
} else {
$condition = '';
}
} elseif ($meta->type == 'bit') {
$con_val = "= b'"
. self::printableBitValue($row[$i], $meta->length) . "'";
} else {
$con_val = '= \''
. $GLOBALS['dbi']->escapeString($row[$i]) . '\'';
}
}
if ($con_val != null) {
$condition .= $con_val . ' AND';
if ($meta->primary_key > 0) {
$primary_key .= $condition;
$primary_key_array[$con_key] = $con_val;
} elseif ($meta->unique_key > 0) {
$unique_key .= $condition;
$unique_key_array[$con_key] = $con_val;
}
$nonprimary_condition .= $condition;
$nonprimary_condition_array[$con_key] = $con_val;
}
} // end for
// Correction University of Virginia 19991216:
// prefer primary or unique keys for condition,
// but use conjunction of all values if no primary key
$clause_is_unique = true;
if ($primary_key) {
$preferred_condition = $primary_key;
$condition_array = $primary_key_array;
} elseif ($unique_key) {
$preferred_condition = $unique_key;
$condition_array = $unique_key_array;
} elseif (! $force_unique) {
$preferred_condition = $nonprimary_condition;
$condition_array = $nonprimary_condition_array;
$clause_is_unique = false;
}
$where_clause = trim(preg_replace('|\s?AND$|', '', $preferred_condition));
return(array($where_clause, $clause_is_unique, $condition_array));
} // end function
/**
* Generate the charset query part
*
* @param string $collation Collation
* @param boolean optional $override force 'CHARACTER SET' keyword
*
* @return string
*/
static function getCharsetQueryPart($collation, $override = false)
{
list($charset) = explode('_', $collation);
$keyword = ' CHARSET=';
if ($override) {
$keyword = ' CHARACTER SET ';
}
return $keyword . $charset
. ($charset == $collation ? '' : ' COLLATE ' . $collation);
}
/**
* Generate a button or image tag
*
* @param string $button_name name of button element
* @param string $button_class class of button or image element
* @param string $text text to display
* @param string $image image to display
* @param string $value value
*
* @return string html content
*
* @access public
*/
public static function getButtonOrImage(
$button_name, $button_class, $text, $image, $value = ''
) {
if ($value == '') {
$value = $text;
}
if ($GLOBALS['cfg']['ActionLinksMode'] == 'text') {
return ' ' . "\n";
}
return '' . "\n";
} // end function
/**
* Generate a pagination selector for browsing resultsets
*
* @param string $name The name for the request parameter
* @param int $rows Number of rows in the pagination set
* @param int $pageNow current page number
* @param int $nbTotalPage number of total pages
* @param int $showAll If the number of pages is lower than this
* variable, no pages will be omitted in pagination
* @param int $sliceStart How many rows at the beginning should always
* be shown?
* @param int $sliceEnd How many rows at the end should always be shown?
* @param int $percent Percentage of calculation page offsets to hop to a
* next page
* @param int $range Near the current page, how many pages should
* be considered "nearby" and displayed as well?
* @param string $prompt The prompt to display (sometimes empty)
*
* @return string
*
* @access public
*/
public static function pageselector(
$name, $rows, $pageNow = 1, $nbTotalPage = 1, $showAll = 200,
$sliceStart = 5,
$sliceEnd = 5, $percent = 20, $range = 10, $prompt = ''
) {
$increment = floor($nbTotalPage / $percent);
$pageNowMinusRange = ($pageNow - $range);
$pageNowPlusRange = ($pageNow + $range);
$gotopage = $prompt . ' ';
return $gotopage;
} // end function
/**
* Calculate page number through position
* @param int $pos position of first item
* @param int $max_count number of items per page
* @return int $page_num
* @access public
*/
public static function getPageFromPosition($pos, $max_count)
{
return floor($pos / $max_count) + 1;
}
/**
* Prepare navigation for a list
*
* @param int $count number of elements in the list
* @param int $pos current position in the list
* @param array $_url_params url parameters
* @param string $script script name for form target
* @param string $frame target frame
* @param int $max_count maximum number of elements to display from
* the list
* @param string $name the name for the request parameter
* @param string[] $classes additional classes for the container
*
* @return string $list_navigator_html the html content
*
* @access public
*
* @todo use $pos from $_url_params
*/
public static function getListNavigator(
$count, $pos, array $_url_params, $script, $frame, $max_count, $name = 'pos',
$classes = array()
) {
// This is often coming from $cfg['MaxTableList'] and
// people sometimes set it to empty string
$max_count = intval($max_count);
if ($max_count <= 0) {
$max_count = 250;
}
$class = $frame == 'frame_navigation' ? ' class="ajax"' : '';
$list_navigator_html = '';
if ($max_count < $count) {
$classes[] = 'pageselector';
$list_navigator_html .= '
' . "\n";
}
return $list_navigator_html;
}
/**
* replaces %u in given path with current user name
*
* example:
*
* $user_dir = userDir('/var/pma_tmp/%u/'); // '/var/pma_tmp/root/'
*
*
*
* @param string $dir with wildcard for user
*
* @return string per user directory
*/
public static function userDir($dir)
{
// add trailing slash
if (mb_substr($dir, -1) != '/') {
$dir .= '/';
}
return str_replace('%u', Core::securePath($GLOBALS['cfg']['Server']['user']), $dir);
}
/**
* returns html code for db link to default db page
*
* @param string $database database
*
* @return string html link to default db page
*/
public static function getDbLink($database = null)
{
if (strlen($database) === 0) {
if (strlen($GLOBALS['db']) === 0) {
return '';
}
$database = $GLOBALS['db'];
} else {
$database = self::unescapeMysqlWildcards($database);
}
return '' . htmlspecialchars($database) . '';
}
/**
* Prepare a lightbulb hint explaining a known external bug
* that affects a functionality
*
* @param string $functionality localized message explaining the func.
* @param string $component 'mysql' (eventually, 'php')
* @param string $minimum_version of this component
* @param string $bugref bug reference for this component
*
* @return String
*/
public static function getExternalBug(
$functionality, $component, $minimum_version, $bugref
) {
$ext_but_html = '';
if (($component == 'mysql') && ($GLOBALS['dbi']->getVersion() < $minimum_version)) {
$ext_but_html .= self::showHint(
sprintf(
__('The %s functionality is affected by a known bug, see %s'),
$functionality,
Core::linkURL('https://bugs.mysql.com/') . $bugref
)
);
}
return $ext_but_html;
}
/**
* Generates a set of radio HTML fields
*
* @param string $html_field_name the radio HTML field
* @param array $choices the choices values and labels
* @param string $checked_choice the choice to check by default
* @param boolean $line_break whether to add HTML line break after a choice
* @param boolean $escape_label whether to use htmlspecialchars() on label
* @param string $class enclose each choice with a div of this class
* @param string $id_prefix prefix for the id attribute, name will be
* used if this is not supplied
*
* @return string set of html radio fiels
*/
public static function getRadioFields(
$html_field_name, array $choices, $checked_choice = '',
$line_break = true, $escape_label = true, $class = '',
$id_prefix = ''
) {
$radio_html = '';
foreach ($choices as $choice_value => $choice_label) {
if (! $id_prefix) {
$id_prefix = $html_field_name;
}
$html_field_id = $id_prefix . '_' . $choice_value;
if ($choice_value == $checked_choice){
$checked = 1;
}
else{
$checked = 0;
}
$radio_html .= Template::get('radio_fields')->render([
'class' => $class,
'html_field_name' => $html_field_name,
'html_field_id' => $html_field_id,
'choice_value' => $choice_value,
'is_line_break' => $line_break,
'choice_label' => $choice_label,
'escape_label' => $escape_label,
'checked' => $checked
]);
}
return $radio_html;
}
/**
* Generates and returns an HTML dropdown
*
* @param string $select_name name for the select element
* @param array $choices choices values
* @param string $active_choice the choice to select by default
* @param string $id id of the select element; can be different in
* case the dropdown is present more than once
* on the page
* @param string $class class for the select element
* @param string $placeholder Placeholder for dropdown if nothing else
* is selected
*
* @return string html content
*
* @todo support titles
*/
public static function getDropdown(
$select_name, array $choices, $active_choice, $id, $class = '', $placeholder = null
) {
$resultOptions = [];
$selected = false;
foreach ($choices as $one_choice_value => $one_choice_label) {
$resultOptions[$one_choice_value]['value'] = $one_choice_value;
$resultOptions[$one_choice_value]['selected'] = false;
if ($one_choice_value == $active_choice) {
$resultOptions[$one_choice_value]['selected'] = true;
$selected = true;
}
$resultOptions[$one_choice_value]['label'] = $one_choice_label;
}
return Template::get('dropdown')->render([
'select_name' => $select_name,
'id' => $id,
'class' => $class,
'placeholder' => $placeholder,
'selected' => $selected,
'result_options' => $resultOptions,
]);
}
/**
* Generates a slider effect (jQjuery)
* Takes care of generating the initial
and the link
* controlling the slider; you have to generate the
yourself
* after the sliding section.
*
* @param string $id the id of the
on which to apply the effect
* @param string $message the message to show as a link
* @param string|null $overrideDefault override InitialSlidersState config
*
* @return string html div element
*
*/
public static function getDivForSliderEffect($id = '', $message = '', $overrideDefault = null)
{
return Template::get('div_for_slider_effect')->render([
'id' => $id,
'initial_sliders_state' => ($overrideDefault != null) ? $overrideDefault : $GLOBALS['cfg']['InitialSlidersState'],
'message' => $message,
]);
}
/**
* Creates an AJAX sliding toggle button
* (or and equivalent form when AJAX is disabled)
*
* @param string $action The URL for the request to be executed
* @param string $select_name The name for the dropdown box
* @param array $options An array of options (see PhpMyAdmin\Rte\Footer)
* @param string $callback A JS snippet to execute when the request is
* successfully processed
*
* @return string HTML code for the toggle button
*/
public static function toggleButton($action, $select_name, array $options, $callback)
{
// Do the logic first
$link = "$action&" . urlencode($select_name) . "=";
$link_on = $link . urlencode($options[1]['value']);
$link_off = $link . urlencode($options[0]['value']);
if ($options[1]['selected'] == true) {
$state = 'on';
} elseif ($options[0]['selected'] == true) {
$state = 'off';
} else {
$state = 'on';
}
return Template::get('toggle_button')->render(
[
'pma_theme_image' => $GLOBALS['pmaThemeImage'],
'text_dir' => $GLOBALS['text_dir'],
'link_on' => $link_on,
'link_off' => $link_off,
'toggle_on' => $options[1]['label'],
'toggle_off' => $options[0]['label'],
'callback' => $callback,
'state' => $state
]);
} // end toggleButton()
/**
* Clears cache content which needs to be refreshed on user change.
*
* @return void
*/
public static function clearUserCache()
{
self::cacheUnset('is_superuser');
self::cacheUnset('is_createuser');
self::cacheUnset('is_grantuser');
}
/**
* Calculates session cache key
*
* @return string
*/
public static function cacheKey()
{
if (isset($GLOBALS['cfg']['Server']['user'])) {
return 'server_' . $GLOBALS['server'] . '_' . $GLOBALS['cfg']['Server']['user'];
}
return 'server_' . $GLOBALS['server'];
}
/**
* Verifies if something is cached in the session
*
* @param string $var variable name
*
* @return boolean
*/
public static function cacheExists($var)
{
return isset($_SESSION['cache'][self::cacheKey()][$var]);
}
/**
* Gets cached information from the session
*
* @param string $var variable name
* @param \Closure $callback callback to fetch the value
*
* @return mixed
*/
public static function cacheGet($var, $callback = null)
{
if (self::cacheExists($var)) {
return $_SESSION['cache'][self::cacheKey()][$var];
}
if ($callback) {
$val = $callback();
self::cacheSet($var, $val);
return $val;
}
return null;
}
/**
* Caches information in the session
*
* @param string $var variable name
* @param mixed $val value
*
* @return mixed
*/
public static function cacheSet($var, $val = null)
{
$_SESSION['cache'][self::cacheKey()][$var] = $val;
}
/**
* Removes cached information from the session
*
* @param string $var variable name
*
* @return void
*/
public static function cacheUnset($var)
{
unset($_SESSION['cache'][self::cacheKey()][$var]);
}
/**
* Converts a bit value to printable format;
* in MySQL a BIT field can be from 1 to 64 bits so we need this
* function because in PHP, decbin() supports only 32 bits
* on 32-bit servers
*
* @param integer $value coming from a BIT field
* @param integer $length length
*
* @return string the printable value
*/
public static function printableBitValue($value, $length)
{
// if running on a 64-bit server or the length is safe for decbin()
if (PHP_INT_SIZE == 8 || $length < 33) {
$printable = decbin($value);
} else {
// FIXME: does not work for the leftmost bit of a 64-bit value
$i = 0;
$printable = '';
while ($value >= pow(2, $i)) {
++$i;
}
if ($i != 0) {
--$i;
}
while ($i >= 0) {
if ($value - pow(2, $i) < 0) {
$printable = '0' . $printable;
} else {
$printable = '1' . $printable;
$value = $value - pow(2, $i);
}
--$i;
}
$printable = strrev($printable);
}
$printable = str_pad($printable, $length, '0', STR_PAD_LEFT);
return $printable;
}
/**
* Verifies whether the value contains a non-printable character
*
* @param string $value value
*
* @return integer
*/
public static function containsNonPrintableAscii($value)
{
return preg_match('@[^[:print:]]@', $value);
}
/**
* Converts a BIT type default value
* for example, b'010' becomes 010
*
* @param string $bit_default_value value
*
* @return string the converted value
*/
public static function convertBitDefaultValue($bit_default_value)
{
return rtrim(ltrim(htmlspecialchars_decode($bit_default_value, ENT_QUOTES), "b'"), "'");
}
/**
* Extracts the various parts from a column spec
*
* @param string $columnspec Column specification
*
* @return array associative array containing type, spec_in_brackets
* and possibly enum_set_values (another array)
*/
public static function extractColumnSpec($columnspec)
{
$first_bracket_pos = mb_strpos($columnspec, '(');
if ($first_bracket_pos) {
$spec_in_brackets = chop(
mb_substr(
$columnspec,
$first_bracket_pos + 1,
mb_strrpos($columnspec, ')') - $first_bracket_pos - 1
)
);
// convert to lowercase just to be sure
$type = mb_strtolower(
chop(mb_substr($columnspec, 0, $first_bracket_pos))
);
} else {
// Split trailing attributes such as unsigned,
// binary, zerofill and get data type name
$type_parts = explode(' ', $columnspec);
$type = mb_strtolower($type_parts[0]);
$spec_in_brackets = '';
}
if ('enum' == $type || 'set' == $type) {
// Define our working vars
$enum_set_values = self::parseEnumSetValues($columnspec, false);
$printtype = $type
. '(' . str_replace("','", "', '", $spec_in_brackets) . ')';
$binary = false;
$unsigned = false;
$zerofill = false;
} else {
$enum_set_values = array();
/* Create printable type name */
$printtype = mb_strtolower($columnspec);
// Strip the "BINARY" attribute, except if we find "BINARY(" because
// this would be a BINARY or VARBINARY column type;
// by the way, a BLOB should not show the BINARY attribute
// because this is not accepted in MySQL syntax.
if (preg_match('@binary@', $printtype)
&& ! preg_match('@binary[\(]@', $printtype)
) {
$printtype = preg_replace('@binary@', '', $printtype);
$binary = true;
} else {
$binary = false;
}
$printtype = preg_replace(
'@zerofill@', '', $printtype, -1, $zerofill_cnt
);
$zerofill = ($zerofill_cnt > 0);
$printtype = preg_replace(
'@unsigned@', '', $printtype, -1, $unsigned_cnt
);
$unsigned = ($unsigned_cnt > 0);
$printtype = trim($printtype);
}
$attribute = ' ';
if ($binary) {
$attribute = 'BINARY';
}
if ($unsigned) {
$attribute = 'UNSIGNED';
}
if ($zerofill) {
$attribute = 'UNSIGNED ZEROFILL';
}
$can_contain_collation = false;
if (! $binary
&& preg_match(
"@^(char|varchar|text|tinytext|mediumtext|longtext|set|enum)@", $type
)
) {
$can_contain_collation = true;
}
// for the case ENUM('–','“')
$displayed_type = htmlspecialchars($printtype);
if (mb_strlen($printtype) > $GLOBALS['cfg']['LimitChars']) {
$displayed_type = '';
$displayed_type .= htmlspecialchars(
mb_substr(
$printtype, 0, $GLOBALS['cfg']['LimitChars']
) . '...'
);
$displayed_type .= '';
}
return array(
'type' => $type,
'spec_in_brackets' => $spec_in_brackets,
'enum_set_values' => $enum_set_values,
'print_type' => $printtype,
'binary' => $binary,
'unsigned' => $unsigned,
'zerofill' => $zerofill,
'attribute' => $attribute,
'can_contain_collation' => $can_contain_collation,
'displayed_type' => $displayed_type
);
}
/**
* Verifies if this table's engine supports foreign keys
*
* @param string $engine engine
*
* @return boolean
*/
public static function isForeignKeySupported($engine)
{
$engine = strtoupper($engine);
if (($engine == 'INNODB') || ($engine == 'PBXT')) {
return true;
} elseif ($engine == 'NDBCLUSTER' || $engine == 'NDB') {
$ndbver = strtolower(
$GLOBALS['dbi']->fetchValue("SELECT @@ndb_version_string")
);
if (substr($ndbver, 0, 4) == 'ndb-') {
$ndbver = substr($ndbver, 4);
}
return version_compare($ndbver, 7.3, '>=');
}
return false;
}
/**
* Is Foreign key check enabled?
*
* @return bool
*/
public static function isForeignKeyCheck()
{
if ($GLOBALS['cfg']['DefaultForeignKeyChecks'] === 'enable') {
return true;
} elseif ($GLOBALS['cfg']['DefaultForeignKeyChecks'] === 'disable') {
return false;
}
return ($GLOBALS['dbi']->getVariable('FOREIGN_KEY_CHECKS') == 'ON');
}
/**
* Get HTML for Foreign key check checkbox
*
* @return string HTML for checkbox
*/
public static function getFKCheckbox()
{
return Template::get('fk_checkbox')->render([
'checked' => self::isForeignKeyCheck(),
]);
}
/**
* Handle foreign key check request
*
* @return bool Default foreign key checks value
*/
public static function handleDisableFKCheckInit()
{
$default_fk_check_value
= $GLOBALS['dbi']->getVariable('FOREIGN_KEY_CHECKS') == 'ON';
if (isset($_REQUEST['fk_checks'])) {
if (empty($_REQUEST['fk_checks'])) {
// Disable foreign key checks
$GLOBALS['dbi']->setVariable('FOREIGN_KEY_CHECKS', 'OFF');
} else {
// Enable foreign key checks
$GLOBALS['dbi']->setVariable('FOREIGN_KEY_CHECKS', 'ON');
}
} // else do nothing, go with default
return $default_fk_check_value;
}
/**
* Cleanup changes done for foreign key check
*
* @param bool $default_fk_check_value original value for 'FOREIGN_KEY_CHECKS'
*
* @return void
*/
public static function handleDisableFKCheckCleanup($default_fk_check_value)
{
$GLOBALS['dbi']->setVariable(
'FOREIGN_KEY_CHECKS', $default_fk_check_value ? 'ON' : 'OFF'
);
}
/**
* Converts GIS data to Well Known Text format
*
* @param string $data GIS data
* @param bool $includeSRID Add SRID to the WKT
*
* @return string GIS data in Well Know Text format
*/
public static function asWKT($data, $includeSRID = false)
{
// Convert to WKT format
$hex = bin2hex($data);
$spatialAsText = 'ASTEXT';
$spatialSrid = 'SRID';
if ($GLOBALS['dbi']->getVersion() >= 50600) {
$spatialAsText = 'ST_ASTEXT';
$spatialSrid = 'ST_SRID';
}
$wktsql = "SELECT $spatialAsText(x'" . $hex . "')";
if ($includeSRID) {
$wktsql .= ", $spatialSrid(x'" . $hex . "')";
}
$wktresult = $GLOBALS['dbi']->tryQuery(
$wktsql
);
$wktarr = $GLOBALS['dbi']->fetchRow($wktresult, 0);
$wktval = isset($wktarr[0]) ? $wktarr[0] : null;
if ($includeSRID) {
$srid = isset($wktarr[1]) ? $wktarr[1] : null;
$wktval = "'" . $wktval . "'," . $srid;
}
@$GLOBALS['dbi']->freeResult($wktresult);
return $wktval;
}
/**
* If the string starts with a \r\n pair (0x0d0a) add an extra \n
*
* @param string $string string
*
* @return string with the chars replaced
*/
public static function duplicateFirstNewline($string)
{
$first_occurence = mb_strpos($string, "\r\n");
if ($first_occurence === 0) {
$string = "\n" . $string;
}
return $string;
}
/**
* Get the action word corresponding to a script name
* in order to display it as a title in navigation panel
*
* @param string $target a valid value for $cfg['NavigationTreeDefaultTabTable'],
* $cfg['NavigationTreeDefaultTabTable2'],
* $cfg['DefaultTabTable'] or $cfg['DefaultTabDatabase']
*
* @return string Title for the $cfg value
*/
public static function getTitleForTarget($target)
{
$mapping = array(
'structure' => __('Structure'),
'sql' => __('SQL'),
'search' =>__('Search'),
'insert' =>__('Insert'),
'browse' => __('Browse'),
'operations' => __('Operations'),
// For backward compatiblity
// Values for $cfg['DefaultTabTable']
'tbl_structure.php' => __('Structure'),
'tbl_sql.php' => __('SQL'),
'tbl_select.php' =>__('Search'),
'tbl_change.php' =>__('Insert'),
'sql.php' => __('Browse'),
// Values for $cfg['DefaultTabDatabase']
'db_structure.php' => __('Structure'),
'db_sql.php' => __('SQL'),
'db_search.php' => __('Search'),
'db_operations.php' => __('Operations'),
);
return isset($mapping[$target]) ? $mapping[$target] : false;
}
/**
* Get the script name corresponding to a plain English config word
* in order to append in links on navigation and main panel
*
* @param string $target a valid value for
* $cfg['NavigationTreeDefaultTabTable'],
* $cfg['NavigationTreeDefaultTabTable2'],
* $cfg['DefaultTabTable'], $cfg['DefaultTabDatabase'] or
* $cfg['DefaultTabServer']
* @param string $location one out of 'server', 'table', 'database'
*
* @return string script name corresponding to the config word
*/
public static function getScriptNameForOption($target, $location)
{
if ($location == 'server') {
// Values for $cfg['DefaultTabServer']
switch ($target) {
case 'welcome':
return 'index.php';
case 'databases':
return 'server_databases.php';
case 'status':
return 'server_status.php';
case 'variables':
return 'server_variables.php';
case 'privileges':
return 'server_privileges.php';
}
} elseif ($location == 'database') {
// Values for $cfg['DefaultTabDatabase']
switch ($target) {
case 'structure':
return 'db_structure.php';
case 'sql':
return 'db_sql.php';
case 'search':
return 'db_search.php';
case 'operations':
return 'db_operations.php';
}
} elseif ($location == 'table') {
// Values for $cfg['DefaultTabTable'],
// $cfg['NavigationTreeDefaultTabTable'] and
// $cfg['NavigationTreeDefaultTabTable2']
switch ($target) {
case 'structure':
return 'tbl_structure.php';
case 'sql':
return 'tbl_sql.php';
case 'search':
return 'tbl_select.php';
case 'insert':
return 'tbl_change.php';
case 'browse':
return 'sql.php';
}
}
return $target;
}
/**
* Formats user string, expanding @VARIABLES@, accepting strftime format
* string.
*
* @param string $string Text where to do expansion.
* @param array|string $escape Function to call for escaping variable values.
* Can also be an array of:
* - the escape method name
* - the class that contains the method
* - location of the class (for inclusion)
* @param array $updates Array with overrides for default parameters
* (obtained from GLOBALS).
*
* @return string
*/
public static function expandUserString(
$string, $escape = null, array $updates = array()
) {
/* Content */
$vars = array();
$vars['http_host'] = Core::getenv('HTTP_HOST');
$vars['server_name'] = $GLOBALS['cfg']['Server']['host'];
$vars['server_verbose'] = $GLOBALS['cfg']['Server']['verbose'];
if (empty($GLOBALS['cfg']['Server']['verbose'])) {
$vars['server_verbose_or_name'] = $GLOBALS['cfg']['Server']['host'];
} else {
$vars['server_verbose_or_name'] = $GLOBALS['cfg']['Server']['verbose'];
}
$vars['database'] = $GLOBALS['db'];
$vars['table'] = $GLOBALS['table'];
$vars['phpmyadmin_version'] = 'phpMyAdmin ' . PMA_VERSION;
/* Update forced variables */
foreach ($updates as $key => $val) {
$vars[$key] = $val;
}
/* Replacement mapping */
/*
* The __VAR__ ones are for backward compatibility, because user
* might still have it in cookies.
*/
$replace = array(
'@HTTP_HOST@' => $vars['http_host'],
'@SERVER@' => $vars['server_name'],
'__SERVER__' => $vars['server_name'],
'@VERBOSE@' => $vars['server_verbose'],
'@VSERVER@' => $vars['server_verbose_or_name'],
'@DATABASE@' => $vars['database'],
'__DB__' => $vars['database'],
'@TABLE@' => $vars['table'],
'__TABLE__' => $vars['table'],
'@PHPMYADMIN@' => $vars['phpmyadmin_version'],
);
/* Optional escaping */
if (! is_null($escape)) {
if (is_array($escape)) {
$escape_class = new $escape[1];
$escape_method = $escape[0];
}
foreach ($replace as $key => $val) {
if (is_array($escape)) {
$replace[$key] = $escape_class->$escape_method($val);
} else {
$replace[$key] = ($escape == 'backquote')
? self::$escape($val)
: $escape($val);
}
}
}
/* Backward compatibility in 3.5.x */
if (mb_strpos($string, '@FIELDS@') !== false) {
$string = strtr($string, array('@FIELDS@' => '@COLUMNS@'));
}
/* Fetch columns list if required */
if (mb_strpos($string, '@COLUMNS@') !== false) {
$columns_list = $GLOBALS['dbi']->getColumns(
$GLOBALS['db'], $GLOBALS['table']
);
// sometimes the table no longer exists at this point
if (! is_null($columns_list)) {
$column_names = array();
foreach ($columns_list as $column) {
if (! is_null($escape)) {
$column_names[] = self::$escape($column['Field']);
} else {
$column_names[] = $column['Field'];
}
}
$replace['@COLUMNS@'] = implode(',', $column_names);
} else {
$replace['@COLUMNS@'] = '*';
}
}
/* Do the replacement */
return strtr(strftime($string), $replace);
}
/**
* Prepare the form used to browse anywhere on the local server for a file to
* import
*
* @param string $max_upload_size maximum upload size
*
* @return String
*/
public static function getBrowseUploadFileBlock($max_upload_size)
{
$block_html = '';
if ($GLOBALS['is_upload'] && ! empty($GLOBALS['cfg']['UploadDir'])) {
$block_html .= '
';
return $htmlOutput;
}
/**
* find all the possible partial dependencies based on data in the table.
*
* @param string $table current table
* @param string $db current database
*
* @return string HTML containing the list of all the possible partial dependencies
*/
public function findPartialDependencies($table, $db)
{
$dependencyList = [];
$this->dbi->selectDb($db);
$columns = (array) $this->dbi->getColumnNames(
$db,
$table
);
$columns = (array)Util::backquote($columns);
$totalRowsRes = $this->dbi->fetchResult(
'SELECT COUNT(*) FROM (SELECT * FROM '
. Util::backquote($table) . ' LIMIT 500) as dt;'
);
$totalRows = $totalRowsRes[0];
$primary = Index::getPrimary($table, $db);
$primarycols = $primary->getColumns();
$pk = [];
foreach ($primarycols as $col) {
$pk[] = Util::backquote($col->getName());
}
$partialKeys = $this->getAllCombinationPartialKeys($pk);
$distinctValCount = $this->findDistinctValuesCount(
array_unique(
array_merge($columns, $partialKeys)
),
$table
);
foreach ($columns as $column) {
if (!in_array($column, $pk)) {
foreach ($partialKeys as $partialKey) {
if ($partialKey
&& $this->checkPartialDependency(
$partialKey,
$column,
$table,
$distinctValCount[$partialKey],
$distinctValCount[$column],
$totalRows
)
) {
$dependencyList[$partialKey][] = $column;
}
}
}
}
$html = __(
'This list is based on a subset of the table\'s data '
. 'and is not necessarily accurate. '
)
. '