Index: branches/new-installer/phase3/maintenance/language/messages.inc |
— | — | @@ -3105,6 +3105,9 @@ |
3106 | 3106 | 'config-env-good', |
3107 | 3107 | 'config-env-bad', |
3108 | 3108 | 'config-env-php', |
| 3109 | + 'config-env-latest-ok', |
| 3110 | + 'config-env-latest-old', |
| 3111 | + 'config-env-latest-help', |
3109 | 3112 | 'config-no-db', |
3110 | 3113 | 'config-no-db-help', |
3111 | 3114 | 'config-have-db', |
Index: branches/new-installer/phase3/includes/installer/Installer.php |
— | — | @@ -96,6 +96,7 @@ |
97 | 97 | * @protected |
98 | 98 | */ |
99 | 99 | var $envChecks = array( |
| 100 | + 'envLatestVersion', |
100 | 101 | 'envCheckDB', |
101 | 102 | 'envCheckRegisterGlobals', |
102 | 103 | 'envCheckMagicQuotes', |
— | — | @@ -312,6 +313,25 @@ |
313 | 314 | && wfIniGetBool( 'enable_dl' ) |
314 | 315 | && !wfIniGetBool( 'safe_mode' ); |
315 | 316 | } |
| 317 | + |
| 318 | + /** Check if we're installing the latest version */ |
| 319 | + function envLatestVersion() { |
| 320 | + global $wgVersion; |
| 321 | + $latestInfo = Http::get( 'http://www.mediawiki.org/w/api.php?action=mwreleases&format=php' ); |
| 322 | + if( !$latestInfo ) { |
| 323 | + return; |
| 324 | + } |
| 325 | + $latestInfo = unserialize($latestInfo); |
| 326 | + foreach( $latestInfo['mwreleases'] as $rel ) { |
| 327 | + if( isset( $rel['current'] ) ) |
| 328 | + $currentVersion = $rel['version']; |
| 329 | + } |
| 330 | + if( version_compare( $wgVersion, $currentVersion, '<' ) ) { |
| 331 | + $this->showMessage( 'config-env-latest-old' ); |
| 332 | + $this->showHelpBox( 'config-env-latest-help', $wgVersion, $currentVersion ); |
| 333 | + } |
| 334 | + $this->showMessage( 'config-env-latest-ok' ); |
| 335 | + } |
316 | 336 | |
317 | 337 | /** Environment check for DB types */ |
318 | 338 | function envCheckDB() { |
Index: branches/new-installer/phase3/languages/messages/MessagesEn.php |
— | — | @@ -4072,6 +4072,10 @@ |
4073 | 4073 | * [http://www.mediawiki.org/wiki/Manual:Contents Administrator's Guide] |
4074 | 4074 | * [http://www.mediawiki.org/wiki/Manual:FAQ FAQ] |
4075 | 4075 | ", |
| 4076 | +'config-env-latest-ok' => 'You are installing the latest version of Mediawiki', |
| 4077 | +'config-env-latest-old' => "'''Warning''': You are installing an outdated version of Mediawiki", |
| 4078 | +'config-env-latest-help' => 'You are installing version $1, but the latest version is $2. |
| 4079 | +You are advised to use the latest release, which can be downloaded from [http://www.mediawiki.org/wiki/Download Mediawiki.org]', |
4076 | 4080 | 'config-env-good' => '<span class="success-message">Environment checked. You can install MediaWiki.</span>', |
4077 | 4081 | 'config-env-bad' => 'Cannot install MediaWiki.', |
4078 | 4082 | 'config-env-php' => 'PHP $1 installed', |