Index: trunk/phase3/includes/specials/SpecialVersion.php |
— | — | @@ -104,11 +104,47 @@ |
105 | 105 | global $wgAllowTitlesInSVG, $wgSVGConverter, $wgSVGConverters, $wgSVGConverterPath; |
106 | 106 | $dbr = wfGetDB( DB_SLAVE ); |
107 | 107 | |
| 108 | + // Get the web server name and its version, if applicable |
| 109 | + // Chop off PHP text from the string if it has the text desired |
| 110 | + $serverSoftware = $_SERVER['SERVER_SOFTWARE']; |
| 111 | + if ( strrpos( $serverSoftware, 'PHP' ) === false ) { |
| 112 | + } else { |
| 113 | + $serverSoftware = trim( substr( $serverSoftware, 0, strrpos($serverSoftware,'PHP') - 1 ) ); |
| 114 | + } |
| 115 | + |
| 116 | + // Get the web server name and its version. |
| 117 | + $serverSoftwareLine = explode('/',$serverSoftware); |
| 118 | + $serverSoftwareName = $serverSoftwareLine[0]; |
| 119 | + |
| 120 | + // Insert the website of the web server if applicable. |
| 121 | + if ( stristr( $serverSoftwareName, 'Apache' ) ) |
| 122 | + $serverSoftwareURL = 'http://httpd.apache.org/'; |
| 123 | + else if ( stristr( $serverSoftwareName, 'IIS' ) ) |
| 124 | + $serverSoftwareURL = 'http://www.microsoft.com/iis/'; |
| 125 | + else if ( stristr( $serverSoftwareName, 'Cherokee' ) ) |
| 126 | + $serverSoftwareURL = 'http://www.cherokee-project.com/'; |
| 127 | + else if ( stristr( $serverSoftwareName, 'lighttpd' ) ) |
| 128 | + $serverSoftwareURL = 'http://www.lighttpd.net/'; |
| 129 | + else if ( stristr( $serverSoftwareName, 'Sun' ) ) |
| 130 | + $serverSoftwareURL = 'http://www.sun.com/software/products/web_srvr/'; |
| 131 | + |
| 132 | + // Get the version of the web server. If does not have one, |
| 133 | + // leave it as empty. |
| 134 | + if ( $serverSoftwareLine[1] != '' ) { |
| 135 | + $serverSoftwareVersion = $serverSoftwareLine[1]; |
| 136 | + } else { |
| 137 | + $serverSoftwareVersion = ''; |
| 138 | + } |
| 139 | + |
108 | 140 | // Put the software in an array of form 'name' => 'version'. All messages should |
109 | 141 | // be loaded here, so feel free to use wfMsg*() in the 'name'. Raw HTML or wikimarkup |
110 | 142 | // can be used |
111 | 143 | $software = array(); |
112 | 144 | $software['[http://www.mediawiki.org/ MediaWiki]'] = self::getVersionLinked(); |
| 145 | + if ( isset( $serverSoftwareURL ) ) |
| 146 | + $software["[$serverSoftwareURL $serverSoftwareName]"] = $serverSoftwareVersion; |
| 147 | + else |
| 148 | + $software[$serverSoftwareName] = $serverSoftwareVersion; |
113 | 149 | $software['[http://www.php.net/ PHP]'] = phpversion() . " (" . php_sapi_name() . ")"; |
114 | 150 | $software[$dbr->getSoftwareLink()] = $dbr->getServerVersion(); |
115 | 151 | |
Index: trunk/phase3/RELEASE-NOTES |
— | — | @@ -102,8 +102,8 @@ |
103 | 103 | stripped from them. |
104 | 104 | * Added a PHP port of CDB (constant database), for improved local caching when |
105 | 105 | the DBA extension is not available. |
106 | | -* (bug 14611) Added support showing the version of the image thumbnailing |
107 | | - engine, diff/diff3 engine and TeX engine. |
| 106 | +* (bug 14611) Added support showing the version of the web server, image |
| 107 | + thumbnailing engine, diff/diff3 engine and TeX engine. |
108 | 108 | * Introduced a new system for localisation caching. The system is based around |
109 | 109 | fast fetches of individual messages, minimising memory overhead and startup |
110 | 110 | time in the typical case. The database backend will be used by default, but |