BUGFIX Sometimes SERVER_SIGNATURE isn't populated in PHP, so fall back to using SERVER_SOFTWARE to detect the webserver during SS install

git-svn-id: svn://svn.silverstripe.com/silverstripe/open/phpinstaller/branches/2.4@93113 467b73ca-7a2a-4603-9d3b-597d59a354a9
This commit is contained in:
sharvey 2009-11-23 20:34:06 +00:00 committed by Sam Minnee
parent adfb282212
commit 966fdf484d

View File

@ -231,9 +231,11 @@ class InstallRequirements {
if(!isset($_SERVER['argv']) || !$_SERVER['argv']) {
$webserver = strip_tags(trim($_SERVER['SERVER_SIGNATURE']));
if(!$webserver) {
if(isset($_SERVER['SERVER_SOFTWARE']) && strpos($_SERVER['SERVER_SOFTWARE'], 'IIS') !== false) {
$pieces = explode('-', $_SERVER['SERVER_SOFTWARE']);
if(isset($pieces[1])) $webserver = $pieces[1];
if(isset($_SERVER['SERVER_SOFTWARE'])) {
if(strpos($_SERVER['SERVER_SOFTWARE'], 'IIS') !== false ||
strpos($_SERVER['SERVER_SOFTWARE'], 'Apache') !== false) {
$webserver = $_SERVER['SERVER_SOFTWARE'];
}
} else {
$webserver = "I can't tell what webserver you are running";
}