From e03e0c1d60e83e81816ccf9c9fab3cad418f7f40 Mon Sep 17 00:00:00 2001 From: sharvey Date: Tue, 27 Jul 2010 05:13:48 +0000 Subject: [PATCH] MINOR Removed double up of similar logic in InstallRequirements git-svn-id: svn://svn.silverstripe.com/silverstripe/open/phpinstaller/branches/2.4@108569 467b73ca-7a2a-4603-9d3b-597d59a354a9 --- install.php | 15 +++++---------- 1 file changed, 5 insertions(+), 10 deletions(-) diff --git a/install.php b/install.php index 482f962..0e2fd9a 100644 --- a/install.php +++ b/install.php @@ -294,17 +294,15 @@ class InstallRequirements { /** * Find the webserver software running on the PHP host. - * @return string Server software ("Unknown" if not able to find) + * @return string|boolean Server software or boolean FALSE */ function findWebserver() { // Try finding from SERVER_SIGNATURE or SERVER_SOFTWARE $webserver = @$_SERVER['SERVER_SIGNATURE']; if(!$webserver) $webserver = @$_SERVER['SERVER_SOFTWARE']; - // If we still can't find it, this is a completely unknown server - if(!$webserver) $webserver = 'Unknown'; - - return strip_tags(trim($webserver)); + if($webserver) return strip_tags(trim($webserver)); + else return false; } /** @@ -779,12 +777,10 @@ class InstallRequirements { $this->error($testDetails); } } - + function isRunningWebServer($testDetails) { $this->testing($testDetails); - if(function_exists('apache_get_modules') || stristr(@$_SERVER['SERVER_SIGNATURE'], 'Apache')) { - return true; - } elseif(strpos($_SERVER['SERVER_SOFTWARE'], 'IIS/7') !== false) { + if($testDetails[3]) { return true; } else { $this->warning($testDetails); @@ -792,7 +788,6 @@ class InstallRequirements { } } - // Must be PHP4 compatible var $baseDir; function getBaseDir() {