From b1a6a5a3991cec5cd08873b01376e45d0b247f18 Mon Sep 17 00:00:00 2001
From: Marius Cramer <m.cramer@pixcept.de>
Date: Thu, 14 Nov 2013 09:05:33 -0500
Subject: [PATCH] Cleaning up code to match coding guidelines
---
server/scripts/ispconfig_update.php | 76 +++++++++++++++++++-------------------
1 files changed, 38 insertions(+), 38 deletions(-)
diff --git a/server/scripts/ispconfig_update.php b/server/scripts/ispconfig_update.php
index 58d8ef5..6843e7b 100644
--- a/server/scripts/ispconfig_update.php
+++ b/server/scripts/ispconfig_update.php
@@ -29,8 +29,8 @@
*/
function sread() {
- $input = fgets(STDIN);
- return rtrim($input);
+ $input = fgets(STDIN);
+ return rtrim($input);
}
function swrite($text = '') {
@@ -42,53 +42,53 @@
}
function simple_query($query, $answers, $default)
-{
- $finished = false;
- do {
- $answers_str = implode(',', $answers);
- swrite($query.' ('.$answers_str.') ['.$default.']: ');
- $input = sread();
-
- //* Stop the installation
- if($input == 'quit') {
- swriteln("Installation terminated by user.\n");
- die();
- }
-
- //* Select the default
- if($input == '') {
- $answer = $default;
- $finished = true;
- }
-
- //* Set answer id valid
- if(in_array($input, $answers)) {
- $answer = $input;
- $finished = true;
- }
-
- } while ($finished == false);
- swriteln();
- return $answer;
+{
+ $finished = false;
+ do {
+ $answers_str = implode(',', $answers);
+ swrite($query.' ('.$answers_str.') ['.$default.']: ');
+ $input = sread();
+
+ //* Stop the installation
+ if($input == 'quit') {
+ swriteln("Installation terminated by user.\n");
+ die();
+ }
+
+ //* Select the default
+ if($input == '') {
+ $answer = $default;
+ $finished = true;
+ }
+
+ //* Set answer id valid
+ if(in_array($input, $answers)) {
+ $answer = $input;
+ $finished = true;
+ }
+
+ } while ($finished == false);
+ swriteln();
+ return $answer;
}
-require_once('/usr/local/ispconfig/server/lib/config.inc.php');
+require_once '/usr/local/ispconfig/server/lib/config.inc.php';
-echo "\n\n".str_repeat('-',80)."\n";
-echo " _____ ___________ _____ __ _
-|_ _/ ___| ___ \ / __ \ / _(_)
- | | \ `--.| |_/ / | / \/ ___ _ __ | |_ _ __ _
+echo "\n\n".str_repeat('-', 80)."\n";
+echo " _____ ___________ _____ __ _
+|_ _/ ___| ___ \ / __ \ / _(_)
+ | | \ `--.| |_/ / | / \/ ___ _ __ | |_ _ __ _
| | `--. \ __/ | | / _ \| '_ \| _| |/ _` |
_| |_/\__/ / | | \__/\ (_) | | | | | | | (_| |
\___/\____/\_| \____/\___/|_| |_|_| |_|\__, |
__/ |
|___/ ";
-echo "\n".str_repeat('-',80)."\n";
+echo "\n".str_repeat('-', 80)."\n";
echo "\n\n>> Update \n\n";
echo "Please choose the update method. For production systems select 'stable'. \nThe update from svn is only for development systems and may break your current setup.\nNote: Update all slave server, before you update master server.\n\n";
-$method = simple_query('Select update method', array('stable','svn'), 'stable');
+$method = simple_query('Select update method', array('stable', 'svn'), 'stable');
if($method == 'stable') {
$new_version = @file_get_contents('http://www.ispconfig.org/downloads/ispconfig3_version.txt') or die('Unable to retrieve version file.');
@@ -106,4 +106,4 @@
-?>
\ No newline at end of file
+?>
--
Gitblit v1.9.1