aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--includes/FeedUtils.php2
-rw-r--r--includes/ImagePage.php2
-rw-r--r--includes/QueryPage.php2
-rw-r--r--includes/RawPage.php4
-rw-r--r--includes/api/ApiQueryFilearchive.php4
-rw-r--r--includes/api/ApiQueryWatchlist.php8
-rw-r--r--includes/diff/DifferenceEngine.php4
-rw-r--r--includes/filerepo/RepoGroup.php2
-rw-r--r--includes/specials/SpecialBlock.php2
-rw-r--r--includes/specials/SpecialBlockList.php2
-rw-r--r--includes/specials/SpecialConfirmemail.php2
-rw-r--r--includes/specials/SpecialContributions.php6
-rw-r--r--includes/specials/SpecialDeletedContributions.php2
-rw-r--r--includes/specials/SpecialEditWatchlist.php14
-rw-r--r--includes/specials/SpecialEmailuser.php4
-rw-r--r--includes/specials/SpecialExport.php4
-rw-r--r--includes/specials/SpecialFileDuplicateSearch.php4
-rw-r--r--includes/specials/SpecialImport.php4
-rw-r--r--includes/specials/SpecialLog.php6
-rw-r--r--includes/specials/SpecialMergeHistory.php2
-rw-r--r--includes/specials/SpecialMovepage.php6
-rw-r--r--includes/specials/SpecialNewimages.php4
-rw-r--r--includes/specials/SpecialPrefixindex.php4
-rw-r--r--includes/specials/SpecialProtectedtitles.php6
-rw-r--r--includes/specials/SpecialRecentchangeslinked.php3
-rw-r--r--includes/specials/SpecialSearch.php10
-rw-r--r--includes/specials/SpecialStatistics.php12
-rw-r--r--includes/specials/SpecialTags.php3
-rw-r--r--includes/specials/SpecialUnblock.php4
-rw-r--r--includes/specials/SpecialUndelete.php10
-rw-r--r--includes/specials/SpecialUpload.php4
-rw-r--r--includes/specials/SpecialUserlogin.php2
-rw-r--r--includes/specials/SpecialUserrights.php2
-rw-r--r--maintenance/deleteArchivedRevisions.inc2
-rw-r--r--maintenance/dumpIterator.php45
-rw-r--r--maintenance/preprocessorFuzzTest.php3
-rw-r--r--maintenance/rebuildImages.php3
-rw-r--r--maintenance/rebuildtextindex.php4
38 files changed, 109 insertions, 98 deletions
diff --git a/includes/FeedUtils.php b/includes/FeedUtils.php
index 9daffc12f7f6..4502c3a86123 100644
--- a/includes/FeedUtils.php
+++ b/includes/FeedUtils.php
@@ -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 );
diff --git a/includes/ImagePage.php b/includes/ImagePage.php
index ebbe36ca6c1c..e6090f27351e 100644
--- a/includes/ImagePage.php
+++ b/includes/ImagePage.php
@@ -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();
diff --git a/includes/QueryPage.php b/includes/QueryPage.php
index e52669f0084f..da8faf5b147e 100644
--- a/includes/QueryPage.php
+++ b/includes/QueryPage.php
@@ -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,
diff --git a/includes/RawPage.php b/includes/RawPage.php
index ddb91fb50402..28ce7ad6d55e 100644
--- a/includes/RawPage.php
+++ b/includes/RawPage.php
@@ -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 );
}
diff --git a/includes/api/ApiQueryFilearchive.php b/includes/api/ApiQueryFilearchive.php
index 54d5a45cf76f..e746a6c49979 100644
--- a/includes/api/ApiQueryFilearchive.php
+++ b/includes/api/ApiQueryFilearchive.php
@@ -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 ) );
diff --git a/includes/api/ApiQueryWatchlist.php b/includes/api/ApiQueryWatchlist.php
index e5507f622f5d..a5023ea30dec 100644
--- a/includes/api/ApiQueryWatchlist.php
+++ b/includes/api/ApiQueryWatchlist.php
@@ -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 ) {
diff --git a/includes/diff/DifferenceEngine.php b/includes/diff/DifferenceEngine.php
index 4e8194aaa384..f0345c4cc954 100644
--- a/includes/diff/DifferenceEngine.php
+++ b/includes/diff/DifferenceEngine.php
@@ -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(
diff --git a/includes/filerepo/RepoGroup.php b/includes/filerepo/RepoGroup.php
index 59407cf2e8c5..d48759088495 100644
--- a/includes/filerepo/RepoGroup.php
+++ b/includes/filerepo/RepoGroup.php
@@ -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' );
diff --git a/includes/specials/SpecialBlock.php b/includes/specials/SpecialBlock.php
index 299d758435f0..f95d61af327a 100644
--- a/includes/specials/SpecialBlock.php
+++ b/includes/specials/SpecialBlock.php
@@ -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' ) );
diff --git a/includes/specials/SpecialBlockList.php b/includes/specials/SpecialBlockList.php
index 00b47b45a891..d192fad6a3bf 100644
--- a/includes/specials/SpecialBlockList.php
+++ b/includes/specials/SpecialBlockList.php
@@ -225,7 +225,7 @@ class BlockListPager extends TablePager {
static $sk, $msg;
if ( empty( $sk ) ) {
- $sk = $wgUser->getSkin();
+ $sk = $this->getSkin();
$msg = array(
'anononlyblock',
'createaccountblock',
diff --git a/includes/specials/SpecialConfirmemail.php b/includes/specials/SpecialConfirmemail.php
index 2370b6bbce63..b8dfaba97d0b 100644
--- a/includes/specials/SpecialConfirmemail.php
+++ b/includes/specials/SpecialConfirmemail.php
@@ -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' ),
diff --git a/includes/specials/SpecialContributions.php b/includes/specials/SpecialContributions.php
index fe0e10c4f940..1b5360c175de 100644
--- a/includes/specials/SpecialContributions.php
+++ b/includes/specials/SpecialContributions.php
@@ -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() );
diff --git a/includes/specials/SpecialDeletedContributions.php b/includes/specials/SpecialDeletedContributions.php
index 221a0102a8ec..32ed62b74f07 100644
--- a/includes/specials/SpecialDeletedContributions.php
+++ b/includes/specials/SpecialDeletedContributions.php
@@ -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() );
diff --git a/includes/specials/SpecialEditWatchlist.php b/includes/specials/SpecialEditWatchlist.php
index 47576e3523e0..9255bc7581c6 100644
--- a/includes/specials/SpecialEditWatchlist.php
+++ b/includes/specials/SpecialEditWatchlist.php
@@ -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
+}
diff --git a/includes/specials/SpecialEmailuser.php b/includes/specials/SpecialEmailuser.php
index b3ba9c5cf588..90cfe10b71af 100644
--- a/includes/specials/SpecialEmailuser.php
+++ b/includes/specials/SpecialEmailuser.php
@@ -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() )
),
diff --git a/includes/specials/SpecialExport.php b/includes/specials/SpecialExport.php
index 3ecf40e63879..8968ec2748ad 100644
--- a/includes/specials/SpecialExport.php
+++ b/includes/specials/SpecialExport.php
@@ -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 );
diff --git a/includes/specials/SpecialFileDuplicateSearch.php b/includes/specials/SpecialFileDuplicateSearch.php
index 93d2f5592263..be655813b0ae 100644
--- a/includes/specials/SpecialFileDuplicateSearch.php
+++ b/includes/specials/SpecialFileDuplicateSearch.php
@@ -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 );
diff --git a/includes/specials/SpecialImport.php b/includes/specials/SpecialImport.php
index 47ca49725bea..e41685db4554 100644
--- a/includes/specials/SpecialImport.php
+++ b/includes/specials/SpecialImport.php
@@ -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++;
diff --git a/includes/specials/SpecialLog.php b/includes/specials/SpecialLog.php
index e34a341ce90a..d8f6d8cff021 100644
--- a/includes/specials/SpecialLog.php
+++ b/includes/specials/SpecialLog.php
@@ -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
diff --git a/includes/specials/SpecialMergeHistory.php b/includes/specials/SpecialMergeHistory.php
index 916230ca9867..f9c4a2c2a7d6 100644
--- a/includes/specials/SpecialMergeHistory.php
+++ b/includes/specials/SpecialMergeHistory.php
@@ -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' ) );
diff --git a/includes/specials/SpecialMovepage.php b/includes/specials/SpecialMovepage.php
index 61ae7085c095..11095fba58fc 100644
--- a/includes/specials/SpecialMovepage.php
+++ b/includes/specials/SpecialMovepage.php
@@ -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 ) {
diff --git a/includes/specials/SpecialNewimages.php b/includes/specials/SpecialNewimages.php
index 9246fb183090..52dfef1e2e77 100644
--- a/includes/specials/SpecialNewimages.php
+++ b/includes/specials/SpecialNewimages.php
@@ -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();
}
diff --git a/includes/specials/SpecialPrefixindex.php b/includes/specials/SpecialPrefixindex.php
index a9015b10cfc1..ad2bb746f76d 100644
--- a/includes/specials/SpecialPrefixindex.php
+++ b/includes/specials/SpecialPrefixindex.php
@@ -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;
diff --git a/includes/specials/SpecialProtectedtitles.php b/includes/specials/SpecialProtectedtitles.php
index e347894ff4aa..c768b3e2ba6f 100644
--- a/includes/specials/SpecialProtectedtitles.php
+++ b/includes/specials/SpecialProtectedtitles.php
@@ -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 );
diff --git a/includes/specials/SpecialRecentchangeslinked.php b/includes/specials/SpecialRecentchangeslinked.php
index 66eeadb3288d..01de43670813 100644
--- a/includes/specials/SpecialRecentchangeslinked.php
+++ b/includes/specials/SpecialRecentchangeslinked.php
@@ -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,
diff --git a/includes/specials/SpecialSearch.php b/includes/specials/SpecialSearch.php
index 7cea88650ab8..2b1ce5686c0c 100644
--- a/includes/specials/SpecialSearch.php
+++ b/includes/specials/SpecialSearch.php
@@ -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);
diff --git a/includes/specials/SpecialStatistics.php b/includes/specials/SpecialStatistics.php
index fd23968c8d5b..88e7b57bb6e6 100644
--- a/includes/specials/SpecialStatistics.php
+++ b/includes/specials/SpecialStatistics.php
@@ -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(
diff --git a/includes/specials/SpecialTags.php b/includes/specials/SpecialTags.php
index add54c1b9276..66a89e94a792 100644
--- a/includes/specials/SpecialTags.php
+++ b/includes/specials/SpecialTags.php
@@ -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 ) ) {
diff --git a/includes/specials/SpecialUnblock.php b/includes/specials/SpecialUnblock.php
index cef5c2ba5de7..8974c5d18df5 100644
--- a/includes/specials/SpecialUnblock.php
+++ b/includes/specials/SpecialUnblock.php
@@ -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()
diff --git a/includes/specials/SpecialUndelete.php b/includes/specials/SpecialUndelete.php
index 18c558c03904..29c8034cb108 100644
--- a/includes/specials/SpecialUndelete.php
+++ b/includes/specials/SpecialUndelete.php
@@ -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...?
diff --git a/includes/specials/SpecialUpload.php b/includes/specials/SpecialUpload.php
index 5f8f88f04f88..34653f28feef 100644
--- a/includes/specials/SpecialUpload.php
+++ b/includes/specials/SpecialUpload.php
@@ -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'],
diff --git a/includes/specials/SpecialUserlogin.php b/includes/specials/SpecialUserlogin.php
index bbd602a2a932..b0e435e4d8a8 100644
--- a/includes/specials/SpecialUserlogin.php
+++ b/includes/specials/SpecialUserlogin.php
@@ -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 ),
diff --git a/includes/specials/SpecialUserrights.php b/includes/specials/SpecialUserrights.php
index 41b1fb9d2b8d..483baf098bff 100644
--- a/includes/specials/SpecialUserrights.php
+++ b/includes/specials/SpecialUserrights.php
@@ -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" .
diff --git a/maintenance/deleteArchivedRevisions.inc b/maintenance/deleteArchivedRevisions.inc
index 10bd4cff6e75..7628985cb450 100644
--- a/maintenance/deleteArchivedRevisions.inc
+++ b/maintenance/deleteArchivedRevisions.inc
@@ -54,4 +54,4 @@ class DeleteArchivedRevisionsImplementation {
$maint->purgeRedundantText( true );
}
}
-} \ No newline at end of file
+}
diff --git a/maintenance/dumpIterator.php b/maintenance/dumpIterator.php
index 11c132ae637d..470bc56eb2a3 100644
--- a/maintenance/dumpIterator.php
+++ b/maintenance/dumpIterator.php
@@ -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" );
diff --git a/maintenance/preprocessorFuzzTest.php b/maintenance/preprocessorFuzzTest.php
index 55ca8e388ecd..9dee67e258e3 100644
--- a/maintenance/preprocessorFuzzTest.php
+++ b/maintenance/preprocessorFuzzTest.php
@@ -154,6 +154,9 @@ class PPFuzzTest {
$this->templates = array();
}
+ /**
+ * @param $title Title
+ */
function templateHook( $title ) {
$titleText = $title->getPrefixedDBkey();
diff --git a/maintenance/rebuildImages.php b/maintenance/rebuildImages.php
index 55f93d7bd0d6..171118312213 100644
--- a/maintenance/rebuildImages.php
+++ b/maintenance/rebuildImages.php
@@ -67,6 +67,9 @@ class ImageBuilder extends Maintenance {
}
}
+ /**
+ * @return FileRepo
+ */
function getRepo() {
if ( !isset( $this->repo ) ) {
$this->repo = RepoGroup::singleton()->getLocalRepo();
diff --git a/maintenance/rebuildtextindex.php b/maintenance/rebuildtextindex.php
index b0934eb12023..04606c757c24 100644
--- a/maintenance/rebuildtextindex.php
+++ b/maintenance/rebuildtextindex.php
@@ -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() {