r57624 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r57623‎ | r57624 | r57625 >
Date:19:39, 10 October 2009
Author:demon
Status:reverted
Tags:
Comment:
Have installer check for latest version and show info if not latest
Modified paths:
  • /branches/new-installer/phase3/includes/installer/Installer.php (modified) (history)
  • /branches/new-installer/phase3/languages/messages/MessagesEn.php (modified) (history)
  • /branches/new-installer/phase3/maintenance/language/messages.inc (modified) (history)

Diff [purge]

Index: branches/new-installer/phase3/maintenance/language/messages.inc
@@ -3105,6 +3105,9 @@
31063106 'config-env-good',
31073107 'config-env-bad',
31083108 'config-env-php',
 3109+ 'config-env-latest-ok',
 3110+ 'config-env-latest-old',
 3111+ 'config-env-latest-help',
31093112 'config-no-db',
31103113 'config-no-db-help',
31113114 'config-have-db',
Index: branches/new-installer/phase3/includes/installer/Installer.php
@@ -96,6 +96,7 @@
9797 * @protected
9898 */
9999 var $envChecks = array(
 100+ 'envLatestVersion',
100101 'envCheckDB',
101102 'envCheckRegisterGlobals',
102103 'envCheckMagicQuotes',
@@ -312,6 +313,25 @@
313314 && wfIniGetBool( 'enable_dl' )
314315 && !wfIniGetBool( 'safe_mode' );
315316 }
 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+ }
316336
317337 /** Environment check for DB types */
318338 function envCheckDB() {
Index: branches/new-installer/phase3/languages/messages/MessagesEn.php
@@ -4072,6 +4072,10 @@
40734073 * [http://www.mediawiki.org/wiki/Manual:Contents Administrator's Guide]
40744074 * [http://www.mediawiki.org/wiki/Manual:FAQ FAQ]
40754075 ",
 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]',
40764080 'config-env-good' => '<span class="success-message">Environment checked. You can install MediaWiki.</span>',
40774081 'config-env-bad' => 'Cannot install MediaWiki.',
40784082 'config-env-php' => 'PHP $1 installed',

Follow-up revisions

RevisionCommit summaryAuthorDate
r77883Remove "checking for latest version" feature from the new installer. Original...demon15:32, 6 December 2010

Status & tagging log