Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/phpmyadmin/phpmyadmin.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/setup
diff options
context:
space:
mode:
authorMadhura Jayaratne <madhura.cj@gmail.com>2013-11-03 17:30:41 +0400
committerMadhura Jayaratne <madhura.cj@gmail.com>2013-11-03 17:30:41 +0400
commit184316d891816c15abc3a077e6f2942de147f44e (patch)
tree82b5233d181b02657347961b3552954595115251 /setup
parentd64ea21bed870cab7673025fccbf1c3c6a16a20f (diff)
Coding style fixes
Diffstat (limited to 'setup')
-rw-r--r--setup/config.php5
-rw-r--r--setup/lib/ConfigGenerator.class.php18
2 files changed, 17 insertions, 6 deletions
diff --git a/setup/config.php b/setup/config.php
index 9074ebe5ac..ffe65915ed 100644
--- a/setup/config.php
+++ b/setup/config.php
@@ -45,7 +45,10 @@ if (PMA_ifSetOr($_POST['submit_clear'], '')) {
//
// Save generated config file on the server
//
- file_put_contents($config_file_path, ConfigGenerator::getConfigFile($GLOBALS['ConfigFile']));
+ file_put_contents(
+ $config_file_path,
+ ConfigGenerator::getConfigFile($GLOBALS['ConfigFile'])
+ );
header('HTTP/1.1 303 See Other');
header('Location: index.php?action_done=config_saved');
exit;
diff --git a/setup/lib/ConfigGenerator.class.php b/setup/lib/ConfigGenerator.class.php
index d734cbc755..279c071ac0 100644
--- a/setup/lib/ConfigGenerator.class.php
+++ b/setup/lib/ConfigGenerator.class.php
@@ -17,11 +17,14 @@ class ConfigGenerator
* Creates config file
*
* @param ConfigFile $cf Config file instance
+ *
* @return string
*/
public static function getConfigFile(ConfigFile $cf)
{
- $crlf = (isset($_SESSION['eol']) && $_SESSION['eol'] == 'win') ? "\r\n" : "\n";
+ $crlf = (isset($_SESSION['eol']) && $_SESSION['eol'] == 'win')
+ ? "\r\n"
+ : "\n";
$c = $cf->getConfig();
// header
@@ -38,7 +41,9 @@ class ConfigGenerator
if ($cf->getServerCount() > 0) {
$ret .= "/* Servers configuration */$crlf\$i = 0;" . $crlf . $crlf;
foreach ($c['Servers'] as $id => $server) {
- $ret .= '/* Server: ' . strtr($cf->getServerName($id) . " [$id] ", '*/', '-') . "*/" . $crlf
+ $ret .= '/* Server: '
+ . strtr($cf->getServerName($id) . " [$id] ", '*/', '-')
+ . "*/" . $crlf
. '$i++;' . $crlf;
foreach ($server as $k => $v) {
$k = preg_replace('/[^A-Za-z0-9_]/', '_', $k);
@@ -88,17 +93,20 @@ class ConfigGenerator
private static function _getVarExport($var_name, $var_value, $crlf)
{
if (!is_array($var_value) || empty($var_value)) {
- return "\$cfg['$var_name'] = " . var_export($var_value, true) . ';' . $crlf;
+ return "\$cfg['$var_name'] = "
+ . var_export($var_value, true) . ';' . $crlf;
}
$ret = '';
if (self::_isZeroBasedArray($var_value)) {
- $ret = "\$cfg['$var_name'] = " . self::_exportZeroBasedArray($var_value, $crlf)
+ $ret = "\$cfg['$var_name'] = "
+ . self::_exportZeroBasedArray($var_value, $crlf)
. ';' . $crlf;
} else {
// string keys: $cfg[key][subkey] = value
foreach ($var_value as $k => $v) {
$k = preg_replace('/[^A-Za-z0-9_]/', '_', $k);
- $ret .= "\$cfg['$var_name']['$k'] = " . var_export($v, true) . ';' . $crlf;
+ $ret .= "\$cfg['$var_name']['$k'] = "
+ . var_export($v, true) . ';' . $crlf;
}
}
return $ret;