From 2bf83d65dedd431affb09d46becfb3ef41dd3a9f Mon Sep 17 00:00:00 2001 From: Chad Horohoe Date: Sun, 4 Jul 2010 19:41:26 +0000 Subject: [PATCH] Add LocalSettings checker thing. Haven't used it in the UI yet and the needsUpgrade() probably doesn't work right yet :) --- includes/installer/Installer.php | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) diff --git a/includes/installer/Installer.php b/includes/installer/Installer.php index f99b8deea2..6319428fa7 100644 --- a/includes/installer/Installer.php +++ b/includes/installer/Installer.php @@ -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. -- 2.20.1