This is an old PHP 4-ism; only needed today if you want to be able to replace the singleton with another object by using the reference as an lval. :)
Killing them because they annoy me.
$data = $this->pageDataFromId( $dbr, $this->getId() );
}
- $lc =& LinkCache::singleton();
+ $lc = LinkCache::singleton();
if ( $data ) {
$lc->addGoodLinkObj( $data->page_id, $this->mTitle, $data->page_len, $data->page_is_redirect );
wfProfileIn( __METHOD__ );
- $parserCache =& ParserCache::singleton();
+ $parserCache = ParserCache::singleton();
$ns = $this->mTitle->getNamespace(); # shortcut
# Get variables from query string
# Save it to the parser cache
if ( $wgEnableParserCache ) {
- $parserCache =& ParserCache::singleton();
+ $parserCache = ParserCache::singleton();
$parserCache->save( $editInfo->output, $this, $wgUser );
}
$popts->setTidy(false);
$popts->enableLimitReport( false );
if ( $wgEnableParserCache && $cache && $this && $parserOutput->getCacheTime() != -1 ) {
- $parserCache =& ParserCache::singleton();
+ $parserCache = ParserCache::singleton();
$parserCache->save( $parserOutput, $this, $wgUser );
}
* Return an array mapping PDBK to ID
*/
public function execute() {
- $linkCache =& LinkCache::singleton();
+ $linkCache = LinkCache::singleton();
return $this->executeInto( $linkCache );
}
$popts, true, true, $this->mRevisionId );
$popts->setTidy(false);
if ( $cache && $article && $parserOutput->getCacheTime() != -1 ) {
- $parserCache =& ParserCache::singleton();
+ $parserCache = ParserCache::singleton();
$parserCache->save( $parserOutput, $article, $wgUser );
}
* @return bool True if successful, else false.
*/
public function tryParserCache( &$article, $user ) {
- $parserCache =& ParserCache::singleton();
+ $parserCache = ParserCache::singleton();
$parserOutput = $parserCache->get( $article, $user );
if ( $parserOutput !== false ) {
$this->addParserOutput( $parserOutput );
$text = $this->doDoubleUnderscore( $text );
$text = $this->doHeadings( $text );
if($this->mOptions->getUseDynamicDates()) {
- $df =& DateFormatter::getInstance();
+ $df = DateFormatter::getInstance();
$text = $df->reformat( $this->mOptions->getDateFormat(), $text );
}
$text = $this->doAllQuotes( $text );
# SUBST
wfProfileIn( __METHOD__.'-modifiers' );
if ( !$found ) {
- $mwSubst =& MagicWord::get( 'subst' );
+ $mwSubst = MagicWord::get( 'subst' );
if ( $mwSubst->matchStartAndRemove( $part1 ) xor $this->ot['wiki'] ) {
# One of two possibilities is true:
# 1) Found SUBST but not in the PST phase
# MSG, MSGNW and RAW
if ( !$found ) {
# Check for MSGNW:
- $mwMsgnw =& MagicWord::get( 'msgnw' );
+ $mwMsgnw = MagicWord::get( 'msgnw' );
if ( $mwMsgnw->matchStartAndRemove( $part1 ) ) {
$nowiki = true;
} else {
# Remove obsolete MSG:
- $mwMsg =& MagicWord::get( 'msg' );
+ $mwMsg = MagicWord::get( 'msg' );
$mwMsg->matchStartAndRemove( $part1 );
}
# Check for RAW:
- $mwRaw =& MagicWord::get( 'raw' );
+ $mwRaw = MagicWord::get( 'raw' );
if ( $mwRaw->matchStartAndRemove( $part1 ) ) {
$forceRawInterwiki = true;
}
$colours = array();
$linkcolour_ids = array();
$sk = $this->mOptions->getSkin();
- $linkCache =& LinkCache::singleton();
+ $linkCache = LinkCache::singleton();
if ( !empty( $this->mLinkHolders['namespaces'] ) ) {
wfProfileIn( $fname.'-check' );
$pdbks = array();
$colours = array();
$sk = $this->mOptions->getSkin();
- $linkCache =& LinkCache::singleton();
+ $linkCache = LinkCache::singleton();
if ( !empty( $this->mLinkHolders['namespaces'] ) ) {
wfProfileIn( $fname.'-check' );
global $wgParser;
wfProfileIn( __METHOD__ );
- $linkCache =& LinkCache::singleton();
+ $linkCache = LinkCache::singleton();
$linkCache->clear();
if ( is_null( $this->title ) ) {
}
// avoid memory leak...?
- $linkCache =& LinkCache::singleton();
+ $linkCache = LinkCache::singleton();
$linkCache->clear();
$article = new Article( $this->title );
*/
function verify( $tmpfile, $extension ) {
#magically determine mime type
- $magic=& MimeMagic::singleton();
- $mime= $magic->guessMimeType($tmpfile,false);
+ $magic = MimeMagic::singleton();
+ $mime = $magic->guessMimeType($tmpfile,false);
#check mime type, if desired
global $wgVerifyMimeType;
* @return bool
*/
function verifyExtension( $mime, $extension ) {
- $magic =& MimeMagic::singleton();
+ $magic = MimeMagic::singleton();
if ( ! $mime || $mime == 'unknown' || $mime == 'unknown/unknown' )
if ( ! $magic->isRecognizableExtension( $extension ) ) {
return 'unknown/unknown';
}
else {
- $magic=& MimeMagic::singleton();
+ $magic = MimeMagic::singleton();
return $magic->guessMimeType($filename); //full fancy mime detection
}
}
* @return int the ID
*/
public function getArticleID( $flags = 0 ) {
- $linkCache =& LinkCache::singleton();
+ $linkCache = LinkCache::singleton();
if ( $flags & GAID_FOR_UPDATE ) {
$oldUpdate = $linkCache->forUpdate( true );
$this->mArticleID = $linkCache->addLinkObj( $this );
if( !$this->getArticleID($flags) || $this->getNamespace() == NS_SPECIAL ) {
return false;
}
- $linkCache =& LinkCache::singleton();
+ $linkCache = LinkCache::singleton();
$this->mRedirect = (bool)$linkCache->getGoodLinkFieldObj( $this, 'redirect' );
return $this->mRedirect;
if( !$this->getArticleID($flags) || $this->getNamespace() == NS_SPECIAL ) {
return 0;
}
- $linkCache =& LinkCache::singleton();
+ $linkCache = LinkCache::singleton();
$this->mLength = intval( $linkCache->getGoodLinkFieldObj( $this, 'length' ) );
return $this->mLength;
* @param int $newid the new Article ID
*/
public function resetArticleID( $newid ) {
- $linkCache =& LinkCache::singleton();
+ $linkCache = LinkCache::singleton();
$linkCache->clearBadLink( $this->getPrefixedDBkey() );
if ( 0 == $newid ) { $this->mArticleID = -1; }
* @return array the Title objects linking here
*/
public function getLinksTo( $options = '', $table = 'pagelinks', $prefix = 'pl' ) {
- $linkCache =& LinkCache::singleton();
+ $linkCache = LinkCache::singleton();
if ( $options ) {
$db = wfGetDB( DB_MASTER );
$articleObj = new Article($titleObj);
if(isset($prop['revid']))
$revid = $articleObj->getRevIdFetched();
- $pcache =& ParserCache::singleton();
+ $pcache = ParserCache::singleton();
$p_result = $pcache->get($articleObj, $wgUser);
if(!$p_result) {
$p_result = $wgParser->parse($articleObj->getContent(), $titleObj, new ParserOptions());
} else {
$db = wfGetDB( DB_SLAVE );
}
- $linkCache =& LinkCache::singleton();
+ $linkCache = LinkCache::singleton();
list( $page, $imagelinks ) = $db->tableNamesN( 'page', 'imagelinks' );
$encName = $db->addQuotes( $this->getName() );
),
array( 'page_id' => $row->page_id ),
'cleanupTitles::moveInconsistentPage' );
- $linkCache =& LinkCache::singleton();
+ $linkCache = LinkCache::singleton();
$linkCache->clear();
}
}