From: Chad Horohoe Date: Sun, 4 Jul 2010 19:41:26 +0000 (+0000) Subject: Add LocalSettings checker thing. Haven't used it in the UI yet and the needsUpgrade... X-Git-Tag: 1.31.0-rc.0~36265 X-Git-Url: http://git.cyclocoop.org/%22.htmlspecialchars%28%24url_syndic%29.%22?a=commitdiff_plain;h=2bf83d65dedd431affb09d46becfb3ef41dd3a9f;p=lhc%2Fweb%2Fwiklou.git Add LocalSettings checker thing. Haven't used it in the UI yet and the needsUpgrade() probably doesn't work right yet :) --- 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.