Make PHPCS happy.
Signed-off-by: Hugues Peccatte <hugues.peccatte@gmail.com>
This commit is contained in:
parent
1daf0a030f
commit
bf61709259
72
export.php
72
export.php
@ -454,9 +454,10 @@ if (!defined('TESTSUITE')) {
|
||||
PMA_lockTables($db, $tables, "READ");
|
||||
try {
|
||||
PMA_exportDatabase(
|
||||
$db, $tables, $whatStrucOrData, $table_structure, $table_data,
|
||||
$export_plugin, $crlf, $err_url, $export_type, $do_relation,
|
||||
$do_comments, $do_mime, $do_dates, $aliases, $separate_files
|
||||
$db, $tables, $whatStrucOrData, $table_structure,
|
||||
$table_data, $export_plugin, $crlf, $err_url, $export_type,
|
||||
$do_relation, $do_comments, $do_mime, $do_dates, $aliases,
|
||||
$separate_files
|
||||
);
|
||||
PMA_unlockTables();
|
||||
} catch (Exception $e) { // TODO use finally when PHP version is 5.5
|
||||
@ -518,38 +519,39 @@ if (!defined('TESTSUITE')) {
|
||||
/**
|
||||
* Send the dump as a file...
|
||||
*/
|
||||
if (! empty($asfile)) {
|
||||
// Convert the charset if required.
|
||||
if ($output_charset_conversion) {
|
||||
$dump_buffer = PMA_convertString(
|
||||
'utf-8',
|
||||
$GLOBALS['charset'],
|
||||
$dump_buffer
|
||||
);
|
||||
}
|
||||
|
||||
// Compression needed?
|
||||
if ($compression) {
|
||||
if (! empty($separate_files)) {
|
||||
$dump_buffer
|
||||
= PMA_compressExport($dump_buffer_objects, $compression, $filename);
|
||||
} else {
|
||||
$dump_buffer
|
||||
= PMA_compressExport($dump_buffer, $compression, $filename);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/* If we saved on server, we have to close file now */
|
||||
if ($save_on_server) {
|
||||
$message = PMA_closeExportFile(
|
||||
$file_handle, $dump_buffer, $save_filename
|
||||
);
|
||||
PMA_showExportPage($db, $table, $export_type);
|
||||
} else {
|
||||
echo $dump_buffer;
|
||||
}
|
||||
} else {
|
||||
if (empty($asfile)) {
|
||||
echo PMA_getHtmlForDisplayedExportFooter($back_button);
|
||||
return;
|
||||
} // end if
|
||||
|
||||
// Convert the charset if required.
|
||||
if ($output_charset_conversion) {
|
||||
$dump_buffer = PMA_convertString(
|
||||
'utf-8',
|
||||
$GLOBALS['charset'],
|
||||
$dump_buffer
|
||||
);
|
||||
}
|
||||
|
||||
// Compression needed?
|
||||
if ($compression) {
|
||||
if (! empty($separate_files)) {
|
||||
$dump_buffer = PMA_compressExport(
|
||||
$dump_buffer_objects, $compression, $filename
|
||||
);
|
||||
} else {
|
||||
$dump_buffer = PMA_compressExport($dump_buffer, $compression, $filename);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/* If we saved on server, we have to close file now */
|
||||
if ($save_on_server) {
|
||||
$message = PMA_closeExportFile(
|
||||
$file_handle, $dump_buffer, $save_filename
|
||||
);
|
||||
PMA_showExportPage($db, $table, $export_type);
|
||||
} else {
|
||||
echo $dump_buffer;
|
||||
}
|
||||
}
|
||||
|
||||
@ -88,9 +88,11 @@ $visualizationSettings = array(
|
||||
'spatialColumn' => 'wkt'
|
||||
);
|
||||
$data = array(array('wkt' => $wkt_with_zero, 'srid' => $srid));
|
||||
$visualization = PMA_GIS_Visualization::getByData($data, $visualizationSettings)->toImage($format);
|
||||
$visualization = PMA_GIS_Visualization::getByData($data, $visualizationSettings)
|
||||
->toImage($format);
|
||||
|
||||
$open_layers = PMA_GIS_Visualization::getByData($data, $visualizationSettings)->asOl();
|
||||
$open_layers = PMA_GIS_Visualization::getByData($data, $visualizationSettings)
|
||||
->asOl();
|
||||
|
||||
// If the call is to update the WKT and visualization make an AJAX response
|
||||
if (isset($_REQUEST['generate']) && $_REQUEST['generate'] == true) {
|
||||
|
||||
45
import.php
45
import.php
@ -184,7 +184,10 @@ if (! empty($sql_query)) {
|
||||
// upload limit has been reached, let's assume the second possibility.
|
||||
if ($_POST == array() && $_GET == array()) {
|
||||
$message = PMA_Message::error(
|
||||
__('You probably tried to upload a file that is too large. Please refer to %sdocumentation%s for a workaround for this limit.')
|
||||
__(
|
||||
'You probably tried to upload a file that is too large. Please refer ' .
|
||||
'to %sdocumentation%s for a workaround for this limit.'
|
||||
)
|
||||
);
|
||||
$message->addParam('[doc@faq1-16]');
|
||||
$message->addParam('[/doc]');
|
||||
@ -471,7 +474,11 @@ if ($import_file != 'none' && ! $error) {
|
||||
// instead.
|
||||
|
||||
$message = PMA_Message::error(
|
||||
__('Uploaded file cannot be moved, because the server has open_basedir enabled without access to the %s directory (for temporary files).')
|
||||
__(
|
||||
'Uploaded file cannot be moved, because the server has ' .
|
||||
'open_basedir enabled without access to the %s directory ' .
|
||||
'(for temporary files).'
|
||||
)
|
||||
);
|
||||
$message->addParam($tmp_subdir);
|
||||
PMA_stopImport($message);
|
||||
@ -494,7 +501,11 @@ if ($import_file != 'none' && ! $error) {
|
||||
$import_handle = @bzopen($import_file, 'r');
|
||||
} else {
|
||||
$message = PMA_Message::error(
|
||||
__('You attempted to load file with unsupported compression (%s). Either support for it is not implemented or disabled by your configuration.')
|
||||
__(
|
||||
'You attempted to load file with unsupported compression ' .
|
||||
'(%s). Either support for it is not implemented or disabled ' .
|
||||
'by your configuration.'
|
||||
)
|
||||
);
|
||||
$message->addParam($compression);
|
||||
PMA_stopImport($message);
|
||||
@ -505,7 +516,11 @@ if ($import_file != 'none' && ! $error) {
|
||||
$import_handle = @gzopen($import_file, 'r');
|
||||
} else {
|
||||
$message = PMA_Message::error(
|
||||
__('You attempted to load file with unsupported compression (%s). Either support for it is not implemented or disabled by your configuration.')
|
||||
__(
|
||||
'You attempted to load file with unsupported compression ' .
|
||||
'(%s). Either support for it is not implemented or disabled ' .
|
||||
'by your configuration.'
|
||||
)
|
||||
);
|
||||
$message->addParam($compression);
|
||||
PMA_stopImport($message);
|
||||
@ -526,7 +541,11 @@ if ($import_file != 'none' && ! $error) {
|
||||
}
|
||||
} else {
|
||||
$message = PMA_Message::error(
|
||||
__('You attempted to load file with unsupported compression (%s). Either support for it is not implemented or disabled by your configuration.')
|
||||
__(
|
||||
'You attempted to load file with unsupported compression ' .
|
||||
'(%s). Either support for it is not implemented or disabled ' .
|
||||
'by your configuration.'
|
||||
)
|
||||
);
|
||||
$message->addParam($compression);
|
||||
PMA_stopImport($message);
|
||||
@ -537,7 +556,11 @@ if ($import_file != 'none' && ! $error) {
|
||||
break;
|
||||
default:
|
||||
$message = PMA_Message::error(
|
||||
__('You attempted to load file with unsupported compression (%s). Either support for it is not implemented or disabled by your configuration.')
|
||||
__(
|
||||
'You attempted to load file with unsupported compression (%s). ' .
|
||||
'Either support for it is not implemented or disabled by your ' .
|
||||
'configuration.'
|
||||
)
|
||||
);
|
||||
$message->addParam($compression);
|
||||
PMA_stopImport($message);
|
||||
@ -551,7 +574,11 @@ if ($import_file != 'none' && ! $error) {
|
||||
} elseif (! $error) {
|
||||
if (! isset($import_text) || empty($import_text)) {
|
||||
$message = PMA_Message::error(
|
||||
__('No data was received to import. Either no file name was submitted, or the file size exceeded the maximum size permitted by your PHP configuration. See [doc@faq1-16]FAQ 1.16[/doc].')
|
||||
__(
|
||||
'No data was received to import. Either no file name was ' .
|
||||
'submitted, or the file size exceeded the maximum size permitted ' .
|
||||
'by your PHP configuration. See [doc@faq1-16]FAQ 1.16[/doc].'
|
||||
)
|
||||
);
|
||||
PMA_stopImport($message);
|
||||
}
|
||||
@ -683,7 +710,9 @@ if (! empty($id_bookmark) && $_REQUEST['action_bookmark'] == 2) {
|
||||
|
||||
// Did we hit timeout? Tell it user.
|
||||
if ($timeout_passed) {
|
||||
$importUrl = $err_url .= '&timeout_passed=1&offset=' . urlencode($GLOBALS['offset']);
|
||||
$importUrl = $err_url .= '&timeout_passed=1&offset=' . urlencode(
|
||||
$GLOBALS['offset']
|
||||
);
|
||||
if (isset($local_import_file)) {
|
||||
$importUrl .= '&local_import_file=' . urlencode($local_import_file);
|
||||
}
|
||||
|
||||
36
index.php
36
index.php
@ -496,7 +496,13 @@ if ($cfg['LoginCookieValidityDisableWarning'] == false) {
|
||||
$gc_time = (int)@ini_get('session.gc_maxlifetime');
|
||||
if ($gc_time < $GLOBALS['cfg']['LoginCookieValidity'] ) {
|
||||
trigger_error(
|
||||
__('Your PHP parameter [a@http://php.net/manual/en/session.configuration.php#ini.session.gc-maxlifetime@_blank]session.gc_maxlifetime[/a] is lower than cookie validity configured in phpMyAdmin, because of this, your login might expire sooner than configured in phpMyAdmin.'),
|
||||
__(
|
||||
'Your PHP parameter [a@http://php.net/manual/en/session.' .
|
||||
'configuration.php#ini.session.gc-maxlifetime@_blank]session.' .
|
||||
'gc_maxlifetime[/a] is lower than cookie validity configured ' .
|
||||
'in phpMyAdmin, because of this, your login might expire sooner ' .
|
||||
'than configured in phpMyAdmin.'
|
||||
),
|
||||
E_USER_WARNING
|
||||
);
|
||||
}
|
||||
@ -509,7 +515,11 @@ if ($GLOBALS['cfg']['LoginCookieStore'] != 0
|
||||
&& $GLOBALS['cfg']['LoginCookieStore'] < $GLOBALS['cfg']['LoginCookieValidity']
|
||||
) {
|
||||
trigger_error(
|
||||
__('Login cookie store is lower than cookie validity configured in phpMyAdmin, because of this, your login will expire sooner than configured in phpMyAdmin.'),
|
||||
__(
|
||||
'Login cookie store is lower than cookie validity configured in ' .
|
||||
'phpMyAdmin, because of this, your login will expire sooner than ' .
|
||||
'configured in phpMyAdmin.'
|
||||
),
|
||||
E_USER_WARNING
|
||||
);
|
||||
}
|
||||
@ -521,7 +531,9 @@ if (! empty($_SESSION['encryption_key'])
|
||||
&& empty($GLOBALS['cfg']['blowfish_secret'])
|
||||
) {
|
||||
trigger_error(
|
||||
__('The configuration file now needs a secret passphrase (blowfish_secret).'),
|
||||
__(
|
||||
'The configuration file now needs a secret passphrase (blowfish_secret).'
|
||||
),
|
||||
E_USER_WARNING
|
||||
);
|
||||
}
|
||||
@ -532,7 +544,13 @@ if (! empty($_SESSION['encryption_key'])
|
||||
*/
|
||||
if (file_exists('config')) {
|
||||
trigger_error(
|
||||
__('Directory [code]config[/code], which is used by the setup script, still exists in your phpMyAdmin directory. It is strongly recommended to remove it once phpMyAdmin has been configured. Otherwise the security of your server may be compromised by unauthorized people downloading your configuration.'),
|
||||
__(
|
||||
'Directory [code]config[/code], which is used by the setup script, ' .
|
||||
'still exists in your phpMyAdmin directory. It is strongly ' .
|
||||
'recommended to remove it once phpMyAdmin has been configured. ' .
|
||||
'Otherwise the security of your server may be compromised by ' .
|
||||
'unauthorized people downloading your configuration.'
|
||||
),
|
||||
E_USER_WARNING
|
||||
);
|
||||
}
|
||||
@ -598,7 +616,10 @@ if (isset($GLOBALS['dbi'])
|
||||
trigger_error(
|
||||
PMA_sanitize(
|
||||
sprintf(
|
||||
__('Your PHP MySQL library version %s differs from your MySQL server version %s. This may cause unpredictable behavior.'),
|
||||
__(
|
||||
'Your PHP MySQL library version %s differs from your ' .
|
||||
'MySQL server version %s. This may cause unpredictable behavior.'
|
||||
),
|
||||
$_client_info,
|
||||
substr(
|
||||
PMA_MYSQL_STR_VERSION,
|
||||
@ -622,7 +643,10 @@ if ($cfg['SuhosinDisableWarning'] == false
|
||||
) {
|
||||
trigger_error(
|
||||
sprintf(
|
||||
__('Server running with Suhosin. Please refer to %sdocumentation%s for possible issues.'),
|
||||
__(
|
||||
'Server running with Suhosin. Please refer to %sdocumentation%s ' .
|
||||
'for possible issues.'
|
||||
),
|
||||
'[doc@faq1-38]',
|
||||
'[/doc]'
|
||||
),
|
||||
|
||||
@ -25,5 +25,10 @@ $filename = LICENSE_FILE;
|
||||
if (is_readable($filename)) {
|
||||
readfile($filename);
|
||||
} else {
|
||||
printf(__('The %s file is not available on this system, please visit www.phpmyadmin.net for more information.'), $filename);
|
||||
printf(
|
||||
__(
|
||||
'The %s file is not available on this system, please visit ' .
|
||||
'www.phpmyadmin.net for more information.'
|
||||
), $filename
|
||||
);
|
||||
}
|
||||
|
||||
@ -84,7 +84,9 @@ if ($form_display->hasErrors()) {
|
||||
// form has errors
|
||||
?>
|
||||
<div class="error config-form">
|
||||
<b><?php echo __('Cannot save settings, submitted form contains errors!') ?></b>
|
||||
<b>
|
||||
<?php echo __('Cannot save settings, submitted form contains errors!') ?>
|
||||
</b>
|
||||
<?php echo $form_display->displayErrors(); ?>
|
||||
</div>
|
||||
<?php
|
||||
|
||||
@ -13,7 +13,9 @@ require_once 'libraries/controllers/TableChartController.class.php';
|
||||
|
||||
$container = DI\Container::getDefaultContainer();
|
||||
$container->factory('PMA\Controllers\Table\TableChartController');
|
||||
$container->alias('TableChartController', 'PMA\Controllers\Table\TableChartController');
|
||||
$container->alias(
|
||||
'TableChartController', 'PMA\Controllers\Table\TableChartController'
|
||||
);
|
||||
|
||||
/* Define dependencies for the concerned controller */
|
||||
$dependency_definitions = array(
|
||||
|
||||
@ -81,7 +81,9 @@ if (isset($_REQUEST['templateAction']) && $cfgRelation['exporttemplateswork']) {
|
||||
);
|
||||
} elseif ('load' == $_REQUEST['templateAction']) {
|
||||
$data = null;
|
||||
while ($row = $GLOBALS['dbi']->fetchAssoc($result, $GLOBALS['controllink'])) {
|
||||
while ($row = $GLOBALS['dbi']->fetchAssoc(
|
||||
$result, $GLOBALS['controllink']
|
||||
)) {
|
||||
$data = $row['template_data'];
|
||||
}
|
||||
$response->addJSON('data', $data);
|
||||
@ -138,8 +140,16 @@ if (! empty($sql_query)) {
|
||||
|
||||
// Rebuilding the SELECT and FROM clauses.
|
||||
$replaces = array(
|
||||
array('SELECT', 'SELECT ' . SqlParser\Components\ExpressionArray::build($parser->statements[0]->expr)),
|
||||
array('FROM', 'FROM ' . SqlParser\Components\ExpressionArray::build($parser->statements[0]->from)),
|
||||
array(
|
||||
'SELECT', 'SELECT ' . SqlParser\Components\ExpressionArray::build(
|
||||
$parser->statements[0]->expr
|
||||
),
|
||||
),
|
||||
array(
|
||||
'FROM', 'FROM ' . SqlParser\Components\ExpressionArray::build(
|
||||
$parser->statements[0]->from
|
||||
),
|
||||
),
|
||||
);
|
||||
|
||||
// Checking if the WHERE clause has to be replaced.
|
||||
|
||||
@ -40,7 +40,9 @@ $result = $GLOBALS['dbi']->fetchValue($sql);
|
||||
|
||||
/* Check return code */
|
||||
if ($result === false) {
|
||||
PMA_Util::mysqlDie(__('MySQL returned an empty result set (i.e. zero rows).'), $sql);
|
||||
PMA_Util::mysqlDie(
|
||||
__('MySQL returned an empty result set (i.e. zero rows).'), $sql
|
||||
);
|
||||
}
|
||||
|
||||
/* Avoid corrupting data */
|
||||
|
||||
@ -16,17 +16,24 @@ require_once 'libraries/Util.class.php';
|
||||
|
||||
$container = DI\Container::getDefaultContainer();
|
||||
$container->factory('PMA\Controllers\Table\TableGisVisualizationController');
|
||||
$container->alias('TableGisVisualizationController', 'PMA\Controllers\Table\TableGisVisualizationController');
|
||||
$container->alias(
|
||||
'TableGisVisualizationController',
|
||||
'PMA\Controllers\Table\TableGisVisualizationController'
|
||||
);
|
||||
|
||||
/* Define dependencies for the concerned controller */
|
||||
$dependency_definitions = array(
|
||||
"sql_query" => &$GLOBALS['sql_query'],
|
||||
"url_params" => &$GLOBALS['url_params'],
|
||||
"goto" => PMA_Util::getScriptNameForOption($GLOBALS['cfg']['DefaultTabDatabase'], 'database'),
|
||||
"goto" => PMA_Util::getScriptNameForOption(
|
||||
$GLOBALS['cfg']['DefaultTabDatabase'], 'database'
|
||||
),
|
||||
"back" => 'sql.php',
|
||||
"visualizationSettings" => array()
|
||||
);
|
||||
|
||||
/** @var Controllers\Table\TableGisVisualizationController $controller */
|
||||
$controller = $container->get('TableGisVisualizationController', $dependency_definitions);
|
||||
$controller = $container->get(
|
||||
'TableGisVisualizationController', $dependency_definitions
|
||||
);
|
||||
$controller->indexAction();
|
||||
|
||||
@ -16,7 +16,9 @@ require_once 'libraries/Index.class.php';
|
||||
|
||||
$container = DI\Container::getDefaultContainer();
|
||||
$container->factory('PMA\Controllers\Table\TableIndexesController');
|
||||
$container->alias('TableIndexesController', 'PMA\Controllers\Table\TableIndexesController');
|
||||
$container->alias(
|
||||
'TableIndexesController', 'PMA\Controllers\Table\TableIndexesController'
|
||||
);
|
||||
|
||||
/* Define dependencies for the concerned controller */
|
||||
$db = $container->get('db');
|
||||
|
||||
Loading…
Reference in New Issue
Block a user