Merge "SpecialLog: Use Config instead of globals"
authorKunal Mehta <legoktm@gmail.com>
Sun, 3 Aug 2014 23:57:43 +0000 (23:57 +0000)
committerGerrit Code Review <gerrit@wikimedia.org>
Sun, 3 Aug 2014 23:57:43 +0000 (23:57 +0000)
includes/specials/SpecialLockdb.php
includes/specials/SpecialMIMEsearch.php
includes/specials/SpecialMergeHistory.php

index 3382405..1c1f125 100644 (file)
@@ -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 ) {
index 4d9e7da..3f1850d 100644 (file)
@@ -105,8 +105,6 @@ class MIMEsearchPage extends QueryPage {
        }
 
        function execute( $par ) {
-               global $wgScript;
-
                $mime = $par ? $par : $this->getRequest()->getText( 'mime' );
                $mime = trim( $mime );
 
@@ -115,7 +113,7 @@ class MIMEsearchPage extends QueryPage {
                $this->getOutput()->addHTML(
                        Xml::openElement(
                                'form',
-                               array( 'id' => 'specialmimesearch', 'method' => 'get', 'action' => $wgScript )
+                               array( 'id' => 'specialmimesearch', 'method' => 'get', 'action' => wfScript() )
                        ) .
                                Xml::openElement( 'fieldset' ) .
                                Html::hidden( 'title', $this->getPageTitle()->getPrefixedText() ) .
index e1700de..6efc12b 100644 (file)
@@ -159,14 +159,12 @@ class SpecialMergeHistory extends SpecialPage {
        }
 
        function showMergeForm() {
-               global $wgScript;
-
                $this->getOutput()->addWikiMsg( 'mergehistory-header' );
 
                $this->getOutput()->addHTML(
                        Xml::openElement( 'form', array(
                                'method' => 'get',
-                               'action' => $wgScript ) ) .
+                               'action' => wfScript() ) ) .
                                '<fieldset>' .
                                Xml::element( 'legend', array(),
                                        $this->msg( 'mergehistory-box' )->text() ) .