From: Shinjiman Date: Mon, 6 Jul 2009 12:08:42 +0000 (+0000) Subject: * (bug 14611) Added support showing the version of the web server which it is current... X-Git-Tag: 1.31.0-rc.0~41095 X-Git-Url: http://git.cyclocoop.org/%28?a=commitdiff_plain;h=ec1ee5e646e57e860b8131f2849726ff2ce15f22;p=lhc%2Fweb%2Fwiklou.git * (bug 14611) Added support showing the version of the web server which it is currently using. --- diff --git a/RELEASE-NOTES b/RELEASE-NOTES index 18088da09e..619738dfe2 100644 --- a/RELEASE-NOTES +++ b/RELEASE-NOTES @@ -102,8 +102,8 @@ it from source control: http://www.mediawiki.org/wiki/Download_from_SVN stripped from them. * Added a PHP port of CDB (constant database), for improved local caching when the DBA extension is not available. -* (bug 14611) Added support showing the version of the image thumbnailing - engine, diff/diff3 engine and TeX engine. +* (bug 14611) Added support showing the version of the web server, image + thumbnailing engine, diff/diff3 engine and TeX engine. * Introduced a new system for localisation caching. The system is based around fast fetches of individual messages, minimising memory overhead and startup time in the typical case. The database backend will be used by default, but diff --git a/includes/specials/SpecialVersion.php b/includes/specials/SpecialVersion.php index 9c6748365d..da0ec1c765 100644 --- a/includes/specials/SpecialVersion.php +++ b/includes/specials/SpecialVersion.php @@ -104,11 +104,47 @@ class SpecialVersion extends SpecialPage { global $wgAllowTitlesInSVG, $wgSVGConverter, $wgSVGConverters, $wgSVGConverterPath; $dbr = wfGetDB( DB_SLAVE ); + // Get the web server name and its version, if applicable + // Chop off PHP text from the string if it has the text desired + $serverSoftware = $_SERVER['SERVER_SOFTWARE']; + if ( strrpos( $serverSoftware, 'PHP' ) === false ) { + } else { + $serverSoftware = trim( substr( $serverSoftware, 0, strrpos($serverSoftware,'PHP') - 1 ) ); + } + + // Get the web server name and its version. + $serverSoftwareLine = explode('/',$serverSoftware); + $serverSoftwareName = $serverSoftwareLine[0]; + + // Insert the website of the web server if applicable. + if ( stristr( $serverSoftwareName, 'Apache' ) ) + $serverSoftwareURL = 'http://httpd.apache.org/'; + else if ( stristr( $serverSoftwareName, 'IIS' ) ) + $serverSoftwareURL = 'http://www.microsoft.com/iis/'; + else if ( stristr( $serverSoftwareName, 'Cherokee' ) ) + $serverSoftwareURL = 'http://www.cherokee-project.com/'; + else if ( stristr( $serverSoftwareName, 'lighttpd' ) ) + $serverSoftwareURL = 'http://www.lighttpd.net/'; + else if ( stristr( $serverSoftwareName, 'Sun' ) ) + $serverSoftwareURL = 'http://www.sun.com/software/products/web_srvr/'; + + // Get the version of the web server. If does not have one, + // leave it as empty. + if ( $serverSoftwareLine[1] != '' ) { + $serverSoftwareVersion = $serverSoftwareLine[1]; + } else { + $serverSoftwareVersion = ''; + } + // Put the software in an array of form 'name' => 'version'. All messages should // be loaded here, so feel free to use wfMsg*() in the 'name'. Raw HTML or wikimarkup // can be used $software = array(); $software['[http://www.mediawiki.org/ MediaWiki]'] = self::getVersionLinked(); + if ( isset( $serverSoftwareURL ) ) + $software["[$serverSoftwareURL $serverSoftwareName]"] = $serverSoftwareVersion; + else + $software[$serverSoftwareName] = $serverSoftwareVersion; $software['[http://www.php.net/ PHP]'] = phpversion() . " (" . php_sapi_name() . ")"; $software[$dbr->getSoftwareLink()] = $dbr->getServerVersion();