Change usages of $wgUser->getSkin() in special pages to use $this->getSkin()
authorSam Reed <reedy@users.mediawiki.org>
Fri, 1 Jul 2011 02:25:19 +0000 (02:25 +0000)
committerSam Reed <reedy@users.mediawiki.org>
Fri, 1 Jul 2011 02:25:19 +0000 (02:25 +0000)
Fix trailing whitespace

38 files changed:
includes/FeedUtils.php
includes/ImagePage.php
includes/QueryPage.php
includes/RawPage.php
includes/api/ApiQueryFilearchive.php
includes/api/ApiQueryWatchlist.php
includes/diff/DifferenceEngine.php
includes/filerepo/RepoGroup.php
includes/specials/SpecialBlock.php
includes/specials/SpecialBlockList.php
includes/specials/SpecialConfirmemail.php
includes/specials/SpecialContributions.php
includes/specials/SpecialDeletedContributions.php
includes/specials/SpecialEditWatchlist.php
includes/specials/SpecialEmailuser.php
includes/specials/SpecialExport.php
includes/specials/SpecialFileDuplicateSearch.php
includes/specials/SpecialImport.php
includes/specials/SpecialLog.php
includes/specials/SpecialMergeHistory.php
includes/specials/SpecialMovepage.php
includes/specials/SpecialNewimages.php
includes/specials/SpecialPrefixindex.php
includes/specials/SpecialProtectedtitles.php
includes/specials/SpecialRecentchangeslinked.php
includes/specials/SpecialSearch.php
includes/specials/SpecialStatistics.php
includes/specials/SpecialTags.php
includes/specials/SpecialUnblock.php
includes/specials/SpecialUndelete.php
includes/specials/SpecialUpload.php
includes/specials/SpecialUserlogin.php
includes/specials/SpecialUserrights.php
maintenance/deleteArchivedRevisions.inc
maintenance/dumpIterator.php
maintenance/preprocessorFuzzTest.php
maintenance/rebuildImages.php
maintenance/rebuildtextindex.php

index 9daffc1..4502c3a 100644 (file)
@@ -112,7 +112,7 @@ class FeedUtils {
                                #       $wgLang->date( $timestamp ),
                                #       $wgLang->time( $timestamp ) ),
                                #       wfMsg( 'currentrev' ) );
-                               
+
                                // Don't bother generating the diff if we won't be able to show it
                                if ( $wgFeedDiffCutoff > 0 ) {
                                        $de = new DifferenceEngine( $title, $oldid, $newid );
index ebbe36c..e6090f2 100644 (file)
@@ -879,7 +879,7 @@ class ImageHistoryList {
         */
        public function __construct( $imagePage ) {
                global $wgUser, $wgShowArchiveThumbnails;
-               $this->skin = $wgUser->getSkin();
+               $this->skin = $this->getSkin();
                $this->current = $imagePage->getFile();
                $this->img = $imagePage->getDisplayedFile();
                $this->title = $imagePage->getTitle();
index e52669f..da8faf5 100644 (file)
@@ -521,7 +521,7 @@ abstract class QueryPage extends SpecialPage {
                # with more than a straight list, so we hand them the info, plus
                # an OutputPage, and let them get on with it
                $this->outputResults( $wgOut,
-                       $wgUser->getSkin(),
+                       $this->getSkin(),
                        $dbr, # Should use a ResultWrapper for this
                        $res,
                        $this->numRows,
index ddb91fb..28ce7ad 100644 (file)
@@ -151,9 +151,9 @@ class RawPage {
        }
 
        function getRawText() {
-               global $wgUser, $wgOut;
+               global $wgOut;
                if( $this->mGen ) {
-                       $sk = $wgUser->getSkin();
+                       $sk = $this->getSkin();
                        if( !StubObject::isRealObject( $wgOut ) ) {
                                $wgOut->_unstub( 2 );
                        }
index 54d5a45..e746a6c 100644 (file)
@@ -181,7 +181,7 @@ class ApiQueryFilearchive extends ApiQueryBase {
                        if ( $fld_mime ) {
                                $file['mime'] = "$row->fa_major_mime/$row->fa_minor_mime";
                        }
-                       
+
                        if ( $row->fa_deleted & File::DELETED_FILE ) {
                                $file['filehidden'] = '';
                        }
@@ -196,7 +196,7 @@ class ApiQueryFilearchive extends ApiQueryBase {
                                $file['suppressed'] = '';
                        }
 
-                       
+
                        $fit = $result->addValue( array( 'query', $this->getModuleName() ), null, $file );
                        if ( !$fit ) {
                                $this->setContinueEnumParameter( 'from', $this->keyToTitle( $row->fa_name ) );
index e5507f6..a5023ea 100644 (file)
@@ -133,11 +133,11 @@ class ApiQueryWatchlist extends ApiQueryGeneratorBase {
                $this->addWhere( array(
                        'rc_deleted' => 0,
                ) );
-               
+
                $db = $this->getDB();
 
-               $this->addWhereRange( 'rc_timestamp', $params['dir'], 
-                       $db->timestamp( $params['start'] ), 
+               $this->addWhereRange( 'rc_timestamp', $params['dir'],
+                       $db->timestamp( $params['start'] ),
                        $db->timestamp( $params['end'] ) );
                $this->addWhereFld( 'wl_namespace', $params['namespace'] );
                $this->addWhereIf( 'rc_this_oldid=page_latest OR rc_type=' . RC_LOG, !$params['allrev'] );
@@ -293,7 +293,7 @@ class ApiQueryWatchlist extends ApiQueryGeneratorBase {
 
                if ( $this->fld_parsedcomment && isset( $row->rc_comment ) ) {
                        global $wgUser;
-                       $vals['parsedcomment'] = $wgUser->getSkin()->formatComment( $row->rc_comment, $title );
+                       $vals['parsedcomment'] = $this->getSkin()->formatComment( $row->rc_comment, $title );
                }
 
                if ( $this->fld_loginfo && $row->rc_type == RC_LOG ) {
index 4e8194a..f0345c4 100644 (file)
@@ -482,7 +482,7 @@ CONTROL;
                // (a) the user can delete revisions, or
                // (b) the user can view deleted revision *and* this one is deleted
                if ( $canHide || ( $rev->getVisibility() && $wgUser->isAllowed( 'deletedhistory' ) ) ) {
-                       $sk = $wgUser->getSkin();
+                       $sk = $this->getSkin();
                        if ( !$rev->userCan( Revision::DELETED_RESTRICTED ) ) {
                                $link = $sk->revDeleteLinkDisabled( $canHide ); // revision was hidden from sysops
                        } else {
@@ -550,7 +550,7 @@ CONTROL;
                }
                # Add redundant patrol link on bottom...
                if ( $this->mRcidMarkPatrolled && $this->mTitle->quickUserCan( 'patrol' ) ) {
-                       $sk = $wgUser->getSkin();
+                       $sk = $this->getSkin();
                        $token = $wgUser->editToken( $this->mRcidMarkPatrolled );
                        $wgOut->preventClickjacking();
                        $wgOut->addHTML(
index 59407cf..d487590 100644 (file)
@@ -289,6 +289,8 @@ class RepoGroup {
        /**
         * Get the local repository, i.e. the one corresponding to the local image
         * table. Files are typically uploaded to the local repository.
+        *
+        * @return LocalRepo
         */
        function getLocalRepo() {
                return $this->getRepo( 'local' );
index 299d758..f95d61a 100644 (file)
@@ -77,7 +77,7 @@ class SpecialBlock extends SpecialPage {
                if ( $this->target instanceof User ) {
                        # Set the 'relevant user' in the skin, so it displays links like Contributions,
                        # User logs, UserRights, etc.
-                       $wgUser->getSkin()->setRelevantUser( $this->target );
+                       $this->getSkin()->setRelevantUser( $this->target );
                }
 
                list( $this->previousTarget, /*...*/ ) = Block::parseTarget( $wgRequest->getVal( 'wpPreviousTarget' ) );
index 00b47b4..d192fad 100644 (file)
@@ -225,7 +225,7 @@ class BlockListPager extends TablePager {
 
                static $sk, $msg;
                if ( empty( $sk ) ) {
-                       $sk = $wgUser->getSkin();
+                       $sk = $this->getSkin();
                        $msg = array(
                                'anononlyblock',
                                'createaccountblock',
index 2370b6b..b8dfaba 100644 (file)
@@ -61,7 +61,7 @@ class EmailConfirmation extends UnlistedSpecialPage {
                                }
                        } else {
                                $title = SpecialPage::getTitleFor( 'Userlogin' );
-                               $skin = $wgUser->getSkin();
+                               $skin = $this->getSkin();
                                $llink = $skin->linkKnown(
                                        $title,
                                        wfMsgHtml( 'loginreqlink' ),
index fe0e10c..1b5360c 100644 (file)
@@ -83,8 +83,8 @@ class SpecialContributions extends SpecialPage {
                        $wgOut->setSubtitle( $this->contributionsSub( $nt, $id ) );
                        $wgOut->setHTMLTitle( wfMsg( 'pagetitle', wfMsgExt( 'contributions-title', array( 'parsemag' ),$target ) ) );
                        $user = User::newFromName( $target, false );
-                       if ( is_object($user) ) {
-                               $wgUser->getSkin()->setRelevantUser( $user );
+                       if ( is_object( $user ) ) {
+                               $this->getSkin()->setRelevantUser( $user );
                        }
                } else {
                        $wgOut->setSubtitle( wfMsgHtml( 'sp-contributions-newbies-sub') );
@@ -215,7 +215,7 @@ class SpecialContributions extends SpecialPage {
        protected function contributionsSub( $nt, $id ) {
                global $wgLang, $wgUser, $wgOut;
 
-               $sk = $wgUser->getSkin();
+               $sk = $this->getSkin();
 
                if ( $id === null ) {
                        $user = htmlspecialchars( $nt->getText() );
index 221a010..32ed62b 100644 (file)
@@ -357,7 +357,7 @@ class DeletedContributionsPage extends SpecialPage {
        function getSubTitle( $nt, $id ) {
                global $wgLang, $wgUser, $wgOut;
 
-               $sk = $wgUser->getSkin();
+               $sk = $this->getSkin();
 
                if ( $id === null ) {
                        $user = htmlspecialchars( $nt->getText() );
index 47576e3..9255bc7 100644 (file)
@@ -37,7 +37,7 @@ class SpecialEditWatchlist extends UnlistedSpecialPage {
                # Anons don't get a watchlist
                if( $wgUser->isAnon() ) {
                        $wgOut->setPageTitle( wfMsg( 'watchnologin' ) );
-                       $llink = $wgUser->getSkin()->linkKnown(
+                       $llink = $this->getSkin()->linkKnown(
                                SpecialPage::getTitleFor( 'Userlogin' ),
                                wfMsgHtml( 'loginreqlink' ),
                                array(),
@@ -51,7 +51,7 @@ class SpecialEditWatchlist extends UnlistedSpecialPage {
                        'watchlistfor2',
                        array( 'parseinline', 'replaceafter' ),
                        $wgUser->getName(),
-                       SpecialEditWatchlist::buildTools( $wgUser->getSkin() )
+                       SpecialEditWatchlist::buildTools( $this->getSkin() )
                );
                $wgOut->setSubtitle( $sub );
 
@@ -139,7 +139,7 @@ class SpecialEditWatchlist extends UnlistedSpecialPage {
                                        'watchlistedit-raw-added',
                                        $wgLang->formatNum( count( $toWatch ) )
                                );
-                               $this->showTitles( $toWatch, $this->successMessage, $wgUser->getSkin() );
+                               $this->showTitles( $toWatch, $this->successMessage, $this->getSkin() );
                        }
 
                        if( count( $toUnwatch ) > 0 ) {
@@ -147,7 +147,7 @@ class SpecialEditWatchlist extends UnlistedSpecialPage {
                                        'watchlistedit-raw-removed',
                                        $wgLang->formatNum( count( $toUnwatch ) )
                                );
-                               $this->showTitles( $toUnwatch, $this->successMessage, $wgUser->getSkin() );
+                               $this->showTitles( $toUnwatch, $this->successMessage, $this->getSkin() );
                        }
                } else {
                        $this->clearWatchlist( $wgUser );
@@ -156,7 +156,7 @@ class SpecialEditWatchlist extends UnlistedSpecialPage {
                                'watchlistedit-raw-removed',
                                $wgLang->formatNum( count( $current ) )
                        );
-                       $this->showTitles( $current, $this->successMessage, $wgUser->getSkin() );
+                       $this->showTitles( $current, $this->successMessage, $this->getSkin() );
                }
                return true;
        }
@@ -416,7 +416,7 @@ class SpecialEditWatchlist extends UnlistedSpecialPage {
                                'watchlistedit-normal-done',
                                $wgLang->formatNum( count( $removed ) )
                        );
-                       $this->showTitles( $removed, $this->successMessage, $wgUser->getSkin() );
+                       $this->showTitles( $removed, $this->successMessage, $this->getSkin() );
                        return true;
                } else {
                        return false;
@@ -597,4 +597,4 @@ class EditWatchlistNormalHTMLForm extends HTMLForm {
                        ? wfMsgHtml( 'blanknamespace' )
                        : htmlspecialchars( $wgLang->getFormattedNsText( $namespace ) );
        }
-}
\ No newline at end of file
+}
index b3ba9c5..90cfe10 100644 (file)
@@ -39,7 +39,7 @@ class SpecialEmailUser extends UnlistedSpecialPage {
                        'From' => array(
                                'type' => 'info',
                                'raw' => 1,
-                               'default' => $wgUser->getSkin()->link(
+                               'default' => $this->getSkin()->link(
                                        $wgUser->getUserPage(),
                                        htmlspecialchars( $wgUser->getName() )
                                ),
@@ -49,7 +49,7 @@ class SpecialEmailUser extends UnlistedSpecialPage {
                        'To' => array(
                                'type' => 'info',
                                'raw' => 1,
-                               'default' => $wgUser->getSkin()->link(
+                               'default' => $this->getSkin()->link(
                                        $this->mTargetObj->getUserPage(),
                                        htmlspecialchars( $this->mTargetObj->getName() )
                                ),
index 3ecf40e..8968ec2 100644 (file)
@@ -40,7 +40,7 @@ class SpecialExport extends SpecialPage {
        public function execute( $par ) {
                global $wgOut, $wgRequest, $wgSitename, $wgExportAllowListContributors;
                global $wgExportAllowHistory, $wgExportMaxHistory, $wgExportMaxLinkDepth;
-               global $wgExportFromNamespaces, $wgUser;
+               global $wgExportFromNamespaces;
 
                $this->setHeaders();
                $this->outputHeader();
@@ -215,7 +215,7 @@ class SpecialExport extends SpecialPage {
                        $wgRequest->wasPosted() ? $wgRequest->getCheck( 'wpDownload' ) : true
                ) . '<br />';
 
-               $form .= Xml::submitButton( wfMsg( 'export-submit' ), $wgUser->getSkin()->tooltipAndAccessKeyAttribs( 'export' ) );
+               $form .= Xml::submitButton( wfMsg( 'export-submit' ), $this->getSkin()->tooltipAndAccessKeyAttribs( 'export' ) );
                $form .= Xml::closeElement( 'form' );
 
                $wgOut->addHTML( $form );
index 93d2f55..be65581 100644 (file)
@@ -62,8 +62,8 @@ class FileDuplicateSearchPage extends QueryPage {
         * @param $dupes Array of File objects
         */
        function showList( $dupes ) {
-               global $wgUser, $wgOut;
-               $skin = $wgUser->getSkin();
+               global $wgOut;
+               $skin = $this->getSkin();
 
                $html = array();
                $html[] = $this->openList( 0 );
index 47ca497..e41685d 100644 (file)
@@ -292,7 +292,7 @@ class SpecialImport extends SpecialPage {
                                        <td>
                                        </td>
                                        <td class='mw-submit'>" .
-                                               Xml::submitButton( wfMsg( 'import-interwiki-submit' ), $wgUser->getSkin()->tooltipAndAccessKeyAttribs( 'import' ) ) .
+                                               Xml::submitButton( wfMsg( 'import-interwiki-submit' ), $this->getSkin()->tooltipAndAccessKeyAttribs( 'import' ) ) .
                                        "</td>
                                </tr>" .
                                Xml::closeElement( 'table' ).
@@ -350,7 +350,7 @@ class ImportReporter {
                $args = func_get_args();
                call_user_func_array( $this->mOriginalPageOutCallback, $args );
 
-               $skin = $wgUser->getSkin();
+               $skin = $this->getSkin();
 
                $this->mPageCount++;
 
index e34a341..d8f6d8c 100644 (file)
@@ -95,10 +95,10 @@ class SpecialLog extends SpecialPage {
        }
 
        private function show( FormOptions $opts, array $extraConds ) {
-               global $wgOut, $wgUser;
+               global $wgOut;
 
                # Create a LogPager item to get the results and a LogEventsList item to format them...
-               $loglist = new LogEventsList( $wgUser->getSkin(), $wgOut, 0 );
+               $loglist = new LogEventsList( $this->getSkin(), $wgOut, 0 );
                $pager = new LogPager( $loglist, $opts->getValue( 'type' ), $opts->getValue( 'user' ),
                        $opts->getValue( 'page' ), $opts->getValue( 'pattern' ), $extraConds, $opts->getValue( 'year' ),
                        $opts->getValue( 'month' ), $opts->getValue( 'tagfilter' ) );
@@ -108,7 +108,7 @@ class SpecialLog extends SpecialPage {
 
                # Set relevant user
                if ( $pager->getUser() ) {
-                       $wgUser->getSkin()->setRelevantUser( User::newFromName( $pager->getUser() ) );
+                       $this->getSkin()->setRelevantUser( User::newFromName( $pager->getUser() ) );
                }
 
                # Show form options
index 916230c..f9c4a2c 100644 (file)
@@ -173,7 +173,7 @@ class SpecialMergeHistory extends SpecialPage {
        private function showHistory() {
                global $wgUser, $wgOut;
 
-               $this->sk = $wgUser->getSkin();
+               $this->sk = $this->getSkin();
 
                $wgOut->setPageTitle( wfMsg( 'mergehistory' ) );
 
index 61ae708..11095fb 100644 (file)
@@ -107,7 +107,7 @@ class MovePageForm extends UnlistedSpecialPage {
        function showForm( $err ) {
                global $wgOut, $wgUser, $wgContLang, $wgFixDoubleRedirects;
 
-               $skin = $wgUser->getSkin();
+               $skin = $this->getSkin();
 
                $oldTitleLink = $skin->link( $this->oldTitle );
 
@@ -492,7 +492,7 @@ class MovePageForm extends UnlistedSpecialPage {
                }
 
                $extraOutput = array();
-               $skin = $wgUser->getSkin();
+               $skin = $this->getSkin();
                $count = 1;
                foreach( $extraPages as $oldSubpage ) {
                        if( $ot->equals( $oldSubpage ) ) {
@@ -596,7 +596,7 @@ class MovePageForm extends UnlistedSpecialPage {
                }
 
                $out->addWikiMsg( 'movesubpagetext', $wgLang->formatNum( $count ) );
-               $skin = $wgUser->getSkin();
+               $skin = $this->getSkin();
                $out->addHTML( "<ul>\n" );
 
                foreach( $subpages as $subpage ) {
index 9246fb1..52dfef1 100644 (file)
@@ -51,11 +51,11 @@ class SpecialNewFiles extends IncludableSpecialPage {
 class NewFilesPager extends ReverseChronologicalPager {
 
        function __construct( $par = null ) {
-               global $wgRequest, $wgUser;
+               global $wgRequest;
 
                $this->like = $wgRequest->getText( 'like' );
                $this->showbots = $wgRequest->getBool( 'showbots' , 0 );
-               $this->skin = $wgUser->getSkin();
+               $this->skin = $this->getSkin();
 
                parent::__construct();
        }
index a9015b1..ad2bb74 100644 (file)
@@ -120,9 +120,9 @@ class SpecialPrefixindex extends SpecialAllpages {
         * @param $from String: list all pages from this name (default FALSE)
         */
        function showPrefixChunk( $namespace = NS_MAIN, $prefix, $from = null ) {
-               global $wgOut, $wgUser, $wgContLang, $wgLang;
+               global $wgOut, $wgContLang, $wgLang;
 
-               $sk = $wgUser->getSkin();
+               $sk = $this->getSkin();
 
                if (!isset($from)) $from = $prefix;
 
index e347894..c768b3e 100644 (file)
@@ -74,14 +74,14 @@ class SpecialProtectedtitles extends SpecialPage {
         * @return string
         */
        function formatRow( $row ) {
-               global $wgUser, $wgLang;
+               global $wgLang;
 
                wfProfileIn( __METHOD__ );
 
-               static $skin=null;
+               static $skin =  null;
 
                if( is_null( $skin ) )
-                       $skin = $wgUser->getSkin();
+                       $skin = $this->getSkin();
 
                $title = Title::makeTitleSafe( $row->pt_namespace, $row->pt_title );
                $link = $skin->link( $title );
index 66eeadb..01de436 100644 (file)
@@ -236,8 +236,7 @@ class SpecialRecentchangeslinked extends SpecialRecentChanges {
        }
 
        function setTopText( OutputPage $out, FormOptions $opts ) {
-               global $wgUser;
-               $skin = $wgUser->getSkin();
+               $skin = $this->getSkin();
                $target = $this->getTargetTitle();
                if( $target )
                        $out->setSubtitle( wfMsg( 'recentchangeslinked-backlink', $skin->link( $target,
index 7cea886..2b1ce56 100644 (file)
@@ -122,7 +122,7 @@ class SpecialSearch extends SpecialPage {
                // Redirects defaults to true, but we don't know whether it was ticked of or just missing
                $default = $request->getBool( 'profile' ) ? 0 : 1;
                $this->searchRedirects = $request->getBool( 'redirs', $default ) ? 1 : 0;
-               $this->sk = $user->getSkin();
+               $this->sk = $this->getSkin();
                $this->didYouMeanHtml = ''; # html of did you mean... link
                $this->fulltext = $request->getVal('fulltext');
        }
@@ -173,10 +173,10 @@ class SpecialSearch extends SpecialPage {
         * @param $term String
         */
        public function showResults( $term ) {
-               global $wgOut, $wgUser, $wgDisableTextSearch, $wgContLang, $wgScript;
+               global $wgOut, $wgDisableTextSearch, $wgContLang, $wgScript;
                wfProfileIn( __METHOD__ );
 
-               $sk = $wgUser->getSkin();
+               $sk = $this->getSkin();
 
                $search = $this->getSearchEngine();
                $search->setLimitOffset( $this->limit, $this->offset );
@@ -482,7 +482,7 @@ class SpecialSearch extends SpecialPage {
         * @param $terms Array: terms to highlight
         */
        protected function showHit( $result, $terms ) {
-               global $wgLang, $wgUser;
+               global $wgLang;
                wfProfileIn( __METHOD__ );
 
                if( $result->isBrokenTitle() ) {
@@ -490,7 +490,7 @@ class SpecialSearch extends SpecialPage {
                        return "<!-- Broken link in search result -->\n";
                }
 
-               $sk = $wgUser->getSkin();
+               $sk = $this->getSkin();
                $t = $result->getTitle();
 
                $titleSnippet = $result->getTitleSnippet($terms);
index fd23968..88e7b57 100644 (file)
@@ -165,8 +165,8 @@ class SpecialStatistics extends SpecialPage {
        }
 
        private function getUserStats() {
-               global $wgLang, $wgUser, $wgActiveUserDays;
-               $sk = $wgUser->getSkin();
+               global $wgLang, $wgActiveUserDays;
+               $sk = $this->getSkin();
                return Xml::openElement( 'tr' ) .
                        Xml::tags( 'th', array( 'colspan' => '2' ), wfMsgExt( 'statistics-header-users', array( 'parseinline' ) ) ) .
                        Xml::closeElement( 'tr' ) .
@@ -188,8 +188,8 @@ class SpecialStatistics extends SpecialPage {
        }
 
        private function getGroupStats() {
-               global $wgGroupPermissions, $wgImplicitGroups, $wgLang, $wgUser;
-               $sk = $wgUser->getSkin();
+               global $wgGroupPermissions, $wgImplicitGroups, $wgLang;
+               $sk = $this->getSkin();
                $text = '';
                foreach( $wgGroupPermissions as $group => $permissions ) {
                        # Skip generic * and implicit groups
@@ -249,10 +249,10 @@ class SpecialStatistics extends SpecialPage {
        }
 
        private function getMostViewedPages() {
-               global $wgLang, $wgUser;
+               global $wgLang;
                $text = '';
                $dbr = wfGetDB( DB_SLAVE );
-               $sk = $wgUser->getSkin();
+               $sk = $this->getSkin();
                $res = $dbr->select(
                                'page',
                                array(
index add54c1..66a89e9 100644 (file)
@@ -65,8 +65,7 @@ class SpecialTags extends SpecialPage {
        function doTagRow( $tag, $hitcount ) {
                static $sk = null, $doneTags = array();
                if ( !$sk ) {
-                       global $wgUser;
-                       $sk = $wgUser->getSkin();
+                       $sk = $this->getSkin();
                }
 
                if ( in_array( $tag, $doneTags ) ) {
index cef5c2b..8974c5d 100644 (file)
@@ -115,14 +115,12 @@ class SpecialUnblock extends SpecialPage {
                                unset( $fields['Name'] );
 
                        } else {
-                               global $wgUser;
-
                                $fields['Target']['default'] = $target;
                                $fields['Target']['type'] = 'hidden';
                                switch( $type ){
                                        case Block::TYPE_USER:
                                        case Block::TYPE_IP:
-                                               $skin = $wgUser->getSkin();
+                                               $skin = $this->getSkin();
                                                $fields['Name']['default'] = $skin->link(
                                                        $target->getUserPage(),
                                                        $target->getName()
index 18c558c..29c8034 100644 (file)
@@ -657,7 +657,7 @@ class SpecialUndelete extends SpecialPage {
                }
                if ( $this->mTarget !== '' ) {
                        $this->mTargetObj = Title::newFromURL( $this->mTarget );
-                       $wgUser->getSkin()->setRelevantTitle( $this->mTargetObj );
+                       $this->getSkin()->setRelevantTitle( $this->mTargetObj );
                } else {
                        $this->mTargetObj = null;
                }
@@ -750,7 +750,7 @@ class SpecialUndelete extends SpecialPage {
 
                $wgOut->addWikiMsg( 'undeletepagetext', $wgLang->formatNum( $result->numRows() ) );
 
-               $sk = $wgUser->getSkin();
+               $sk = $this->getSkin();
                $undelete = $this->getTitle();
                $wgOut->addHTML( "<ul>\n" );
                foreach ( $result as $row ) {
@@ -775,7 +775,7 @@ class SpecialUndelete extends SpecialPage {
        private function showRevision( $timestamp ) {
                global $wgLang, $wgUser, $wgOut;
 
-               $skin = $wgUser->getSkin();
+               $skin = $this->getSkin();
 
                if( !preg_match( '/[0-9]{14}/', $timestamp ) ) {
                        return 0;
@@ -905,7 +905,7 @@ class SpecialUndelete extends SpecialPage {
                global $wgUser;
                $canHide = $wgUser->isAllowed( 'deleterevision' );
                if( $canHide || ( $rev->getVisibility() && $wgUser->isAllowed( 'deletedhistory' ) ) ) {
-                       $skin = $wgUser->getSkin();
+                       $skin = $this->getSkin();
                        if( !$rev->userCan( Revision::DELETED_RESTRICTED ) ) {
                                $revdlink = $skin->revDeleteLinkDisabled( $canHide ); // revision was hidden from sysops
                        } else {
@@ -976,7 +976,7 @@ class SpecialUndelete extends SpecialPage {
         */
        private function diffHeader( $rev, $prefix ) {
                global $wgUser, $wgLang;
-               $sk = $wgUser->getSkin();
+               $sk = $this->getSkin();
                $isDeleted = !( $rev->getId() && $rev->getTitle() );
                if( $isDeleted ) {
                        /// @todo FIXME: $rev->getTitle() is null for deleted revs...?
index 5f8f88f..34653f2 100644 (file)
@@ -319,7 +319,7 @@ class SpecialUpload extends SpecialPage {
                                $link = wfMsgExt(
                                        $wgUser->isAllowed( 'delete' ) ? 'thisisdeleted' : 'viewdeleted',
                                        array( 'parse', 'replaceafter' ),
-                                       $wgUser->getSkin()->linkKnown(
+                                       $this->getSkin()->linkKnown(
                                                SpecialPage::getTitleFor( 'Undelete', $title->getPrefixedText() ),
                                                wfMsgExt( 'restorelink', array( 'parsemag', 'escape' ), $count )
                                        )
@@ -863,7 +863,7 @@ class UploadForm extends HTMLForm {
                }
 
                $this->mMaxUploadSize['file'] = UploadBase::getMaxUploadSize( 'file' );
-               # Limit to upload_max_filesize unless we are running under HipHop and 
+               # Limit to upload_max_filesize unless we are running under HipHop and
                # that setting doesn't exist
                if ( !wfIsHipHop() ) {
                        $this->mMaxUploadSize['file'] = min( $this->mMaxUploadSize['file'],
index bbd602a..b0e435e 100644 (file)
@@ -1188,7 +1188,7 @@ class LoginForm extends SpecialPage {
                if( $this->mReturnTo ) {
                        $attr['returnto'] = $this->mReturnTo;
                }
-               $skin = $wgUser->getSkin();
+               $skin = $this->getSkin();
                return $skin->linkKnown(
                        $self,
                        htmlspecialchars( $text ),
index 41b1fb9..483baf0 100644 (file)
@@ -463,7 +463,7 @@ class UserrightsPage extends SpecialPage {
                                        <td></td>
                                        <td class='mw-submit'>" .
                                                Xml::submitButton( wfMsg( 'saveusergroups' ),
-                                                       array( 'name' => 'saveusergroups' ) + $wgUser->getSkin()->tooltipAndAccessKeyAttribs( 'userrights-set' ) ) .
+                                                       array( 'name' => 'saveusergroups' ) + $this->getSkin()->tooltipAndAccessKeyAttribs( 'userrights-set' ) ) .
                                        "</td>
                                </tr>" .
                        Xml::closeElement( 'table' ) . "\n" .
index 10bd4cf..7628985 100644 (file)
@@ -54,4 +54,4 @@ class DeleteArchivedRevisionsImplementation {
                        $maint->purgeRedundantText( true );
                }
        }
-}
\ No newline at end of file
+}
index 11c132a..470bc56 100644 (file)
@@ -5,7 +5,7 @@
  * We implement below the simple task of searching inside a dump.
  *
  * Copyright (C) 2011 Platonides - http://www.mediawiki.org/
- * 
+ *
  * This program is free software; you can redistribute it and/or modify
  * it under the terms of the GNU General Public License as published by
  * the Free Software Foundation; either version 2 of the License, or
@@ -24,7 +24,7 @@
  * @file
  * @ingroup Maintenance
  */
+
 require_once( dirname( __FILE__ ) . '/Maintenance.php' );
 
 abstract class DumpIterator extends Maintenance {
@@ -44,18 +44,18 @@ abstract class DumpIterator extends Maintenance {
                if (! ( $this->hasOption('file') ^ $this->hasOption('dump') ) ) {
                        $this->error("You must provide a file or dump", true);
                }
-               
+
                $this->checkOptions();
-               
+
                if ( $this->hasOption('file') ) {
                        $revision = new WikiRevision;
-                       
+
                        $revision->setText( file_get_contents( $this->getOption( 'file' ) ) );
                        $revision->setTitle( Title::newFromText( rawurldecode( basename( $this->getOption( 'file' ), '.txt' ) ) ) );
                        $this->handleRevision( $revision );
                        return;
                }
-               
+
                $this->startTime = wfTime();
 
                if ( $this->getOption('dump') == '-' ) {
@@ -67,23 +67,23 @@ abstract class DumpIterator extends Maintenance {
 
                $importer->setRevisionCallback(
                        array( &$this, 'handleRevision' ) );
-               
+
                $this->from = $this->getOption( 'from', null );
                $this->count = 0;
                $importer->doImport();
-               
+
                $this->conclusions();
-                       
+
                $delta = wfTime() - $this->startTime;
                $this->error( "Done {$this->count} revisions in " . round($delta, 2) . " seconds " );
                if ($delta > 0)
                        $this->error( round($this->count / $delta, 2) . " pages/sec" );
-               
+
                # Perform the memory_get_peak_usage() when all the other data has been output so there's no damage if it dies.
                # It is only available since 5.2.0 (since 5.2.1 if you haven't compiled with --enable-memory-limit)
                $this->error( "Memory peak usage of " . memory_get_peak_usage() . " bytes\n" );
        }
-       
+
        public function finalSetup() {
                parent::finalSetup();
 
@@ -101,9 +101,9 @@ abstract class DumpIterator extends Maintenance {
 
                return false;
        }
-       
+
        /**
-        * Callback function for each revision, child classes should override 
+        * Callback function for each revision, child classes should override
         * processRevision instead.
         * @param $rev Revision
         */
@@ -113,25 +113,25 @@ abstract class DumpIterator extends Maintenance {
                        $this->error( "Got bogus revision with null title!" );
                        return;
                }
-               
+
                $this->count++;
                if ( isset( $this->from ) ) {
                        if ( $this->from != $title )
                                return;
                        $this->output( "Skipped " . ($this->count - 1) . " pages\n" );
-                       
+
                        $this->count = 1;
                        $this->from = null;
                }
-               
+
                $this->processRevision( $rev );
        }
-       
+
        /* Stub function for processing additional options */
        public function checkOptions() {
                return;
        }
-       
+
        /* Stub function for giving data about what was computed */
        public function conclusions() {
                return;
@@ -142,17 +142,20 @@ abstract class DumpIterator extends Maintenance {
 }
 
 class SearchDump extends DumpIterator {
-       
+
        public function __construct() {
                parent::__construct();
                $this->mDescription = "Runs a regex in the revisions from a dump";
                $this->addOption( 'regex', 'Searching regex', true, true );
        }
-       
+
        public function getDbType() {
                return Maintenance::DB_NONE;
        }
-               
+
+       /**
+        * @param $rev Revision
+        */
        public function processRevision( $rev ) {
                if ( preg_match( $this->getOption( 'regex' ), $rev->getText() ) ) {
                        $this->output( $rev->getTitle() . " matches at edit from " . $rev->getTimestamp() . "\n" );
index 55ca8e3..9dee67e 100644 (file)
@@ -154,6 +154,9 @@ class PPFuzzTest {
                $this->templates = array();
        }
 
+       /**
+        * @param $title Title
+        */
        function templateHook( $title ) {
                $titleText = $title->getPrefixedDBkey();
 
index 55f93d7..1711183 100644 (file)
@@ -67,6 +67,9 @@ class ImageBuilder extends Maintenance {
                }
        }
 
+       /**
+        * @return FileRepo
+        */
        function getRepo() {
                if ( !isset( $this->repo ) ) {
                        $this->repo = RepoGroup::singleton()->getLocalRepo();
index b0934eb..04606c7 100644 (file)
@@ -28,6 +28,10 @@ require_once( dirname( __FILE__ ) . '/Maintenance.php' );
 
 class RebuildTextIndex extends Maintenance {
        const RTI_CHUNK_SIZE = 500;
+
+       /**
+        * @var DatabaseBase
+        */
        private $db;
 
        public function __construct() {