r69012 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r69011‎ | r69012 | r69013 >
Date:19:41, 4 July 2010
Author:demon
Status:ok
Tags:
Comment:
Add LocalSettings checker thing. Haven't used it in the UI yet and the needsUpgrade() probably doesn't work right yet :)
Modified paths:
  • /trunk/phase3/includes/installer/Installer.php (modified) (history)

Diff [purge]

Index: trunk/phase3/includes/installer/Installer.php
@@ -944,6 +944,31 @@
945945 }
946946
947947 /**
 948+ * Determine if LocalSettings exists. If it does, return an appropriate
 949+ * status for whether we should can upgrade or not
 950+ * @return Status
 951+ */
 952+ function getLocalSettingsStatus() {
 953+ global $IP;
 954+
 955+ $status = Status::newGood();
 956+
 957+ wfSuppressWarnings();
 958+ $ls = file_exists( "$IP/LocalSettings.php" );
 959+ wfRestoreWarnings();
 960+
 961+ if( $ls ) {
 962+ if( $this->parent->getDBInstaller()->needsUpgrade() ) {
 963+ $status->warning( 'config-localsettings-upgrade' );
 964+ }
 965+ else {
 966+ $status->fatal( 'config-localsettings-noupgrade' );
 967+ }
 968+ }
 969+ return $status;
 970+ }
 971+
 972+ /**
948973 * On POSIX systems return the primary group of the webserver we're running under.
949974 * On other systems just returns null.
950975 *

Status & tagging log