Merge "QUnit: fix swapped expected/actual fields"
authorjenkins-bot <jenkins-bot@gerrit.wikimedia.org>
Wed, 6 Aug 2014 17:25:03 +0000 (17:25 +0000)
committerGerrit Code Review <gerrit@wikimedia.org>
Wed, 6 Aug 2014 17:25:03 +0000 (17:25 +0000)
includes/specials/SpecialSearch.php
includes/specials/SpecialUnlockdb.php
includes/specials/SpecialUnusedimages.php
includes/specials/SpecialUploadStash.php

index 1caed0b..26f67b1 100644 (file)
@@ -186,12 +186,11 @@ class SpecialSearch extends SpecialPage {
                # No match, generate an edit URL
                $title = Title::newFromText( $term );
                if ( !is_null( $title ) ) {
-                       global $wgGoToEdit;
                        wfRunHooks( 'SpecialSearchNogomatch', array( &$title ) );
                        wfDebugLog( 'nogomatch', $title->getFullText(), 'private' );
 
                        # If the feature is enabled, go straight to the edit page
-                       if ( $wgGoToEdit ) {
+                       if ( $this->getConfig()->get( 'GoToEdit' ) ) {
                                $this->getOutput()->redirect( $title->getFullURL( array( 'action' => 'edit' ) ) );
 
                                return;
@@ -204,7 +203,7 @@ class SpecialSearch extends SpecialPage {
         * @param string $term
         */
        public function showResults( $term ) {
-               global $wgDisableTextSearch, $wgSearchForwardUrl, $wgContLang, $wgScript;
+               global $wgContLang;
 
                $profile = new ProfileSection( __METHOD__ );
                $search = $this->getSearchEngine();
@@ -220,9 +219,10 @@ class SpecialSearch extends SpecialPage {
 
                $out = $this->getOutput();
 
-               if ( $wgDisableTextSearch ) {
-                       if ( $wgSearchForwardUrl ) {
-                               $url = str_replace( '$1', urlencode( $term ), $wgSearchForwardUrl );
+               if ( $this->getConfig()->get( 'DisableTextSearch' ) ) {
+                       $searchFowardUrl = $this->getConfig()->get( 'SearchForwardUrl' );
+                       if ( $searchFowardUrl ) {
+                               $url = str_replace( '$1', urlencode( $term ), $searchFowardUrl );
                                $out->redirect( $url );
                        } else {
                                $out->addHTML(
@@ -304,7 +304,7 @@ class SpecialSearch extends SpecialPage {
                                array(
                                        'id' => ( $this->profile === 'advanced' ? 'powersearch' : 'search' ),
                                        'method' => 'get',
-                                       'action' => $wgScript
+                                       'action' => wfScript(),
                                )
                        )
                );
index 35141d8..a8b97d7 100644 (file)
@@ -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 );
                }
        }
 
index 743c587..36ec09e 100644 (file)
@@ -44,7 +44,6 @@ class UnusedimagesPage extends ImageQueryPage {
        }
 
        function getQueryInfo() {
-               global $wgCountCategorizedImagesAsUsed;
                $retval = array(
                        'tables' => array( 'image', 'imagelinks' ),
                        'fields' => array(
@@ -58,7 +57,7 @@ class UnusedimagesPage extends ImageQueryPage {
                        'join_conds' => array( 'imagelinks' => array( 'LEFT JOIN', 'il_to = img_name' ) )
                );
 
-               if ( $wgCountCategorizedImagesAsUsed ) {
+               if ( $this->getConfig()->get( 'CountCategorizedImagesAsUsed' ) ) {
                        // Order is significant
                        $retval['tables'] = array( 'image', 'page', 'categorylinks',
                                'imagelinks' );
index cb821cb..b5b4176 100644 (file)
@@ -159,15 +159,13 @@ class SpecialUploadStash extends UnlistedSpecialPage {
         * @return bool Success
         */
        private function outputThumbFromStash( $file, $params ) {
-               // this global, if it exists, points to a "scaler", as you might find in
+               $flags = 0;
+               // this config option, if it exists, points to a "scaler", as you might find in
                // the Wikimedia Foundation cluster. See outputRemoteScaledThumb(). This
                // is part of our horrible NFS-based system, we create a file on a mount
                // point here, but fetch the scaled file from somewhere else that
                // happens to share it over NFS.
-               global $wgUploadStashScalerBaseUrl;
-
-               $flags = 0;
-               if ( $wgUploadStashScalerBaseUrl ) {
+               if ( $this->getConfig()->get( 'UploadStashScalerBaseUrl' ) ) {
                        $this->outputRemoteScaledThumb( $file, $params, $flags );
                } else {
                        $this->outputLocallyScaledThumb( $file, $params, $flags );
@@ -230,11 +228,10 @@ class SpecialUploadStash extends UnlistedSpecialPage {
         * @return bool Success
         */
        private function outputRemoteScaledThumb( $file, $params, $flags ) {
-               // This global probably looks something like
+               // This option probably looks something like
                // 'http://upload.wikimedia.org/wikipedia/test/thumb/temp'. Do not use
                // trailing slash.
-               global $wgUploadStashScalerBaseUrl;
-               $scalerBaseUrl = $wgUploadStashScalerBaseUrl;
+               $scalerBaseUrl = $this->getConfig()->get( 'UploadStashScalerBaseUrl' );
 
                if ( preg_match( '/^\/\//', $scalerBaseUrl ) ) {
                        // this is apparently a protocol-relative URL, which makes no sense in this context,