From: Kunal Mehta Date: Sun, 3 Aug 2014 23:35:52 +0000 (-0700) Subject: SpecialLockdb: Use Config instead of globals X-Git-Tag: 1.31.0-rc.0~14606^2 X-Git-Url: http://git.cyclocoop.org/%22%20.%20%20%20%24self2%20.%20%20%20%22&var_mode_affiche=boucle?a=commitdiff_plain;h=badc5cbb07226c3e0ef7e821d2547e4fc22b015b;p=lhc%2Fweb%2Fwiklou.git SpecialLockdb: Use Config instead of globals Change-Id: I70b1fc0a4c89628c504f75e5e19beff5169cd5cb --- diff --git a/includes/specials/SpecialLockdb.php b/includes/specials/SpecialLockdb.php index 338240548c..1c1f1250c7 100644 --- a/includes/specials/SpecialLockdb.php +++ b/includes/specials/SpecialLockdb.php @@ -38,11 +38,9 @@ class SpecialLockdb 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 ( !is_writable( dirname( $wgReadOnlyFile ) ) ) { + if ( !is_writable( dirname( $this->getConfig()->get( 'ReadOnlyFile' ) ) ) ) { throw new ErrorPageError( 'lockdb', 'lockfilenotwritable' ); } } @@ -69,14 +67,14 @@ class SpecialLockdb extends FormSpecialPage { } public function onSubmit( array $data ) { - global $wgContLang, $wgReadOnlyFile; + global $wgContLang; if ( !$data['Confirm'] ) { return Status::newFatal( 'locknoconfirm' ); } wfSuppressWarnings(); - $fp = fopen( $wgReadOnlyFile, 'w' ); + $fp = fopen( $this->getConfig()->get( 'ReadOnlyFile' ), 'w' ); wfRestoreWarnings(); if ( false === $fp ) {