formatted install.php5 according to SilverStripe coding conventions (tabs instead of spaces, no 1 line if with else, ...)

This commit is contained in:
zauberfisch 2013-10-16 21:11:06 +01:00
parent c4810b8e0f
commit 0b4c3946ff

View File

@ -65,8 +65,7 @@ do {
//break out of BOTH loops because we found the $envFile //break out of BOTH loops because we found the $envFile
break(2); break(2);
} }
} } else {
else {
//break out of the while loop, we can't read the dir //break out of the while loop, we can't read the dir
break; break;
} }
@ -786,8 +785,7 @@ class InstallRequirements {
$pluralWarnings = ($warningRequirements == 1) ? 'Warning' : 'Warnings'; $pluralWarnings = ($warningRequirements == 1) ? 'Warning' : 'Warnings';
$text = $failedRequirements . ' Failed and ' . $warningRequirements . ' ' . $pluralWarnings; $text = $failedRequirements . ' Failed and ' . $warningRequirements . ' ' . $pluralWarnings;
} } else if ($warningRequirements > 0) {
else if($warningRequirements > 0) {
$className = "warning"; $className = "warning";
$text = "All Requirements Pass but " . $warningRequirements . ' ' . $pluralWarnings; $text = "All Requirements Pass but " . $warningRequirements . ' ' . $pluralWarnings;
} }
@ -805,14 +803,18 @@ class InstallRequirements {
if (!function_exists($funcName)) { if (!function_exists($funcName)) {
$this->error($testDetails); $this->error($testDetails);
} else {
return true;
} }
else return true;
} }
function requireClass($className, $testDetails) { function requireClass($className, $testDetails) {
$this->testing($testDetails); $this->testing($testDetails);
if(!class_exists($className)) $this->error($testDetails); if (!class_exists($className)) {
else return false; $this->error($testDetails);
} else {
return false;
}
} }
/** /**
@ -827,8 +829,9 @@ class InstallRequirements {
if ($badClasses) { if ($badClasses) {
$testDetails[2] .= ". The following classes are at fault: " . implode(', ', $badClasses); $testDetails[2] .= ". The following classes are at fault: " . implode(', ', $badClasses);
$this->error($testDetails); $this->error($testDetails);
} else {
return true;
} }
else return true;
} }
function checkApacheVersion($testDetails) { function checkApacheVersion($testDetails) {
@ -1179,6 +1182,7 @@ class InstallRequirements {
// Must be PHP4 compatible // Must be PHP4 compatible
var $baseDir; var $baseDir;
function getBaseDir() { function getBaseDir() {
// Cache the value so that when the installer mucks with SCRIPT_FILENAME half way through, this method // Cache the value so that when the installer mucks with SCRIPT_FILENAME half way through, this method
// still returns the correct value. // still returns the correct value.
@ -1244,6 +1248,7 @@ class Installer extends InstallRequirements {
<div class="inner"> <div class="inner">
<div class="brand"> <div class="brand">
<span class="logo"></span> <span class="logo"></span>
<h1>SilverStripe</h1> <h1>SilverStripe</h1>
</div> </div>
</div> </div>
@ -1255,7 +1260,9 @@ class Installer extends InstallRequirements {
<div class="main"> <div class="main">
<div class="inner"> <div class="inner">
<h2>Installing SilverStripe...</h2> <h2>Installing SilverStripe...</h2>
<p>I am now running through the installation steps (this should take about 30 seconds)</p> <p>I am now running through the installation steps (this should take about 30 seconds)</p>
<p>If you receive a fatal error, refresh this page to continue the installation</p> <p>If you receive a fatal error, refresh this page to continue the installation</p>
<ul> <ul>
<?php <?php