Add LocalSettings checker thing. Haven't used it in the UI yet and the needsUpgrade...
authorChad Horohoe <demon@users.mediawiki.org>
Sun, 4 Jul 2010 19:41:26 +0000 (19:41 +0000)
committerChad Horohoe <demon@users.mediawiki.org>
Sun, 4 Jul 2010 19:41:26 +0000 (19:41 +0000)
includes/installer/Installer.php

index f99b8de..6319428 100644 (file)
@@ -943,6 +943,31 @@ abstract class Installer {
                return $localSettings->writeLocalSettings();
        }
 
+       /**
+        * Determine if LocalSettings exists. If it does, return an appropriate
+        * status for whether we should can upgrade or not
+        * @return Status
+        */
+       function getLocalSettingsStatus() {
+               global $IP;
+
+               $status = Status::newGood();
+
+               wfSuppressWarnings();
+               $ls = file_exists( "$IP/LocalSettings.php" );
+               wfRestoreWarnings();
+               
+               if( $ls ) {
+                       if( $this->parent->getDBInstaller()->needsUpgrade() ) {
+                               $status->warning( 'config-localsettings-upgrade' );
+                       }
+                       else {
+                               $status->fatal( 'config-localsettings-noupgrade' );
+                       }
+               }
+               return $status;
+       }
+
        /**
         * On POSIX systems return the primary group of the webserver we're running under.
         * On other systems just returns null.