From: Kunal Mehta Date: Wed, 6 Aug 2014 15:22:35 +0000 (+0100) Subject: SpecialUnlockdb: Use Config instead of globals X-Git-Tag: 1.31.0-rc.0~14571^2 X-Git-Url: http://git.cyclocoop.org/%22%20.%20generer_url_ecrire%28%22brouteur%22%2C%28%24id_rubrique%20?a=commitdiff_plain;h=c06f1e742bc70fff88ad024f1d24d3a9cdb8b24e;p=lhc%2Fweb%2Fwiklou.git SpecialUnlockdb: Use Config instead of globals Change-Id: Id6e2c0511113b24a7f90a7e3d50ab9b0f787f356 --- diff --git a/includes/specials/SpecialUnlockdb.php b/includes/specials/SpecialUnlockdb.php index 35141d805e..a8b97d78bd 100644 --- a/includes/specials/SpecialUnlockdb.php +++ b/includes/specials/SpecialUnlockdb.php @@ -37,11 +37,9 @@ class SpecialUnlockdb extends FormSpecialPage { } public function checkExecutePermissions( User $user ) { - global $wgReadOnlyFile; - parent::checkExecutePermissions( $user ); # If the lock file isn't writable, we can do sweet bugger all - if ( !file_exists( $wgReadOnlyFile ) ) { + if ( !file_exists( $this->getConfig()->get( 'ReadOnlyFile' ) ) ) { throw new ErrorPageError( 'lockdb', 'databasenotlocked' ); } } @@ -62,20 +60,19 @@ class SpecialUnlockdb extends FormSpecialPage { } public function onSubmit( array $data ) { - global $wgReadOnlyFile; - if ( !$data['Confirm'] ) { return Status::newFatal( 'locknoconfirm' ); } + $readOnlyFile = $this->getConfig()->get( 'ReadOnlyFile' ); wfSuppressWarnings(); - $res = unlink( $wgReadOnlyFile ); + $res = unlink( $readOnlyFile ); wfRestoreWarnings(); if ( $res ) { return Status::newGood(); } else { - return Status::newFatal( 'filedeleteerror', $wgReadOnlyFile ); + return Status::newFatal( 'filedeleteerror', $readOnlyFile ); } }