From f88c771756c580442fe7ca2f84bcbb8067b77f57 Mon Sep 17 00:00:00 2001 From: Nick Jenkins Date: Mon, 22 Jan 2007 23:50:42 +0000 Subject: [PATCH] The war on redundant ampersand usage! * Convert "$dbw =& wfGetDB( DB_MASTER );" --> "$dbw = wfGetDB( DB_MASTER );" * convert "$skin =& $wgUser->getSkin();" --> "$skin = $wgUser->getSkin();" For the time being have not changed the function definitions of wfGetDB() or User::getSkin() [i.e. they are still both return-by-ref], so as to ensure the interface does not change for extensions [some of which may still be trying to run on PHP4 environments]. However presumably at some point this can be changed too. Also includes tiny tweak to newlines in parserTests - will show 1 rather than 2 newlines between the "Reading tests from" strings when in quiet mode. --- includes/AjaxFunctions.php | 6 +-- includes/Article.php | 56 +++++++++++----------- includes/BagOStuff.php | 20 ++++---- includes/Block.php | 22 ++++----- includes/CacheDependency.php | 2 +- includes/CategoryPage.php | 4 +- includes/Categoryfinder.php | 2 +- includes/ChangesList.php | 2 +- includes/DatabaseFunctions.php | 52 ++++++++++---------- includes/EditPage.php | 6 +-- includes/HTMLCacheUpdate.php | 6 +-- includes/HistoryBlob.php | 4 +- includes/Image.php | 20 ++++---- includes/ImageGallery.php | 6 +-- includes/ImagePage.php | 2 +- includes/JobQueue.php | 6 +-- includes/LinkBatch.php | 2 +- includes/LinkCache.php | 4 +- includes/Linker.php | 4 +- includes/LinksUpdate.php | 4 +- includes/LogPage.php | 2 +- includes/Math.php | 4 +- includes/MessageCache.php | 2 +- includes/OutputPage.php | 4 +- includes/PageHistory.php | 6 +-- includes/Parser.php | 26 +++++----- includes/ParserOptions.php | 2 +- includes/Profiler.php | 2 +- includes/QueryPage.php | 8 ++-- includes/RecentChange.php | 6 +-- includes/Revision.php | 20 ++++---- includes/SearchMySQL.php | 4 +- includes/SearchMySQL4.php | 4 +- includes/SearchPostgres.php | 6 +-- includes/SearchTsearch2.php | 14 +++--- includes/SiteStats.php | 10 ++-- includes/Skin.php | 4 +- includes/SkinTemplate.php | 2 +- includes/SpecialAllmessages.php | 4 +- includes/SpecialAllpages.php | 6 +-- includes/SpecialAncientpages.php | 2 +- includes/SpecialBrokenRedirects.php | 2 +- includes/SpecialCategories.php | 2 +- includes/SpecialContributions.php | 2 +- includes/SpecialDeadendpages.php | 2 +- includes/SpecialDisambiguations.php | 2 +- includes/SpecialDoubleRedirects.php | 4 +- includes/SpecialExport.php | 2 +- includes/SpecialImagelist.php | 2 +- includes/SpecialImport.php | 4 +- includes/SpecialListredirects.php | 2 +- includes/SpecialListusers.php | 4 +- includes/SpecialLog.php | 4 +- includes/SpecialLonelypages.php | 2 +- includes/SpecialMIMEsearch.php | 2 +- includes/SpecialMostcategories.php | 2 +- includes/SpecialMostimages.php | 2 +- includes/SpecialMostlinked.php | 2 +- includes/SpecialMostlinkedcategories.php | 2 +- includes/SpecialMostrevisions.php | 2 +- includes/SpecialNewimages.php | 2 +- includes/SpecialNewpages.php | 2 +- includes/SpecialPopularpages.php | 2 +- includes/SpecialPrefixindex.php | 2 +- includes/SpecialRandompage.php | 2 +- includes/SpecialRandomredirect.php | 2 +- includes/SpecialRecentchanges.php | 2 +- includes/SpecialRecentchangeslinked.php | 2 +- includes/SpecialSearch.php | 2 +- includes/SpecialShortpages.php | 2 +- includes/SpecialStatistics.php | 4 +- includes/SpecialUncategorizedimages.php | 2 +- includes/SpecialUncategorizedpages.php | 2 +- includes/SpecialUnusedcategories.php | 2 +- includes/SpecialUnusedimages.php | 2 +- includes/SpecialUnusedtemplates.php | 2 +- includes/SpecialUnwatchedpages.php | 2 +- includes/SpecialUpload.php | 2 +- includes/SpecialUserlogin.php | 2 +- includes/SpecialVersion.php | 2 +- includes/SpecialWantedcategories.php | 2 +- includes/SpecialWantedpages.php | 2 +- includes/SpecialWatchlist.php | 8 ++-- includes/SpecialWhatlinkshere.php | 4 +- includes/SquidUpdate.php | 2 +- includes/Title.php | 48 +++++++++---------- includes/User.php | 42 ++++++++-------- includes/UserMailer.php | 4 +- includes/WatchedItem.php | 8 ++-- includes/Wiki.php | 4 +- includes/api/ApiPageSet.php | 10 ++-- includes/api/ApiQuery.php | 4 +- includes/api/ApiQueryAllpages.php | 2 +- includes/api/ApiQueryBacklinks.php | 2 +- includes/api/ApiQueryLogEvents.php | 2 +- includes/api/ApiQueryRecentChanges.php | 2 +- includes/api/ApiQueryRevisions.php | 2 +- includes/api/ApiQueryUserContributions.php | 2 +- install-utils.inc | 6 +-- maintenance/addwiki.php | 2 +- maintenance/attachLatest.php | 2 +- maintenance/attribute.php | 2 +- maintenance/backup.inc | 2 +- maintenance/changePassword.php | 2 +- maintenance/checkUsernames.php | 2 +- maintenance/cleanupDupes.inc | 4 +- maintenance/cleanupSpam.php | 6 +-- maintenance/cleanupTitles.php | 4 +- maintenance/cleanupWatchlist.php | 2 +- maintenance/clear_interwiki_cache.php | 2 +- maintenance/convertLinks.inc | 2 +- maintenance/deleteBatch.php | 2 +- maintenance/deleteDefaultMessages.php | 4 +- maintenance/deleteImageMemcached.php | 4 +- maintenance/deleteOldRevisions.inc | 2 +- maintenance/deleteOrphanedRevisions.php | 2 +- maintenance/deleteRevision.php | 2 +- maintenance/dumpHTML.inc | 8 ++-- maintenance/dumpHTML.php | 4 +- maintenance/dumpLinks.php | 2 +- maintenance/dumpReplayLog.php | 6 +-- maintenance/fixSlaveDesync.php | 16 +++---- maintenance/fixTimestamps.php | 2 +- maintenance/fixUserRegistration.php | 4 +- maintenance/generateSitemap.php | 2 +- maintenance/importLogs.inc | 2 +- maintenance/moveBatch.php | 2 +- maintenance/namespaceDupes.php | 2 +- maintenance/nukeNS.php | 2 +- maintenance/nukePage.inc | 4 +- maintenance/orphans.php | 6 +-- maintenance/parserTests.inc | 10 ++-- maintenance/purgeOldText.inc | 2 +- maintenance/reassignEdits.inc.php | 2 +- maintenance/rebuildInterwiki.inc | 2 +- maintenance/rebuildrecentchanges.inc | 4 +- maintenance/refreshImageCount.php | 2 +- maintenance/refreshLinks.inc | 6 +-- maintenance/removeUnusedAccounts.inc | 2 +- maintenance/removeUnusedAccounts.php | 4 +- maintenance/runJobs.php | 2 +- maintenance/showJobs.php | 2 +- maintenance/showStats.php | 2 +- maintenance/storage/checkStorage.php | 12 ++--- maintenance/storage/compressOld.inc | 8 ++-- maintenance/storage/dumpRev.php | 4 +- maintenance/storage/moveToExternal.php | 6 +-- maintenance/storage/resolveStubs.php | 6 +-- maintenance/updateArticleCount.inc.php | 2 +- maintenance/updateArticleCount.php | 2 +- maintenance/updateSearchIndex.inc | 2 +- maintenance/updateSpecialPages.php | 4 +- maintenance/userDupes.php | 2 +- skins/disabled/HTMLDump.php | 2 +- skins/disabled/MonoBookCBT.php | 2 +- trackback.php | 2 +- 156 files changed, 409 insertions(+), 407 deletions(-) diff --git a/includes/AjaxFunctions.php b/includes/AjaxFunctions.php index 600cd573ed..5f906a33eb 100644 --- a/includes/AjaxFunctions.php +++ b/includes/AjaxFunctions.php @@ -81,7 +81,7 @@ function wfSajaxSearch( $term ) { if ( strlen( str_replace( '_', '', $term ) )<3 ) return; - $db =& wfGetDB( DB_SLAVE ); + $db = wfGetDB( DB_SLAVE ); $res = $db->select( 'page', 'page_title', array( 'page_namespace' => 0, "page_title LIKE '". $db->strencode( $term) ."%'" ), @@ -152,14 +152,14 @@ function wfAjaxWatch($pageID = "", $watch = "") { if($watch) { if(!$watching) { - $dbw =& wfGetDB(DB_MASTER); + $dbw = wfGetDB(DB_MASTER); $dbw->begin(); $article->doWatch(); $dbw->commit(); } } else { if($watching) { - $dbw =& wfGetDB(DB_MASTER); + $dbw = wfGetDB(DB_MASTER); $dbw->begin(); $article->doUnwatch(); $dbw->commit(); diff --git a/includes/Article.php b/includes/Article.php index 2d7504cc0e..122558bdd6 100644 --- a/includes/Article.php +++ b/includes/Article.php @@ -245,7 +245,7 @@ class Article { * @param array $conditions * @private */ - function pageData( &$dbr, $conditions ) { + function pageData( $dbr, $conditions ) { $fields = array( 'page_id', 'page_namespace', @@ -271,7 +271,7 @@ class Article { * @param Database $dbr * @param Title $title */ - function pageDataFromTitle( &$dbr, $title ) { + function pageDataFromTitle( $dbr, $title ) { return $this->pageData( $dbr, array( 'page_namespace' => $title->getNamespace(), 'page_title' => $title->getDBkey() ) ); @@ -281,7 +281,7 @@ class Article { * @param Database $dbr * @param int $id */ - function pageDataFromId( &$dbr, $id ) { + function pageDataFromId( $dbr, $id ) { return $this->pageData( $dbr, array( 'page_id' => $id ) ); } @@ -294,7 +294,7 @@ class Article { */ function loadPageData( $data = 'fromdb' ) { if ( $data === 'fromdb' ) { - $dbr =& $this->getDB(); + $dbr = $this->getDB(); $data = $this->pageDataFromId( $dbr, $this->getId() ); } @@ -332,7 +332,7 @@ class Article { return $this->mContent; } - $dbr =& $this->getDB(); + $dbr = $this->getDB(); # Pre-fill content with error message so that if something # fails we'll have something telling us what we intended. @@ -404,7 +404,7 @@ class Article { * * @return Database */ - function &getDB() { + function getDB() { return wfGetDB( DB_MASTER ); } @@ -453,7 +453,7 @@ class Article { if ( $id == 0 ) { $this->mCounter = 0; } else { - $dbr =& wfGetDB( DB_SLAVE ); + $dbr = wfGetDB( DB_SLAVE ); $this->mCounter = $dbr->selectField( 'page', 'page_counter', array( 'page_id' => $id ), 'Article::getCount', $this->getSelectOptions() ); } @@ -571,7 +571,7 @@ class Article { # XXX: this is expensive; cache this info somewhere. $contribs = array(); - $dbr =& wfGetDB( DB_SLAVE ); + $dbr = wfGetDB( DB_SLAVE ); $revTable = $dbr->tableName( 'revision' ); $userTable = $dbr->tableName( 'user' ); $user = $this->getUser(); @@ -859,7 +859,7 @@ class Article { function addTrackbacks() { global $wgOut, $wgUser; - $dbr =& wfGetDB(DB_SLAVE); + $dbr = wfGetDB(DB_SLAVE); $tbs = $dbr->select( /* FROM */ 'trackbacks', /* SELECT */ array('tb_id', 'tb_title', 'tb_url', 'tb_ex', 'tb_name'), @@ -905,7 +905,7 @@ class Article { return; } - $db =& wfGetDB(DB_MASTER); + $db = wfGetDB(DB_MASTER); $db->delete('trackbacks', array('tb_id' => $wgRequest->getInt('tbid'))); $wgTitle->invalidateCache(); $wgOut->addWikiText(wfMsg('trackbackdeleteok')); @@ -1139,7 +1139,7 @@ class Article { if( is_null( $edittime ) ) { $rev = Revision::newFromTitle( $this->mTitle ); } else { - $dbw =& wfGetDB( DB_MASTER ); + $dbw = wfGetDB( DB_MASTER ); $rev = Revision::loadFromTimestamp( $dbw, $this->mTitle, $edittime ); } if( is_null( $rev ) ) { @@ -1182,7 +1182,7 @@ class Article { $this->doEdit( $text, $summary, $flags ); - $dbw =& wfGetDB( DB_MASTER ); + $dbw = wfGetDB( DB_MASTER ); if ($watchthis) { if (!$this->mTitle->userIsWatching()) { $dbw->begin(); @@ -1209,7 +1209,7 @@ class Article { $good = $this->doEdit( $text, $summary, $flags ); if ( $good ) { - $dbw =& wfGetDB( DB_MASTER ); + $dbw = wfGetDB( DB_MASTER ); if ($watchthis) { if (!$this->mTitle->userIsWatching()) { $dbw->begin(); @@ -1301,7 +1301,7 @@ class Article { $text = $this->preSaveTransform( $text ); $newsize = strlen( $text ); - $dbw =& wfGetDB( DB_MASTER ); + $dbw = wfGetDB( DB_MASTER ); $now = wfTimestampNow(); if ( $flags & EDIT_UPDATE ) { @@ -1684,7 +1684,7 @@ class Article { if( $changed ) { if( wfRunHooks( 'ArticleProtect', array( &$this, &$wgUser, $limit, $reason ) ) ) { - $dbw =& wfGetDB( DB_MASTER ); + $dbw = wfGetDB( DB_MASTER ); # Prepare a null revision to be added to the history $comment = $wgContLang->ucfirst( wfMsgForContent( $protect ? 'protectedarticle' : 'unprotectedarticle', $this->mTitle->getPrefixedText() ) ); @@ -1799,7 +1799,7 @@ class Article { $wgOut->setPagetitle( wfMsg( 'confirmdelete' ) ); # Better double-check that it hasn't been deleted yet! - $dbw =& wfGetDB( DB_MASTER ); + $dbw = wfGetDB( DB_MASTER ); $conds = $this->mTitle->pageCond(); $latest = $dbw->selectField( 'page', 'page_latest', $conds, __METHOD__ ); if ( $latest === false ) { @@ -1901,7 +1901,7 @@ class Article { // First try the slave // If that doesn't have the latest revision, try the master $continue = 2; - $db =& wfGetDB( DB_SLAVE ); + $db = wfGetDB( DB_SLAVE ); do { $res = $db->select( array( 'page', 'revision' ), array( 'rev_id', 'rev_user_text' ), @@ -1920,7 +1920,7 @@ class Article { } $row = $db->fetchObject( $res ); if ( $continue == 2 && $revLatest && $row->rev_id != $revLatest ) { - $db =& wfGetDB( DB_MASTER ); + $db = wfGetDB( DB_MASTER ); $continue--; } else { $continue = 0; @@ -2021,7 +2021,7 @@ class Article { wfDebug( __METHOD__."\n" ); - $dbw =& wfGetDB( DB_MASTER ); + $dbw = wfGetDB( DB_MASTER ); $ns = $this->mTitle->getNamespace(); $t = $this->mTitle->getDBkey(); $id = $this->mTitle->getArticleID(); @@ -2133,7 +2133,7 @@ class Article { $wgOut->addWikiText( wfMsg( 'sessionfailure' ) ); return; } - $dbw =& wfGetDB( DB_MASTER ); + $dbw = wfGetDB( DB_MASTER ); # Enhanced rollback, marks edits rc_bot=1 $bot = $wgRequest->getBool( 'bot' ); @@ -2277,7 +2277,7 @@ class Article { # Periodically flush old entries from the recentchanges table. global $wgRCMaxAge; - $dbw =& wfGetDB( DB_MASTER ); + $dbw = wfGetDB( DB_MASTER ); $cutoff = $dbw->timestamp( time() - $wgRCMaxAge ); $recentchanges = $dbw->tableName( 'recentchanges' ); $sql = "DELETE FROM $recentchanges WHERE rc_timestamp < '{$cutoff}'"; @@ -2501,7 +2501,7 @@ class Article { function quickEdit( $text, $comment = '', $minor = 0 ) { wfProfileIn( __METHOD__ ); - $dbw =& wfGetDB( DB_MASTER ); + $dbw = wfGetDB( DB_MASTER ); $dbw->begin(); $revision = new Revision( array( 'page' => $this->getId(), @@ -2526,7 +2526,7 @@ class Article { $id = intval( $id ); global $wgHitcounterUpdateFreq, $wgDBtype; - $dbw =& wfGetDB( DB_MASTER ); + $dbw = wfGetDB( DB_MASTER ); $pageTable = $dbw->tableName( 'page' ); $hitcounterTable = $dbw->tableName( 'hitcounter' ); $acchitsTable = $dbw->tableName( 'acchits' ); @@ -2672,7 +2672,7 @@ class Article { $wgOut->addHTML(wfMsg( $wgUser->isLoggedIn() ? 'noarticletext' : 'noarticletextanon' ) ); } } else { - $dbr =& wfGetDB( DB_SLAVE ); + $dbr = wfGetDB( DB_SLAVE ); $wl_clause = array( 'wl_title' => $page->getDBkey(), 'wl_namespace' => $page->getNamespace() ); @@ -2714,7 +2714,7 @@ class Article { return false; } - $dbr =& wfGetDB( DB_SLAVE ); + $dbr = wfGetDB( DB_SLAVE ); $rev_clause = array( 'rev_page' => $id ); @@ -2748,7 +2748,7 @@ class Article { return array(); } - $dbr =& wfGetDB( DB_SLAVE ); + $dbr = wfGetDB( DB_SLAVE ); $res = $dbr->select( array( 'templatelinks' ), array( 'tl_namespace', 'tl_title' ), array( 'tl_from' => $id ), @@ -2875,7 +2875,7 @@ class Article { $tlTemplates = array(); - $dbr =& wfGetDB( DB_SLAVE ); + $dbr = wfGetDB( DB_SLAVE ); $res = $dbr->select( array( 'templatelinks' ), array( 'tl_namespace', 'tl_title' ), array( 'tl_from' => $id ), @@ -2906,7 +2906,7 @@ class Article { # Whee, link updates time. $u = new LinksUpdate( $this->mTitle, $parserOutput ); - $dbw =& wfGetDb( DB_MASTER ); + $dbw = wfGetDb( DB_MASTER ); $dbw->begin(); $u->doUpdate(); diff --git a/includes/BagOStuff.php b/includes/BagOStuff.php index a958d41ebc..7b7aaab45c 100644 --- a/includes/BagOStuff.php +++ b/includes/BagOStuff.php @@ -387,24 +387,24 @@ class MediaWikiBagOStuff extends SqlBagOStuff { var $tableInitialised = false; function _doquery($sql) { - $dbw =& wfGetDB( DB_MASTER ); + $dbw = wfGetDB( DB_MASTER ); return $dbw->query($sql, 'MediaWikiBagOStuff::_doquery'); } function _doinsert($t, $v) { - $dbw =& wfGetDB( DB_MASTER ); + $dbw = wfGetDB( DB_MASTER ); return $dbw->insert($t, $v, 'MediaWikiBagOStuff::_doinsert', array( 'IGNORE' ) ); } function _fetchobject($result) { - $dbw =& wfGetDB( DB_MASTER ); + $dbw = wfGetDB( DB_MASTER ); return $dbw->fetchObject($result); } function _freeresult($result) { - $dbw =& wfGetDB( DB_MASTER ); + $dbw = wfGetDB( DB_MASTER ); return $dbw->freeResult($result); } function _dberror($result) { - $dbw =& wfGetDB( DB_MASTER ); + $dbw = wfGetDB( DB_MASTER ); return $dbw->lastError(); } function _maxdatetime() { @@ -415,24 +415,24 @@ class MediaWikiBagOStuff extends SqlBagOStuff { } } function _fromunixtime($ts) { - $dbw =& wfGetDB(DB_MASTER); + $dbw = wfGetDB(DB_MASTER); return $dbw->timestamp($ts); } function _strencode($s) { - $dbw =& wfGetDB( DB_MASTER ); + $dbw = wfGetDB( DB_MASTER ); return $dbw->strencode($s); } function _blobencode($s) { - $dbw =& wfGetDB( DB_MASTER ); + $dbw = wfGetDB( DB_MASTER ); return $dbw->encodeBlob($s); } function _blobdecode($s) { - $dbw =& wfGetDB( DB_MASTER ); + $dbw = wfGetDB( DB_MASTER ); return $dbw->decodeBlob($s); } function getTableName() { if ( !$this->tableInitialised ) { - $dbw =& wfGetDB( DB_MASTER ); + $dbw = wfGetDB( DB_MASTER ); /* This is actually a hack, we should be able to use Language classes here... or not */ if (!$dbw) diff --git a/includes/Block.php b/includes/Block.php index 5645ed3c1d..29a8b9dfba 100644 --- a/includes/Block.php +++ b/includes/Block.php @@ -56,7 +56,7 @@ class Block static function newFromID( $id ) { - $dbr =& wfGetDB( DB_SLAVE ); + $dbr = wfGetDB( DB_SLAVE ); $res = $dbr->resultObject( $dbr->select( 'ipblocks', '*', array( 'ipb_id' => $id ), __METHOD__ ) ); $block = new Block; @@ -83,14 +83,14 @@ class Block { global $wgAntiLockFlags; if ( $this->mForUpdate || $this->mFromMaster ) { - $db =& wfGetDB( DB_MASTER ); + $db = wfGetDB( DB_MASTER ); if ( !$this->mForUpdate || ($wgAntiLockFlags & ALF_NO_BLOCK_LOCK) ) { $options = array(); } else { $options = array( 'FOR UPDATE' ); } } else { - $db =& wfGetDB( DB_SLAVE ); + $db = wfGetDB( DB_SLAVE ); $options = array(); } return $db; @@ -284,7 +284,7 @@ class Block $block = new Block(); if ( $flags & Block::EB_FOR_UPDATE ) { - $db =& wfGetDB( DB_MASTER ); + $db = wfGetDB( DB_MASTER ); if ( $wgAntiLockFlags & ALF_NO_BLOCK_LOCK ) { $options = ''; } else { @@ -292,7 +292,7 @@ class Block } $block->forUpdate( true ); } else { - $db =& wfGetDB( DB_SLAVE ); + $db = wfGetDB( DB_SLAVE ); $options = ''; } if ( $flags & Block::EB_RANGE_ONLY ) { @@ -339,7 +339,7 @@ class Block throw new MWException( "Block::delete() now requires that the mId member be filled\n" ); } - $dbw =& wfGetDB( DB_MASTER ); + $dbw = wfGetDB( DB_MASTER ); $dbw->delete( 'ipblocks', array( 'ipb_id' => $this->mId ), __METHOD__ ); return $dbw->affectedRows() > 0; } @@ -351,7 +351,7 @@ class Block function insert() { wfDebug( "Block::insert; timestamp {$this->mTimestamp}\n" ); - $dbw =& wfGetDB( DB_MASTER ); + $dbw = wfGetDB( DB_MASTER ); $dbw->begin(); # Unset ipb_anon_only for user blocks, makes no sense @@ -428,7 +428,7 @@ class Block */ function doAutoblock( $autoblockip ) { # Check if this IP address is already blocked - $dbw =& wfGetDB( DB_MASTER ); + $dbw = wfGetDB( DB_MASTER ); $dbw->begin(); # If autoblocks are disabled, go away. @@ -542,7 +542,7 @@ class Block $this->mTimestamp = wfTimestamp(); $this->mExpiry = Block::getAutoblockExpiry( $this->mTimestamp ); - $dbw =& wfGetDB( DB_MASTER ); + $dbw = wfGetDB( DB_MASTER ); $dbw->update( 'ipblocks', array( /* SET */ 'ipb_timestamp' => $dbw->timestamp($this->mTimestamp), @@ -644,7 +644,7 @@ class Block * Purge expired blocks from the ipblocks table */ static function purgeExpired() { - $dbw =& wfGetDB( DB_MASTER ); + $dbw = wfGetDB( DB_MASTER ); $dbw->delete( 'ipblocks', array( 'ipb_expiry < ' . $dbw->addQuotes( $dbw->timestamp() ) ), __METHOD__ ); } @@ -656,7 +656,7 @@ class Block /* static $infinity; if ( !isset( $infinity ) ) { - $dbr =& wfGetDB( DB_SLAVE ); + $dbr = wfGetDB( DB_SLAVE ); $infinity = $dbr->bigTimestamp(); } return $infinity; diff --git a/includes/CacheDependency.php b/includes/CacheDependency.php index 4bb3d32868..5d849f5f1e 100644 --- a/includes/CacheDependency.php +++ b/includes/CacheDependency.php @@ -244,7 +244,7 @@ class TitleListDependency extends CacheDependency { # Do the query if ( count( $timestamps ) ) { - $dbr =& wfGetDB( DB_SLAVE ); + $dbr = wfGetDB( DB_SLAVE ); $where = $this->getLinkBatch()->constructSet( 'page', $dbr ); $res = $dbr->select( 'page', array( 'page_namespace', 'page_title', 'page_touched' ), diff --git a/includes/CategoryPage.php b/includes/CategoryPage.php index 65aa1f184e..13610a9e68 100644 --- a/includes/CategoryPage.php +++ b/includes/CategoryPage.php @@ -181,7 +181,7 @@ class CategoryViewer { } function doCategoryQuery() { - $dbr =& wfGetDB( DB_SLAVE ); + $dbr = wfGetDB( DB_SLAVE ); if( $this->from != '' ) { $pageCondition = 'cl_sortkey >= ' . $dbr->addQuotes( $this->from ); $this->flip = false; @@ -397,7 +397,7 @@ class CategoryViewer { */ function pagingLinks( $title, $first, $last, $limit, $query = array() ) { global $wgUser, $wgLang; - $sk =& $this->getSkin(); + $sk = $this->getSkin(); $limitText = $wgLang->formatNum( $limit ); $prevLink = htmlspecialchars( wfMsg( 'prevn', $limitText ) ); diff --git a/includes/Categoryfinder.php b/includes/Categoryfinder.php index 0aaf157546..773c6b2837 100644 --- a/includes/Categoryfinder.php +++ b/includes/Categoryfinder.php @@ -64,7 +64,7 @@ class Categoryfinder { @return array of page_ids (those given to seed() that match the conditions) */ function run () { - $this->dbr =& wfGetDB( DB_SLAVE ); + $this->dbr = wfGetDB( DB_SLAVE ); while ( count ( $this->next ) > 0 ) { $this->scan_next_layer () ; } diff --git a/includes/ChangesList.php b/includes/ChangesList.php index 4d08addcbb..8f0ec8ef83 100644 --- a/includes/ChangesList.php +++ b/includes/ChangesList.php @@ -43,7 +43,7 @@ class ChangesList { * @return ChangesList derivative */ public static function newFromUser( &$user ) { - $sk =& $user->getSkin(); + $sk = $user->getSkin(); $list = NULL; if( wfRunHooks( 'FetchChangesList', array( &$user, &$sk, &$list ) ) ) { return $user->getOption( 'usenewrc' ) ? new EnhancedChangesList( $sk ) : new OldChangesList( $sk ); diff --git a/includes/DatabaseFunctions.php b/includes/DatabaseFunctions.php index 307e0d9442..4b31b4f055 100644 --- a/includes/DatabaseFunctions.php +++ b/includes/DatabaseFunctions.php @@ -17,7 +17,7 @@ function wfQuery( $sql, $db, $fname = '' ) { # Someone has tried to call this the old way throw new FatalError( wfMsgNoDB( 'wrong_wfQuery_params', $db, $sql ) ); } - $c =& wfGetDB( $db ); + $c = wfGetDB( $db ); if ( $c !== false ) { return $c->query( $sql, $fname ); } else { @@ -33,7 +33,7 @@ function wfQuery( $sql, $db, $fname = '' ) { * @return Array: first row from the database */ function wfSingleQuery( $sql, $dbi, $fname = '' ) { - $db =& wfGetDB( $dbi ); + $db = wfGetDB( $dbi ); $res = $db->query($sql, $fname ); $row = $db->fetchRow( $res ); $ret = $row[0]; @@ -53,7 +53,7 @@ function wfSingleQuery( $sql, $dbi, $fname = '' ) { * @return Returns the previous state. */ function wfIgnoreSQLErrors( $newstate, $dbi = DB_LAST ) { - $db =& wfGetDB( $dbi ); + $db = wfGetDB( $dbi ); if ( $db !== false ) { return $db->ignoreErrors( $newstate ); } else { @@ -72,7 +72,7 @@ function wfIgnoreSQLErrors( $newstate, $dbi = DB_LAST ) { */ function wfFreeResult( $res, $dbi = DB_LAST ) { - $db =& wfGetDB( $dbi ); + $db = wfGetDB( $dbi ); if ( $db !== false ) { $db->freeResult( $res ); return true; @@ -86,7 +86,7 @@ function wfFreeResult( $res, $dbi = DB_LAST ) * @return object|false object we requested */ function wfFetchObject( $res, $dbi = DB_LAST ) { - $db =& wfGetDB( $dbi ); + $db = wfGetDB( $dbi ); if ( $db !== false ) { return $db->fetchObject( $res, $dbi = DB_LAST ); } else { @@ -99,7 +99,7 @@ function wfFetchObject( $res, $dbi = DB_LAST ) { * @return object|false row we requested */ function wfFetchRow( $res, $dbi = DB_LAST ) { - $db =& wfGetDB( $dbi ); + $db = wfGetDB( $dbi ); if ( $db !== false ) { return $db->fetchRow ( $res, $dbi = DB_LAST ); } else { @@ -112,7 +112,7 @@ function wfFetchRow( $res, $dbi = DB_LAST ) { * @return integer|false number of rows */ function wfNumRows( $res, $dbi = DB_LAST ) { - $db =& wfGetDB( $dbi ); + $db = wfGetDB( $dbi ); if ( $db !== false ) { return $db->numRows( $res, $dbi = DB_LAST ); } else { @@ -125,7 +125,7 @@ function wfNumRows( $res, $dbi = DB_LAST ) { * @return integer|false number of fields */ function wfNumFields( $res, $dbi = DB_LAST ) { - $db =& wfGetDB( $dbi ); + $db = wfGetDB( $dbi ); if ( $db !== false ) { return $db->numFields( $res ); } else { @@ -142,7 +142,7 @@ function wfNumFields( $res, $dbi = DB_LAST ) { */ function wfFieldName( $res, $n, $dbi = DB_LAST ) { - $db =& wfGetDB( $dbi ); + $db = wfGetDB( $dbi ); if ( $db !== false ) { return $db->fieldName( $res, $n, $dbi = DB_LAST ); } else { @@ -155,7 +155,7 @@ function wfFieldName( $res, $n, $dbi = DB_LAST ) * @todo document function */ function wfInsertId( $dbi = DB_LAST ) { - $db =& wfGetDB( $dbi ); + $db = wfGetDB( $dbi ); if ( $db !== false ) { return $db->insertId(); } else { @@ -167,7 +167,7 @@ function wfInsertId( $dbi = DB_LAST ) { * @todo document function */ function wfDataSeek( $res, $row, $dbi = DB_LAST ) { - $db =& wfGetDB( $dbi ); + $db = wfGetDB( $dbi ); if ( $db !== false ) { return $db->dataSeek( $res, $row ); } else { @@ -179,7 +179,7 @@ function wfDataSeek( $res, $row, $dbi = DB_LAST ) { * @todo document function */ function wfLastErrno( $dbi = DB_LAST ) { - $db =& wfGetDB( $dbi ); + $db = wfGetDB( $dbi ); if ( $db !== false ) { return $db->lastErrno(); } else { @@ -191,7 +191,7 @@ function wfLastErrno( $dbi = DB_LAST ) { * @todo document function */ function wfLastError( $dbi = DB_LAST ) { - $db =& wfGetDB( $dbi ); + $db = wfGetDB( $dbi ); if ( $db !== false ) { return $db->lastError(); } else { @@ -203,7 +203,7 @@ function wfLastError( $dbi = DB_LAST ) { * @todo document function */ function wfAffectedRows( $dbi = DB_LAST ) { - $db =& wfGetDB( $dbi ); + $db = wfGetDB( $dbi ); if ( $db !== false ) { return $db->affectedRows(); } else { @@ -215,7 +215,7 @@ function wfAffectedRows( $dbi = DB_LAST ) { * @todo document function */ function wfLastDBquery( $dbi = DB_LAST ) { - $db =& wfGetDB( $dbi ); + $db = wfGetDB( $dbi ); if ( $db !== false ) { return $db->lastQuery(); } else { @@ -234,7 +234,7 @@ function wfLastDBquery( $dbi = DB_LAST ) { */ function wfSetSQL( $table, $var, $value, $cond, $dbi = DB_MASTER ) { - $db =& wfGetDB( $dbi ); + $db = wfGetDB( $dbi ); if ( $db !== false ) { return $db->set( $table, $var, $value, $cond ); } else { @@ -253,7 +253,7 @@ function wfSetSQL( $table, $var, $value, $cond, $dbi = DB_MASTER ) */ function wfGetSQL( $table, $var, $cond='', $dbi = DB_LAST ) { - $db =& wfGetDB( $dbi ); + $db = wfGetDB( $dbi ); if ( $db !== false ) { return $db->selectField( $table, $var, $cond ); } else { @@ -270,7 +270,7 @@ function wfGetSQL( $table, $var, $cond='', $dbi = DB_LAST ) * @return Result of Database::fieldExists() or false. */ function wfFieldExists( $table, $field, $dbi = DB_LAST ) { - $db =& wfGetDB( $dbi ); + $db = wfGetDB( $dbi ); if ( $db !== false ) { return $db->fieldExists( $table, $field ); } else { @@ -287,7 +287,7 @@ function wfFieldExists( $table, $field, $dbi = DB_LAST ) { * @return Result of Database::indexExists() or false. */ function wfIndexExists( $table, $index, $dbi = DB_LAST ) { - $db =& wfGetDB( $dbi ); + $db = wfGetDB( $dbi ); if ( $db !== false ) { return $db->indexExists( $table, $index ); } else { @@ -305,7 +305,7 @@ function wfIndexExists( $table, $index, $dbi = DB_LAST ) { * @return result of Database::insert() or false. */ function wfInsertArray( $table, $array, $fname = 'wfInsertArray', $dbi = DB_MASTER ) { - $db =& wfGetDB( $dbi ); + $db = wfGetDB( $dbi ); if ( $db !== false ) { return $db->insert( $table, $array, $fname ); } else { @@ -324,7 +324,7 @@ function wfInsertArray( $table, $array, $fname = 'wfInsertArray', $dbi = DB_MAST * @return result of Database::getArray() or false. */ function wfGetArray( $table, $vars, $conds, $fname = 'wfGetArray', $dbi = DB_LAST ) { - $db =& wfGetDB( $dbi ); + $db = wfGetDB( $dbi ); if ( $db !== false ) { return $db->getArray( $table, $vars, $conds, $fname ); } else { @@ -343,7 +343,7 @@ function wfGetArray( $table, $vars, $conds, $fname = 'wfGetArray', $dbi = DB_LAS * @todo document function */ function wfUpdateArray( $table, $values, $conds, $fname = 'wfUpdateArray', $dbi = DB_MASTER ) { - $db =& wfGetDB( $dbi ); + $db = wfGetDB( $dbi ); if ( $db !== false ) { $db->update( $table, $values, $conds, $fname ); return true; @@ -356,7 +356,7 @@ function wfUpdateArray( $table, $values, $conds, $fname = 'wfUpdateArray', $dbi * @todo document function */ function wfTableName( $name, $dbi = DB_LAST ) { - $db =& wfGetDB( $dbi ); + $db = wfGetDB( $dbi ); if ( $db !== false ) { return $db->tableName( $name ); } else { @@ -368,7 +368,7 @@ function wfTableName( $name, $dbi = DB_LAST ) { * @todo document function */ function wfStrencode( $s, $dbi = DB_LAST ) { - $db =& wfGetDB( $dbi ); + $db = wfGetDB( $dbi ); if ( $db !== false ) { return $db->strencode( $s ); } else { @@ -380,7 +380,7 @@ function wfStrencode( $s, $dbi = DB_LAST ) { * @todo document function */ function wfNextSequenceValue( $seqName, $dbi = DB_MASTER ) { - $db =& wfGetDB( $dbi ); + $db = wfGetDB( $dbi ); if ( $db !== false ) { return $db->nextSequenceValue( $seqName ); } else { @@ -392,7 +392,7 @@ function wfNextSequenceValue( $seqName, $dbi = DB_MASTER ) { * @todo document function */ function wfUseIndexClause( $index, $dbi = DB_SLAVE ) { - $db =& wfGetDB( $dbi ); + $db = wfGetDB( $dbi ); if ( $db !== false ) { return $db->useIndexClause( $index ); } else { diff --git a/includes/EditPage.php b/includes/EditPage.php index e9b9713280..84ee98b57d 100644 --- a/includes/EditPage.php +++ b/includes/EditPage.php @@ -879,7 +879,7 @@ class EditPage { $fname = 'EditPage::showEditForm'; wfProfileIn( $fname ); - $sk =& $wgUser->getSkin(); + $sk = $wgUser->getSkin(); wfRunHooks( 'EditPage::showEditForm:initial', array( &$this ) ) ; @@ -1368,7 +1368,7 @@ END } function getLastDelete() { - $dbr =& wfGetDB( DB_SLAVE ); + $dbr = wfGetDB( DB_SLAVE ); $fname = 'EditPage::getLastDelete'; $res = $dbr->select( array( 'logging', 'user' ), @@ -1558,7 +1558,7 @@ END $fname = 'EditPage::mergeChangesInto'; wfProfileIn( $fname ); - $db =& wfGetDB( DB_MASTER ); + $db = wfGetDB( DB_MASTER ); // This is the revision the editor started from $baseRevision = Revision::loadFromTimestamp( diff --git a/includes/HTMLCacheUpdate.php b/includes/HTMLCacheUpdate.php index bda4720d06..cc392d9609 100644 --- a/includes/HTMLCacheUpdate.php +++ b/includes/HTMLCacheUpdate.php @@ -38,7 +38,7 @@ class HTMLCacheUpdate function doUpdate() { # Fetch the IDs $cond = $this->getToCondition(); - $dbr =& wfGetDB( DB_SLAVE ); + $dbr = wfGetDB( DB_SLAVE ); $res = $dbr->select( $this->mTable, $this->getFromField(), $cond, __METHOD__ ); $resWrap = new ResultWrapper( $dbr, $res ); if ( $dbr->numRows( $res ) != 0 ) { @@ -136,7 +136,7 @@ class HTMLCacheUpdate return; } - $dbw =& wfGetDB( DB_MASTER ); + $dbw = wfGetDB( DB_MASTER ); $timestamp = $dbw->timestamp(); $done = false; @@ -218,7 +218,7 @@ class HTMLCacheUpdateJob extends Job { $conds[] = "$fromField <= {$this->end}"; } - $dbr =& wfGetDB( DB_SLAVE ); + $dbr = wfGetDB( DB_SLAVE ); $res = $dbr->select( $this->table, $fromField, $conds, __METHOD__ ); $update->invalidateIDs( new ResultWrapper( $dbr, $res ) ); $dbr->freeResult( $res ); diff --git a/includes/HistoryBlob.php b/includes/HistoryBlob.php index b53176d258..8d54e3697f 100644 --- a/includes/HistoryBlob.php +++ b/includes/HistoryBlob.php @@ -214,7 +214,7 @@ class HistoryBlobStub { if( isset( $wgBlobCache[$this->mOldId] ) ) { $obj = $wgBlobCache[$this->mOldId]; } else { - $dbr =& wfGetDB( DB_SLAVE ); + $dbr = wfGetDB( DB_SLAVE ); $row = $dbr->selectRow( 'text', array( 'old_flags', 'old_text' ), array( 'old_id' => $this->mOldId ) ); if( !$row ) { return false; @@ -289,7 +289,7 @@ class HistoryBlobCurStub { /** @todo document */ function getText() { - $dbr =& wfGetDB( DB_SLAVE ); + $dbr = wfGetDB( DB_SLAVE ); $row = $dbr->selectRow( 'cur', array( 'cur_text' ), array( 'cur_id' => $this->mCurId ) ); if( !$row ) { return false; diff --git a/includes/Image.php b/includes/Image.php index f65c2aa0e8..c2bf39fc3e 100644 --- a/includes/Image.php +++ b/includes/Image.php @@ -326,7 +326,7 @@ class Image global $wgUseSharedUploads, $wgSharedUploadDBname, $wgSharedUploadDBprefix, $wgContLang; wfProfileIn( __METHOD__ ); - $dbr =& wfGetDB( DB_SLAVE ); + $dbr = wfGetDB( DB_SLAVE ); $this->checkDBSchema($dbr); $row = $dbr->selectRow( 'image', @@ -347,7 +347,7 @@ class Image # capitalize the first letter of the filename before # looking it up in the shared repository. $name = $wgContLang->ucfirst($this->name); - $dbc =& wfGetDB( DB_SLAVE, 'commons' ); + $dbc = wfGetDB( DB_SLAVE, 'commons' ); $row = $dbc->selectRow( "`$wgSharedUploadDBname`.{$wgSharedUploadDBprefix}image", array( @@ -449,10 +449,10 @@ class Image // Write to the other DB using selectDB, not database selectors // This avoids breaking replication in MySQL - $dbw =& wfGetDB( DB_MASTER, 'commons' ); + $dbw = wfGetDB( DB_MASTER, 'commons' ); $dbw->selectDB( $wgSharedUploadDBname ); } else { - $dbw =& wfGetDB( DB_MASTER ); + $dbw = wfGetDB( DB_MASTER ); } $this->checkDBSchema($dbw); @@ -1443,7 +1443,7 @@ class Image * @public */ function nextHistoryLine() { - $dbr =& wfGetDB( DB_SLAVE ); + $dbr = wfGetDB( DB_SLAVE ); $this->checkDBSchema($dbr); @@ -1539,7 +1539,7 @@ class Image function recordUpload( $oldver, $desc, $license = '', $copyStatus = '', $source = '', $watch = false ) { global $wgUser, $wgUseCopyrightUpload; - $dbw =& wfGetDB( DB_MASTER ); + $dbw = wfGetDB( DB_MASTER ); $this->checkDBSchema($dbw); @@ -1695,9 +1695,9 @@ class Image wfProfileIn( __METHOD__ ); if ( $options ) { - $db =& wfGetDB( DB_MASTER ); + $db = wfGetDB( DB_MASTER ); } else { - $db =& wfGetDB( DB_SLAVE ); + $db = wfGetDB( DB_SLAVE ); } $linkCache =& LinkCache::singleton(); @@ -1779,7 +1779,7 @@ class Image } # Update EXIF data in database - $dbw =& wfGetDB( DB_MASTER ); + $dbw = wfGetDB( DB_MASTER ); $this->checkDBSchema($dbw); @@ -2275,7 +2275,7 @@ class Image $this->purgeMetadataCache(); # Update metadata in the database - $dbw =& wfGetDB( DB_MASTER ); + $dbw = wfGetDB( DB_MASTER ); $dbw->update( 'image', array( 'img_metadata' => $this->metadata ), array( 'img_name' => $this->name ), diff --git a/includes/ImageGallery.php b/includes/ImageGallery.php index cfbc6ead32..09cbd07928 100644 --- a/includes/ImageGallery.php +++ b/includes/ImageGallery.php @@ -69,7 +69,7 @@ class ImageGallery * @param $skin Skin object */ function useSkin( $skin ) { - $this->mSkin =& $skin; + $this->mSkin = $skin; } /** @@ -80,9 +80,9 @@ class ImageGallery function getSkin() { if( !$this->mSkin ) { global $wgUser; - $skin =& $wgUser->getSkin(); + $skin = $wgUser->getSkin(); } else { - $skin =& $this->mSkin; + $skin = $this->mSkin; } return $skin; } diff --git a/includes/ImagePage.php b/includes/ImagePage.php index 5936541f37..2e6e94e4d3 100644 --- a/includes/ImagePage.php +++ b/includes/ImagePage.php @@ -452,7 +452,7 @@ END $wgOut->addHTML( Xml::element( 'h2', array( 'id' => 'filelinks' ), wfMsg( 'imagelinks' ) ) . "\n" ); - $dbr =& wfGetDB( DB_SLAVE ); + $dbr = wfGetDB( DB_SLAVE ); $page = $dbr->tableName( 'page' ); $imagelinks = $dbr->tableName( 'imagelinks' ); diff --git a/includes/JobQueue.php b/includes/JobQueue.php index 746cf5de77..a4a2e67282 100644 --- a/includes/JobQueue.php +++ b/includes/JobQueue.php @@ -31,7 +31,7 @@ abstract class Job { static function pop() { wfProfileIn( __METHOD__ ); - $dbr =& wfGetDB( DB_SLAVE ); + $dbr = wfGetDB( DB_SLAVE ); // Get a job from the slave $row = $dbr->selectRow( 'job', '*', '', __METHOD__, @@ -44,7 +44,7 @@ abstract class Job { } // Try to delete it from the master - $dbw =& wfGetDB( DB_MASTER ); + $dbw = wfGetDB( DB_MASTER ); $dbw->delete( 'job', array( 'job_id' => $row->job_id ), __METHOD__ ); $affected = $dbw->affectedRows(); $dbw->immediateCommit(); @@ -147,7 +147,7 @@ abstract class Job { function insert() { $fields = $this->insertFields(); - $dbw =& wfGetDB( DB_MASTER ); + $dbw = wfGetDB( DB_MASTER ); if ( $this->removeDuplicates ) { $res = $dbw->select( 'job', array( '1' ), $fields, __METHOD__ ); diff --git a/includes/LinkBatch.php b/includes/LinkBatch.php index 4f3eabcf78..065c540a0b 100644 --- a/includes/LinkBatch.php +++ b/includes/LinkBatch.php @@ -119,7 +119,7 @@ class LinkBatch { // Construct query // This is very similar to Parser::replaceLinkHolders - $dbr =& wfGetDB( DB_SLAVE ); + $dbr = wfGetDB( DB_SLAVE ); $page = $dbr->tableName( 'page' ); $set = $this->constructSet( 'page', $dbr ); if ( $set === false ) { diff --git a/includes/LinkCache.php b/includes/LinkCache.php index 0f4e6202d3..14072c56ea 100644 --- a/includes/LinkCache.php +++ b/includes/LinkCache.php @@ -133,14 +133,14 @@ class LinkCache { $id = $wgMemc->get( $key = $this->getKey( $title ) ); if( ! is_integer( $id ) ) { if ( $this->mForUpdate ) { - $db =& wfGetDB( DB_MASTER ); + $db = wfGetDB( DB_MASTER ); if ( !( $wgAntiLockFlags & ALF_NO_LINK_LOCK ) ) { $options = array( 'FOR UPDATE' ); } else { $options = array(); } } else { - $db =& wfGetDB( DB_SLAVE ); + $db = wfGetDB( DB_SLAVE ); $options = array(); } diff --git a/includes/Linker.php b/includes/Linker.php index b7ee95a891..8dcb44e244 100644 --- a/includes/Linker.php +++ b/includes/Linker.php @@ -227,7 +227,7 @@ class Linker { } else { $threshold = $wgUser->getOption('stubthreshold') ; if ( $threshold > 0 ) { - $dbr =& wfGetDB( DB_SLAVE ); + $dbr = wfGetDB( DB_SLAVE ); $s = $dbr->selectRow( array( 'page' ), array( 'page_len', @@ -1132,7 +1132,7 @@ class Linker { global $wgUser; wfProfileIn( __METHOD__ ); - $sk =& $wgUser->getSkin(); + $sk = $wgUser->getSkin(); $outText = ''; if ( count( $templates ) > 0 ) { diff --git a/includes/LinksUpdate.php b/includes/LinksUpdate.php index 8b000b55d6..bd6e241345 100644 --- a/includes/LinksUpdate.php +++ b/includes/LinksUpdate.php @@ -39,7 +39,7 @@ class LinksUpdate { } else { $this->mOptions = array( 'FOR UPDATE' ); } - $this->mDb =& wfGetDB( DB_MASTER ); + $this->mDb = wfGetDB( DB_MASTER ); if ( !is_object( $title ) ) { throw new MWException( "The calling convention to LinksUpdate::LinksUpdate() has changed. " . @@ -170,7 +170,7 @@ class LinksUpdate { wfProfileIn( __METHOD__ ); $batchSize = 100; - $dbr =& wfGetDB( DB_SLAVE ); + $dbr = wfGetDB( DB_SLAVE ); $res = $dbr->select( array( 'templatelinks', 'page' ), array( 'page_namespace', 'page_title' ), array( diff --git a/includes/LogPage.php b/includes/LogPage.php index 6841c1fe40..65dbbe4042 100644 --- a/includes/LogPage.php +++ b/includes/LogPage.php @@ -53,7 +53,7 @@ class LogPage { global $wgUser; $fname = 'LogPage::saveContent'; - $dbw =& wfGetDB( DB_MASTER ); + $dbw = wfGetDB( DB_MASTER ); $uid = $wgUser->getID(); $this->timestamp = $now = wfTimestampNow(); diff --git a/includes/Math.php b/includes/Math.php index 79ca4620da..88934e5f0c 100644 --- a/includes/Math.php +++ b/includes/Math.php @@ -154,7 +154,7 @@ class MathRenderer { $md5_sql = pack('H32', $this->md5); # Binary packed, not hex - $dbw =& wfGetDB( DB_MASTER ); + $dbw = wfGetDB( DB_MASTER ); $dbw->replace( 'math', array( 'math_inputhash' ), array( 'math_inputhash' => $md5_sql, @@ -183,7 +183,7 @@ class MathRenderer { $fname = 'MathRenderer::_recall'; $this->md5 = md5( $this->tex ); - $dbr =& wfGetDB( DB_SLAVE ); + $dbr = wfGetDB( DB_SLAVE ); $rpage = $dbr->selectRow( 'math', array( 'math_outputhash','math_html_conservativeness','math_html','math_mathml' ), array( 'math_inputhash' => pack("H32", $this->md5)), # Binary packed, not hex diff --git a/includes/MessageCache.php b/includes/MessageCache.php index 6a12ff7fd5..319b9f6055 100644 --- a/includes/MessageCache.php +++ b/includes/MessageCache.php @@ -299,7 +299,7 @@ class MessageCache { global $wgMaxMsgCacheEntrySize; wfProfileIn( __METHOD__ ); - $dbr =& wfGetDB( DB_SLAVE ); + $dbr = wfGetDB( DB_SLAVE ); $this->mCache = array(); # Load titles for all oversized pages in the MediaWiki namespace diff --git a/includes/OutputPage.php b/includes/OutputPage.php index 1244830be0..31c7236000 100644 --- a/includes/OutputPage.php +++ b/includes/OutputPage.php @@ -252,7 +252,7 @@ class OutputPage { $lb->setArray( $arr ); $lb->execute(); - $sk =& $wgUser->getSkin(); + $sk = $wgUser->getSkin(); foreach ( $categories as $category => $unused ) { $title = Title::makeTitleSafe( NS_CATEGORY, $category ); $text = $wgContLang->convertHtml( $title->getText() ); @@ -807,7 +807,7 @@ class OutputPage { $groupName = User::getGroupName( $key ); $groupPage = User::getGroupPage( $key ); if( $groupPage ) { - $skin =& $wgUser->getSkin(); + $skin = $wgUser->getSkin(); $groups[] = '"'.$skin->makeLinkObj( $groupPage, $groupName ).'"'; } else { $groups[] = '"'.$groupName.'"'; diff --git a/includes/PageHistory.php b/includes/PageHistory.php index 3d35e0375e..8608a08a93 100644 --- a/includes/PageHistory.php +++ b/includes/PageHistory.php @@ -330,7 +330,7 @@ class PageHistory { function getLatestId() { if( is_null( $this->mLatestId ) ) { $id = $this->mTitle->getArticleID(); - $db =& wfGetDB(DB_SLAVE); + $db = wfGetDB(DB_SLAVE); $this->mLatestId = $db->selectField( 'page', "page_latest", array( 'page_id' => $id ), @@ -347,7 +347,7 @@ class PageHistory { function fetchRevisions($limit, $offset, $direction) { $fname = 'PageHistory::fetchRevisions'; - $dbr =& wfGetDB( DB_SLAVE ); + $dbr = wfGetDB( DB_SLAVE ); if ($direction == PageHistory::DIR_PREV) list($dirs, $oper) = array("ASC", ">="); @@ -389,7 +389,7 @@ class PageHistory { if ($wgUser->isAnon() || !$wgShowUpdatedMarker) return $this->mNotificationTimestamp = false; - $dbr =& wfGetDB(DB_SLAVE); + $dbr = wfGetDB(DB_SLAVE); $this->mNotificationTimestamp = $dbr->selectField( 'watchlist', diff --git a/includes/Parser.php b/includes/Parser.php index 587c6374df..8f04aa2935 100644 --- a/includes/Parser.php +++ b/includes/Parser.php @@ -1084,7 +1084,7 @@ class Parser } $url = wfMsg( $urlmsg, $id); - $sk =& $this->mOptions->getSkin(); + $sk = $this->mOptions->getSkin(); $la = $sk->getExternalLinkAttributes( $url, $keyword.$id ); $text = "{$keyword} {$id}"; } @@ -1304,7 +1304,7 @@ class Parser $fname = 'Parser::replaceExternalLinks'; wfProfileIn( $fname ); - $sk =& $this->mOptions->getSkin(); + $sk = $this->mOptions->getSkin(); $bits = preg_split( EXT_LINK_BRACKETED, $text, -1, PREG_SPLIT_DELIM_CAPTURE ); @@ -1393,7 +1393,7 @@ class Parser $s = array_shift( $bits ); $i = 0; - $sk =& $this->mOptions->getSkin(); + $sk = $this->mOptions->getSkin(); while ( $i < count( $bits ) ){ $protocol = $bits[$i++]; @@ -1501,7 +1501,7 @@ class Parser * @private */ function maybeMakeExternalImage( $url ) { - $sk =& $this->mOptions->getSkin(); + $sk = $this->mOptions->getSkin(); $imagesfrom = $this->mOptions->getAllowExternalImagesFrom(); $imagesexception = !empty($imagesfrom); $text = false; @@ -1531,7 +1531,7 @@ class Parser # the % is needed to support urlencoded titles as well if ( !$tc ) { $tc = Title::legalChars() . '#%'; } - $sk =& $this->mOptions->getSkin(); + $sk = $this->mOptions->getSkin(); #split the entire text string on occurences of [[ $a = explode( '[[', ' ' . $s ); @@ -1861,7 +1861,7 @@ class Parser */ function makeKnownLinkHolder( $nt, $text = '', $query = '', $trail = '', $prefix = '' ) { list( $inside, $trail ) = Linker::splitTrail( $trail ); - $sk =& $this->mOptions->getSkin(); + $sk = $this->mOptions->getSkin(); $link = $sk->makeKnownLinkObj( $nt, $text, $query, $inside, $prefix ); return $this->armorLinks( $link ) . $trail; } @@ -3278,7 +3278,7 @@ class Parser function fetchScaryTemplateMaybeFromCache($url) { global $wgTranscludeCacheExpiry; - $dbr =& wfGetDB(DB_SLAVE); + $dbr = wfGetDB(DB_SLAVE); $obj = $dbr->selectRow('transcache', array('tc_time', 'tc_contents'), array('tc_url' => $url)); if ($obj) { @@ -3293,7 +3293,7 @@ class Parser if (!$text) return wfMsg('scarytranscludefailed', $url); - $dbw =& wfGetDB(DB_MASTER); + $dbw = wfGetDB(DB_MASTER); $dbw->replace('transcache', array('tc_url'), array( 'tc_url' => $url, 'tc_time' => time(), @@ -3436,7 +3436,7 @@ class Parser } # We need this to perform operations on the HTML - $sk =& $this->mOptions->getSkin(); + $sk = $this->mOptions->getSkin(); # headline counter $headlineCount = 0; @@ -3961,12 +3961,12 @@ class Parser $pdbks = array(); $colours = array(); - $sk =& $this->mOptions->getSkin(); + $sk = $this->mOptions->getSkin(); $linkCache =& LinkCache::singleton(); if ( !empty( $this->mLinkHolders['namespaces'] ) ) { wfProfileIn( $fname.'-check' ); - $dbr =& wfGetDB( DB_SLAVE ); + $dbr = wfGetDB( DB_SLAVE ); $page = $dbr->tableName( 'page' ); $threshold = $wgUser->getOption('stubthreshold'); @@ -4435,7 +4435,7 @@ class Parser $alt = Sanitizer::stripAllTags( $alt ); # Linker does the rest - $sk =& $this->mOptions->getSkin(); + $sk = $this->mOptions->getSkin(); return $sk->makeImageLinkObj( $nt, $caption, $alt, $align, $width, $height, $framed, $thumb, $manual_thumb, $page ); } @@ -4642,7 +4642,7 @@ class Parser if ( is_null( $this->mRevisionTimestamp ) ) { wfProfileIn( __METHOD__ ); global $wgContLang; - $dbr =& wfGetDB( DB_SLAVE ); + $dbr = wfGetDB( DB_SLAVE ); $timestamp = $dbr->selectField( 'revision', 'rev_timestamp', array( 'rev_id' => $this->mRevisionId ), __METHOD__ ); diff --git a/includes/ParserOptions.php b/includes/ParserOptions.php index cf1b748451..f165343f0d 100644 --- a/includes/ParserOptions.php +++ b/includes/ParserOptions.php @@ -37,7 +37,7 @@ class ParserOptions function getMaxIncludeSize() { return $this->mMaxIncludeSize; } function getRemoveComments() { return $this->mRemoveComments; } - function &getSkin() { + function getSkin() { if ( !isset( $this->mSkin ) ) { $this->mSkin = $this->mUser->getSkin(); } diff --git a/includes/Profiler.php b/includes/Profiler.php index b9e3d14df4..8485edbbd3 100644 --- a/includes/Profiler.php +++ b/includes/Profiler.php @@ -304,7 +304,7 @@ class Profiler { global $wguname, $wgProfilePerHost; $fname = 'Profiler::logToDB'; - $dbw = & wfGetDB(DB_MASTER); + $dbw = wfGetDB(DB_MASTER); if (!is_object($dbw)) return false; $errorState = $dbw->ignoreErrors( true ); diff --git a/includes/QueryPage.php b/includes/QueryPage.php index 1ebf10818c..6c35697cbd 100644 --- a/includes/QueryPage.php +++ b/includes/QueryPage.php @@ -195,8 +195,8 @@ class QueryPage { */ function recache( $limit, $ignoreErrors = true ) { $fname = get_class($this) . '::recache'; - $dbw =& wfGetDB( DB_MASTER ); - $dbr =& wfGetDB( DB_SLAVE, array( $this->getName(), 'QueryPage::recache', 'vslow' ) ); + $dbw = wfGetDB( DB_MASTER ); + $dbr = wfGetDB( DB_SLAVE, array( $this->getName(), 'QueryPage::recache', 'vslow' ) ); if ( !$dbw || !$dbr ) { return false; } @@ -280,7 +280,7 @@ class QueryPage { $sname = $this->getName(); $fname = get_class($this) . '::doQuery'; - $dbr =& wfGetDB( DB_SLAVE ); + $dbr = wfGetDB( DB_SLAVE ); $wgOut->setSyndicated( $this->isSyndicated() ); @@ -409,7 +409,7 @@ class QueryPage { $this->feedUrl() ); $feed->outHeader(); - $dbr =& wfGetDB( DB_SLAVE ); + $dbr = wfGetDB( DB_SLAVE ); $sql = $this->getSQL() . $this->getOrder(); $sql = $dbr->limitResult( $sql, $limit, 0 ); $res = $dbr->query( $sql, 'QueryPage::doFeed' ); diff --git a/includes/RecentChange.php b/includes/RecentChange.php index 292e3f7197..fced434397 100644 --- a/includes/RecentChange.php +++ b/includes/RecentChange.php @@ -70,7 +70,7 @@ class RecentChange * @return RecentChange */ public static function newFromId( $rcid ) { - $dbr =& wfGetDB( DB_SLAVE ); + $dbr = wfGetDB( DB_SLAVE ); $res = $dbr->select( 'recentchanges', '*', array( 'rc_id' => $rcid ), __METHOD__ ); if( $res && $dbr->numRows( $res ) > 0 ) { $row = $dbr->fetchObject( $res ); @@ -116,7 +116,7 @@ class RecentChange global $wgLocalInterwiki, $wgPutIPinRC, $wgRC2UDPAddress, $wgRC2UDPPort, $wgRC2UDPPrefix; $fname = 'RecentChange::save'; - $dbw =& wfGetDB( DB_MASTER ); + $dbw = wfGetDB( DB_MASTER ); if ( !is_array($this->mExtra) ) { $this->mExtra = array(); } @@ -214,7 +214,7 @@ class RecentChange { $fname = 'RecentChange::markPatrolled'; - $dbw =& wfGetDB( DB_MASTER ); + $dbw = wfGetDB( DB_MASTER ); $dbw->update( 'recentchanges', array( /* SET */ diff --git a/includes/Revision.php b/includes/Revision.php index dea15cb3ae..3e7e77e5d4 100644 --- a/includes/Revision.php +++ b/includes/Revision.php @@ -77,7 +77,7 @@ class Revision { * @access public * @static */ - public static function loadFromPageId( &$db, $pageid, $id = 0 ) { + public static function loadFromPageId( $db, $pageid, $id = 0 ) { $conds=array('page_id=rev_page','rev_page'=>intval( $pageid ), 'page_id'=>intval( $pageid )); if( $id ) { $conds['rev_id']=intval($id); @@ -143,10 +143,10 @@ class Revision { * @static */ private static function newFromConds( $conditions ) { - $db =& wfGetDB( DB_SLAVE ); + $db = wfGetDB( DB_SLAVE ); $row = Revision::loadFromConds( $db, $conditions ); if( is_null( $row ) ) { - $dbw =& wfGetDB( DB_MASTER ); + $dbw = wfGetDB( DB_MASTER ); $row = Revision::loadFromConds( $dbw, $conditions ); } return $row; @@ -162,7 +162,7 @@ class Revision { * @access private * @static */ - private static function loadFromConds( &$db, $conditions ) { + private static function loadFromConds( $db, $conditions ) { $res = Revision::fetchFromConds( $db, $conditions ); if( $res ) { $row = $res->fetchObject(); @@ -224,7 +224,7 @@ class Revision { * @access private * @static */ - private static function fetchFromConds( &$db, $conditions ) { + private static function fetchFromConds( $db, $conditions ) { $res = $db->select( array( 'page', 'revision' ), array( 'page_namespace', @@ -330,7 +330,7 @@ class Revision { if( isset( $this->mTitle ) ) { return $this->mTitle; } - $dbr =& wfGetDB( DB_SLAVE ); + $dbr = wfGetDB( DB_SLAVE ); $row = $dbr->selectRow( array( 'page', 'revision' ), array( 'page_namespace', 'page_title' ), @@ -704,7 +704,7 @@ class Revision { if( !$row ) { // Text data is immutable; check slaves first. - $dbr =& wfGetDB( DB_SLAVE ); + $dbr = wfGetDB( DB_SLAVE ); $row = $dbr->selectRow( 'text', array( 'old_text', 'old_flags' ), array( 'old_id' => $this->getTextId() ), @@ -713,7 +713,7 @@ class Revision { if( !$row ) { // Possible slave lag! - $dbw =& wfGetDB( DB_MASTER ); + $dbw = wfGetDB( DB_MASTER ); $row = $dbw->selectRow( 'text', array( 'old_text', 'old_flags' ), array( 'old_id' => $this->getTextId() ), @@ -800,12 +800,12 @@ class Revision { * @param integer $id */ static function getTimestampFromID( $id ) { - $dbr =& wfGetDB( DB_SLAVE ); + $dbr = wfGetDB( DB_SLAVE ); $timestamp = $dbr->selectField( 'revision', 'rev_timestamp', array( 'rev_id' => $id ), __METHOD__ ); if ( $timestamp === false ) { # Not in slave, try master - $dbw =& wfGetDB( DB_MASTER ); + $dbw = wfGetDB( DB_MASTER ); $timestamp = $dbw->selectField( 'revision', 'rev_timestamp', array( 'rev_id' => $id ), __METHOD__ ); } diff --git a/includes/SearchMySQL.php b/includes/SearchMySQL.php index 8627b785ca..87878b6bc7 100644 --- a/includes/SearchMySQL.php +++ b/includes/SearchMySQL.php @@ -148,7 +148,7 @@ class SearchMySQL extends SearchEngine { * @param string $text */ function update( $id, $title, $text ) { - $dbw=& wfGetDB( DB_MASTER ); + $dbw = wfGetDB( DB_MASTER ); $dbw->replace( 'searchindex', array( 'si_page' ), array( @@ -166,7 +166,7 @@ class SearchMySQL extends SearchEngine { * @param string $title */ function updateTitle( $id, $title ) { - $dbw =& wfGetDB( DB_MASTER ); + $dbw = wfGetDB( DB_MASTER ); $dbw->update( 'searchindex', array( 'si_title' => $title ), diff --git a/includes/SearchMySQL4.php b/includes/SearchMySQL4.php index 9ba5860a65..dbd88ecac5 100644 --- a/includes/SearchMySQL4.php +++ b/includes/SearchMySQL4.php @@ -29,8 +29,8 @@ class SearchMySQL4 extends SearchMySQL { var $strictMatching = true; /** @todo document */ - function SearchMySQL4( &$db ) { - $this->db =& $db; + function SearchMySQL4( $db ) { + $this->db = $db; } /** @todo document */ diff --git a/includes/SearchPostgres.php b/includes/SearchPostgres.php index 87b90abaae..293c5937be 100644 --- a/includes/SearchPostgres.php +++ b/includes/SearchPostgres.php @@ -26,8 +26,8 @@ class SearchPostgres extends SearchEngine { - function SearchPostgres( &$db ) { - $this->db =& $db; + function SearchPostgres( $db ) { + $this->db = $db; } /** @@ -123,7 +123,7 @@ class SearchPostgres extends SearchEngine { ## These two functions are done automatically via triggers function update( $pageid, $title, $text ) { - $dbw =& wfGetDB( DB_MASTER ); + $dbw = wfGetDB( DB_MASTER ); ## We don't want to index older revisions $SQL = "UPDATE pagecontent SET textvector = NULL WHERE old_id = ". "(SELECT rev_text_id FROM revision WHERE rev_page = $pageid ". diff --git a/includes/SearchTsearch2.php b/includes/SearchTsearch2.php index 36f97bb1ac..b504f03495 100644 --- a/includes/SearchTsearch2.php +++ b/includes/SearchTsearch2.php @@ -95,7 +95,7 @@ class SearchTsearch2 extends SearchEngine { } function update( $id, $title, $text ) { - $dbw=& wfGetDB(DB_MASTER); + $dbw = wfGetDB(DB_MASTER); $searchindex = $dbw->tableName( 'searchindex' ); $sql = "DELETE FROM $searchindex WHERE si_page={$id}"; $dbw->query($sql,"SearchTsearch2:update"); @@ -108,13 +108,13 @@ class SearchTsearch2 extends SearchEngine { } function updateTitle($id,$title) { - $dbw=& wfGetDB(DB_MASTER); - $searchindex = $dbw->tableName( 'searchindex' ); - $sql = "UPDATE $searchindex SET si_title=to_tsvector('" . - $dbw->strencode( $title ) . - "') WHERE si_page={$id}"; + $dbw = wfGetDB(DB_MASTER); + $searchindex = $dbw->tableName( 'searchindex' ); + $sql = "UPDATE $searchindex SET si_title=to_tsvector('" . + $dbw->strencode( $title ) . + "') WHERE si_page={$id}"; - $dbw->query( $sql, "SearchMySQL4::updateTitle" ); + $dbw->query( $sql, "SearchMySQL4::updateTitle" ); } } diff --git a/includes/SiteStats.php b/includes/SiteStats.php index cb617de1f9..46700ccd9e 100644 --- a/includes/SiteStats.php +++ b/includes/SiteStats.php @@ -17,7 +17,7 @@ class SiteStats { return; } - $dbr =& wfGetDB( DB_SLAVE ); + $dbr = wfGetDB( DB_SLAVE ); self::$row = $dbr->selectRow( 'site_stats', '*', false, __METHOD__ ); # This code is somewhat schema-agnostic, because I'm changing it in a minor release -- TS @@ -61,7 +61,7 @@ class SiteStats { static function admins() { if ( !isset( self::$admins ) ) { - $dbr =& wfGetDB( DB_SLAVE ); + $dbr = wfGetDB( DB_SLAVE ); self::$admins = $dbr->selectField( 'user_groups', 'COUNT(*)', array( 'ug_group' => 'sysop' ), __METHOD__ ); } return self::$admins; @@ -70,7 +70,7 @@ class SiteStats { static function pagesInNs( $ns ) { wfProfileIn( __METHOD__ ); if( !isset( self::$pageCount[$ns] ) ) { - $dbr =& wfGetDB( DB_SLAVE ); + $dbr = wfGetDB( DB_SLAVE ); $pageCount[$ns] = (int)$dbr->selectField( 'page', 'COUNT(*)', array( 'page_namespace' => $ns ), __METHOD__ ); } wfProfileOut( __METHOD__ ); @@ -110,7 +110,7 @@ class SiteStatsUpdate { function doUpdate() { $fname = 'SiteStatsUpdate::doUpdate'; - $dbw =& wfGetDB( DB_MASTER ); + $dbw = wfGetDB( DB_MASTER ); # First retrieve the row just to find out which schema we're in $row = $dbw->selectRow( 'site_stats', '*', false, $fname ); @@ -124,7 +124,7 @@ class SiteStatsUpdate { if ( isset( $row->ss_total_pages ) ) { # Update schema if required if ( $row->ss_total_pages == -1 && !$this->mViews ) { - $dbr =& wfGetDB( DB_SLAVE, array( 'SpecialStatistics', 'vslow') ); + $dbr = wfGetDB( DB_SLAVE, array( 'SpecialStatistics', 'vslow') ); list( $page, $user ) = $dbr->tableNamesN( 'page', 'user' ); $sql = "SELECT COUNT(page_namespace) AS total FROM $page"; diff --git a/includes/Skin.php b/includes/Skin.php index ad4af797da..ed8d3de244 100644 --- a/includes/Skin.php +++ b/includes/Skin.php @@ -32,7 +32,7 @@ class Skin extends Linker { * @return array of strings * @static */ - static function &getSkinNames() { + static function getSkinNames() { global $wgValidSkinNames; static $skinsInitialised = false; if ( !$skinsInitialised ) { @@ -1042,7 +1042,7 @@ END; } if ($wgPageShowWatchingUsers && $wgUser->getOption( 'shownumberswatching' )) { - $dbr =& wfGetDB( DB_SLAVE ); + $dbr = wfGetDB( DB_SLAVE ); $watchlist = $dbr->tableName( 'watchlist' ); $sql = "SELECT COUNT(*) AS n FROM $watchlist WHERE wl_title='" . $dbr->strencode($wgTitle->getDBKey()) . diff --git a/includes/SkinTemplate.php b/includes/SkinTemplate.php index c7a2bfefc1..337666adfa 100644 --- a/includes/SkinTemplate.php +++ b/includes/SkinTemplate.php @@ -351,7 +351,7 @@ class SkinTemplate extends Skin { } if ($wgPageShowWatchingUsers) { - $dbr =& wfGetDB( DB_SLAVE ); + $dbr = wfGetDB( DB_SLAVE ); $watchlist = $dbr->tableName( 'watchlist' ); $sql = "SELECT COUNT(*) AS n FROM $watchlist WHERE wl_title='" . $dbr->strencode($this->mTitle->getDBKey()) . diff --git a/includes/SpecialAllmessages.php b/includes/SpecialAllmessages.php index bfba3e32fa..9f68d144ac 100644 --- a/includes/SpecialAllmessages.php +++ b/includes/SpecialAllmessages.php @@ -88,7 +88,7 @@ function makeHTMLText( $messages ) { global $wgLang, $wgContLang, $wgUser; wfProfileIn( __METHOD__ ); - $sk =& $wgUser->getSkin(); + $sk = $wgUser->getSkin(); $talk = $wgLang->getNsText( NS_TALK ); $input = wfElement( 'input', array( @@ -123,7 +123,7 @@ function makeHTMLText( $messages ) { NS_MEDIAWIKI => array(), NS_MEDIAWIKI_TALK => array() ); - $dbr =& wfGetDB( DB_SLAVE ); + $dbr = wfGetDB( DB_SLAVE ); $page = $dbr->tableName( 'page' ); $sql = "SELECT page_namespace,page_title FROM $page WHERE page_namespace IN (" . NS_MEDIAWIKI . ", " . NS_MEDIAWIKI_TALK . ")"; $res = $dbr->query( $sql ); diff --git a/includes/SpecialAllpages.php b/includes/SpecialAllpages.php index 679de63f1e..40acd0a748 100644 --- a/includes/SpecialAllpages.php +++ b/includes/SpecialAllpages.php @@ -88,7 +88,7 @@ function showToplevel ( $namespace = NS_MAIN, $including = false ) { # TODO: Either make this *much* faster or cache the title index points # in the querycache table. - $dbr =& wfGetDB( DB_SLAVE ); + $dbr = wfGetDB( DB_SLAVE ); $out = ""; $where = array( 'page_namespace' => $namespace ); @@ -216,7 +216,7 @@ function showChunk( $namespace = NS_MAIN, $from, $including = false ) { } else { list( $namespace, $fromKey, $from ) = $fromList; - $dbr =& wfGetDB( DB_SLAVE ); + $dbr = wfGetDB( DB_SLAVE ); $res = $dbr->select( 'page', array( 'page_namespace', 'page_title', 'page_is_redirect' ), array( @@ -262,7 +262,7 @@ function showChunk( $namespace = NS_MAIN, $from, $including = false ) { } else { # Get the last title from previous chunk - $dbr =& wfGetDB( DB_SLAVE ); + $dbr = wfGetDB( DB_SLAVE ); $res_prev = $dbr->select( 'page', 'page_title', diff --git a/includes/SpecialAncientpages.php b/includes/SpecialAncientpages.php index 5499857f12..8894f5bec1 100644 --- a/includes/SpecialAncientpages.php +++ b/includes/SpecialAncientpages.php @@ -22,7 +22,7 @@ class AncientPagesPage extends QueryPage { function getSQL() { global $wgDBtype; - $db =& wfGetDB( DB_SLAVE ); + $db = wfGetDB( DB_SLAVE ); $page = $db->tableName( 'page' ); $revision = $db->tableName( 'revision' ); #$use_index = $db->useIndexClause( 'cur_timestamp' ); # FIXME! this is gone diff --git a/includes/SpecialBrokenRedirects.php b/includes/SpecialBrokenRedirects.php index 2f0a14b52e..95a705e5c1 100644 --- a/includes/SpecialBrokenRedirects.php +++ b/includes/SpecialBrokenRedirects.php @@ -24,7 +24,7 @@ class BrokenRedirectsPage extends PageQueryPage { } function getSQL() { - $dbr =& wfGetDB( DB_SLAVE ); + $dbr = wfGetDB( DB_SLAVE ); list( $page, $pagelinks ) = $dbr->tableNamesN( 'page', 'pagelinks' ); $sql = "SELECT 'BrokenRedirects' AS type, diff --git a/includes/SpecialCategories.php b/includes/SpecialCategories.php index 402a727691..6e09cc826d 100644 --- a/includes/SpecialCategories.php +++ b/includes/SpecialCategories.php @@ -26,7 +26,7 @@ class CategoriesPage extends QueryPage { function getSQL() { $NScat = NS_CATEGORY; - $dbr =& wfGetDB( DB_SLAVE ); + $dbr = wfGetDB( DB_SLAVE ); $categorylinks = $dbr->tableName( 'categorylinks' ); $implicit_groupby = $dbr->implicitGroupby() ? '1' : 'cl_to'; $s= "SELECT 'Categories' as type, diff --git a/includes/SpecialContributions.php b/includes/SpecialContributions.php index 70ff0c7cfd..bc448882a2 100644 --- a/includes/SpecialContributions.php +++ b/includes/SpecialContributions.php @@ -14,7 +14,7 @@ class ContribsFinder { function ContribsFinder( $username ) { $this->username = $username; $this->namespace = false; - $this->dbr =& wfGetDB( DB_SLAVE, 'contributions' ); + $this->dbr = wfGetDB( DB_SLAVE, 'contributions' ); } function setNamespace( $ns ) { diff --git a/includes/SpecialDeadendpages.php b/includes/SpecialDeadendpages.php index c164e2fae2..0f8cbe5b4a 100644 --- a/includes/SpecialDeadendpages.php +++ b/includes/SpecialDeadendpages.php @@ -40,7 +40,7 @@ class DeadendPagesPage extends PageQueryPage { * @return string an sqlquery */ function getSQL() { - $dbr =& wfGetDB( DB_SLAVE ); + $dbr = wfGetDB( DB_SLAVE ); list( $page, $pagelinks ) = $dbr->tableNamesN( 'page', 'pagelinks' ); return "SELECT 'Deadendpages' as type, page_namespace AS namespace, page_title as title, page_title AS value " . "FROM $page LEFT JOIN $pagelinks ON page_id = pl_from " . diff --git a/includes/SpecialDisambiguations.php b/includes/SpecialDisambiguations.php index 125e6967da..da0562ab19 100644 --- a/includes/SpecialDisambiguations.php +++ b/includes/SpecialDisambiguations.php @@ -20,7 +20,7 @@ class DisambiguationsPage extends PageQueryPage { } function getSQL() { - $dbr =& wfGetDB( DB_SLAVE ); + $dbr = wfGetDB( DB_SLAVE ); $dMsgText = wfMsgForContent('disambiguationspage'); diff --git a/includes/SpecialDoubleRedirects.php b/includes/SpecialDoubleRedirects.php index 5acc262d46..4db785f63a 100644 --- a/includes/SpecialDoubleRedirects.php +++ b/includes/SpecialDoubleRedirects.php @@ -51,7 +51,7 @@ class DoubleRedirectsPage extends PageQueryPage { } function getSQL() { - $dbr =& wfGetDB( DB_SLAVE ); + $dbr = wfGetDB( DB_SLAVE ); return $this->getSQLText( $dbr ); } @@ -66,7 +66,7 @@ class DoubleRedirectsPage extends PageQueryPage { $titleA = Title::makeTitle( $result->namespace, $result->title ); if ( $result && !isset( $result->nsb ) ) { - $dbr =& wfGetDB( DB_SLAVE ); + $dbr = wfGetDB( DB_SLAVE ); $sql = $this->getSQLText( $dbr, $result->namespace, $result->title ); $res = $dbr->query( $sql, $fname ); if ( $res ) { diff --git a/includes/SpecialExport.php b/includes/SpecialExport.php index 201fbef4b9..27e81b45b9 100644 --- a/includes/SpecialExport.php +++ b/includes/SpecialExport.php @@ -86,7 +86,7 @@ function wfSpecialExport( $page = '' ) { header( "Content-type: application/xml; charset=utf-8" ); $pages = explode( "\n", $page ); - $db =& wfGetDB( DB_SLAVE ); + $db = wfGetDB( DB_SLAVE ); $exporter = new WikiExporter( $db, $history ); $exporter->list_authors = $list_authors ; $exporter->openStream(); diff --git a/includes/SpecialImagelist.php b/includes/SpecialImagelist.php index 2cc1769e3a..84cbfce5b3 100644 --- a/includes/SpecialImagelist.php +++ b/includes/SpecialImagelist.php @@ -39,7 +39,7 @@ class ImageListPager extends TablePager { if ( $search != '' && !$wgMiserMode ) { $nt = Title::newFromUrl( $search ); if( $nt ) { - $dbr =& wfGetDB( DB_SLAVE ); + $dbr = wfGetDB( DB_SLAVE ); $m = $dbr->strencode( strtolower( $nt->getDBkey() ) ); $m = str_replace( "%", "\\%", $m ); $m = str_replace( "_", "\\_", $m ); diff --git a/includes/SpecialImport.php b/includes/SpecialImport.php index 2c1e19591a..d36757fe2c 100644 --- a/includes/SpecialImport.php +++ b/includes/SpecialImport.php @@ -302,7 +302,7 @@ class WikiRevision { } function importOldRevision() { - $dbw =& wfGetDB( DB_MASTER ); + $dbw = wfGetDB( DB_MASTER ); # Sneak a single revision into place $user = User::newFromName( $this->getUser() ); @@ -505,7 +505,7 @@ class WikiImporter { * @private */ function importRevision( &$revision ) { - $dbw =& wfGetDB( DB_MASTER ); + $dbw = wfGetDB( DB_MASTER ); return $dbw->deadlockLoop( array( &$revision, 'importOldRevision' ) ); } diff --git a/includes/SpecialListredirects.php b/includes/SpecialListredirects.php index dbdfaabab6..bc3969275d 100644 --- a/includes/SpecialListredirects.php +++ b/includes/SpecialListredirects.php @@ -19,7 +19,7 @@ class ListredirectsPage extends QueryPage { function sortDescending() { return( false ); } function getSQL() { - $dbr =& wfGetDB( DB_SLAVE ); + $dbr = wfGetDB( DB_SLAVE ); $page = $dbr->tableName( 'page' ); $sql = "SELECT 'Listredirects' AS type, page_title AS title, page_namespace AS namespace, 0 AS value FROM $page WHERE page_is_redirect = 1"; return( $sql ); diff --git a/includes/SpecialListusers.php b/includes/SpecialListusers.php index 59a8a6dbd5..c0292c0dd3 100644 --- a/includes/SpecialListusers.php +++ b/includes/SpecialListusers.php @@ -110,7 +110,7 @@ class ListUsersPage extends QueryPage { function getSQL() { global $wgDBtype; - $dbr =& wfGetDB( DB_SLAVE ); + $dbr = wfGetDB( DB_SLAVE ); $user = $dbr->tableName( 'user' ); $user_groups = $dbr->tableName( 'user_groups' ); @@ -177,7 +177,7 @@ class ListUsersPage extends QueryPage { $groups = null; if( !isset( $result->numgroups ) || $result->numgroups > 0 ) { - $dbr =& wfGetDB( DB_SLAVE ); + $dbr = wfGetDB( DB_SLAVE ); $result = $dbr->select( 'user_groups', array( 'ug_group' ), array( 'ug_user' => $result->user_id ), diff --git a/includes/SpecialLog.php b/includes/SpecialLog.php index 66f11c0149..d84b19469f 100644 --- a/includes/SpecialLog.php +++ b/includes/SpecialLog.php @@ -47,7 +47,7 @@ class LogReader { * @param WebRequest $request For internal use use a FauxRequest object to pass arbitrary parameters. */ function LogReader( $request ) { - $this->db =& wfGetDB( DB_SLAVE ); + $this->db = wfGetDB( DB_SLAVE ); $this->setupQuery( $request ); } @@ -215,7 +215,7 @@ class LogViewer { */ function LogViewer( &$reader ) { global $wgUser; - $this->skin =& $wgUser->getSkin(); + $this->skin = $wgUser->getSkin(); $this->reader =& $reader; } diff --git a/includes/SpecialLonelypages.php b/includes/SpecialLonelypages.php index 1de11bb8c2..810bd1eca4 100644 --- a/includes/SpecialLonelypages.php +++ b/includes/SpecialLonelypages.php @@ -27,7 +27,7 @@ class LonelyPagesPage extends PageQueryPage { function isSyndicated() { return false; } function getSQL() { - $dbr =& wfGetDB( DB_SLAVE ); + $dbr = wfGetDB( DB_SLAVE ); list( $page, $pagelinks ) = $dbr->tableNamesN( 'page', 'pagelinks' ); return diff --git a/includes/SpecialMIMEsearch.php b/includes/SpecialMIMEsearch.php index 333d7ea17a..1e69b23eb6 100644 --- a/includes/SpecialMIMEsearch.php +++ b/includes/SpecialMIMEsearch.php @@ -36,7 +36,7 @@ class MIMEsearchPage extends QueryPage { } function getSQL() { - $dbr =& wfGetDB( DB_SLAVE ); + $dbr = wfGetDB( DB_SLAVE ); $image = $dbr->tableName( 'image' ); $major = $dbr->addQuotes( $this->major ); $minor = $dbr->addQuotes( $this->minor ); diff --git a/includes/SpecialMostcategories.php b/includes/SpecialMostcategories.php index 8f1a729451..e761942669 100644 --- a/includes/SpecialMostcategories.php +++ b/includes/SpecialMostcategories.php @@ -17,7 +17,7 @@ class MostcategoriesPage extends QueryPage { function isSyndicated() { return false; } function getSQL() { - $dbr =& wfGetDB( DB_SLAVE ); + $dbr = wfGetDB( DB_SLAVE ); list( $categorylinks, $page) = $dbr->tableNamesN( 'categorylinks', 'page' ); return " diff --git a/includes/SpecialMostimages.php b/includes/SpecialMostimages.php index e65e9e8413..6a6d8c5f68 100644 --- a/includes/SpecialMostimages.php +++ b/includes/SpecialMostimages.php @@ -17,7 +17,7 @@ class MostimagesPage extends QueryPage { function isSyndicated() { return false; } function getSQL() { - $dbr =& wfGetDB( DB_SLAVE ); + $dbr = wfGetDB( DB_SLAVE ); $imagelinks = $dbr->tableName( 'imagelinks' ); return " diff --git a/includes/SpecialMostlinked.php b/includes/SpecialMostlinked.php index ff95d2d9a1..2ba9015d4d 100644 --- a/includes/SpecialMostlinked.php +++ b/includes/SpecialMostlinked.php @@ -25,7 +25,7 @@ class MostlinkedPage extends QueryPage { * Note: Getting page_namespace only works if $this->isCached() is false */ function getSQL() { - $dbr =& wfGetDB( DB_SLAVE ); + $dbr = wfGetDB( DB_SLAVE ); list( $pagelinks, $page ) = $dbr->tableNamesN( 'pagelinks', 'page' ); return "SELECT 'Mostlinked' AS type, diff --git a/includes/SpecialMostlinkedcategories.php b/includes/SpecialMostlinkedcategories.php index c2e465d77f..536a48a186 100644 --- a/includes/SpecialMostlinkedcategories.php +++ b/includes/SpecialMostlinkedcategories.php @@ -19,7 +19,7 @@ class MostlinkedCategoriesPage extends QueryPage { function isSyndicated() { return false; } function getSQL() { - $dbr =& wfGetDB( DB_SLAVE ); + $dbr = wfGetDB( DB_SLAVE ); $categorylinks = $dbr->tableName( 'categorylinks' ); $name = $dbr->addQuotes( $this->getName() ); return diff --git a/includes/SpecialMostrevisions.php b/includes/SpecialMostrevisions.php index 1b2a5a8cb3..5915705644 100644 --- a/includes/SpecialMostrevisions.php +++ b/includes/SpecialMostrevisions.php @@ -19,7 +19,7 @@ class MostrevisionsPage extends QueryPage { function isSyndicated() { return false; } function getSQL() { - $dbr =& wfGetDB( DB_SLAVE ); + $dbr = wfGetDB( DB_SLAVE ); list( $revision, $page ) = $dbr->tableNamesN( 'revision', 'page' ); return " diff --git a/includes/SpecialNewimages.php b/includes/SpecialNewimages.php index b7d87767ff..b41ff5657b 100644 --- a/includes/SpecialNewimages.php +++ b/includes/SpecialNewimages.php @@ -11,7 +11,7 @@ function wfSpecialNewimages( $par, $specialPage ) { global $wgUser, $wgOut, $wgLang, $wgRequest, $wgGroupPermissions; $wpIlMatch = $wgRequest->getText( 'wpIlMatch' ); - $dbr =& wfGetDB( DB_SLAVE ); + $dbr = wfGetDB( DB_SLAVE ); $sk = $wgUser->getSkin(); $shownav = !$specialPage->including(); $hidebots = $wgRequest->getBool('hidebots',1); diff --git a/includes/SpecialNewpages.php b/includes/SpecialNewpages.php index f817fd73d7..928ae15748 100644 --- a/includes/SpecialNewpages.php +++ b/includes/SpecialNewpages.php @@ -39,7 +39,7 @@ class NewPagesPage extends QueryPage { function getSQL() { global $wgUser, $wgUseRCPatrol; $usepatrol = ( $wgUseRCPatrol && $wgUser->isAllowed( 'patrol' ) ) ? 1 : 0; - $dbr =& wfGetDB( DB_SLAVE ); + $dbr = wfGetDB( DB_SLAVE ); list( $recentchanges, $page ) = $dbr->tableNamesN( 'recentchanges', 'page' ); $uwhere = $this->makeUserWhere( $dbr ); diff --git a/includes/SpecialPopularpages.php b/includes/SpecialPopularpages.php index fc84826b9f..a4e509b33d 100644 --- a/includes/SpecialPopularpages.php +++ b/includes/SpecialPopularpages.php @@ -21,7 +21,7 @@ class PopularPagesPage extends QueryPage { function isSyndicated() { return false; } function getSQL() { - $dbr =& wfGetDB( DB_SLAVE ); + $dbr = wfGetDB( DB_SLAVE ); $page = $dbr->tableName( 'page' ); return diff --git a/includes/SpecialPrefixindex.php b/includes/SpecialPrefixindex.php index 9ec9d630bc..73a67ee4c4 100644 --- a/includes/SpecialPrefixindex.php +++ b/includes/SpecialPrefixindex.php @@ -74,7 +74,7 @@ function showChunk( $namespace = NS_MAIN, $prefix, $including = false, $from = n ### FIXME: should complain if $fromNs != $namespace - $dbr =& wfGetDB( DB_SLAVE ); + $dbr = wfGetDB( DB_SLAVE ); $res = $dbr->select( 'page', array( 'page_namespace', 'page_title', 'page_is_redirect' ), diff --git a/includes/SpecialRandompage.php b/includes/SpecialRandompage.php index 244dac6826..0dd0f51d29 100644 --- a/includes/SpecialRandompage.php +++ b/includes/SpecialRandompage.php @@ -29,7 +29,7 @@ function wfSpecialRandompage( $par = NS_MAIN ) { # interpolation and sprintf() can muck up with locale-specific decimal separator $randstr = wfRandom(); - $db =& wfGetDB( DB_SLAVE ); + $db = wfGetDB( DB_SLAVE ); $use_index = $db->useIndexClause( 'page_random' ); $page = $db->tableName( 'page' ); diff --git a/includes/SpecialRandomredirect.php b/includes/SpecialRandomredirect.php index 0562fdb7f4..40df984055 100644 --- a/includes/SpecialRandomredirect.php +++ b/includes/SpecialRandomredirect.php @@ -24,7 +24,7 @@ function wfSpecialRandomredirect( $par = NULL ) { # Same logic as RandomPage $randstr = wfRandom(); - $dbr =& wfGetDB( DB_SLAVE ); + $dbr = wfGetDB( DB_SLAVE ); $use_index = $dbr->useIndexClause( 'page_random' ); $page = $dbr->tableName( 'page' ); diff --git a/includes/SpecialRecentchanges.php b/includes/SpecialRecentchanges.php index 4e0042aea6..d0cec16bb6 100644 --- a/includes/SpecialRecentchanges.php +++ b/includes/SpecialRecentchanges.php @@ -104,7 +104,7 @@ function wfSpecialRecentchanges( $par, $specialPage ) { # Database connection and caching - $dbr =& wfGetDB( DB_SLAVE ); + $dbr = wfGetDB( DB_SLAVE ); list( $recentchanges, $watchlist ) = $dbr->tableNamesN( 'recentchanges', 'watchlist' ); diff --git a/includes/SpecialRecentchangeslinked.php b/includes/SpecialRecentchangeslinked.php index c6bef2e844..a194747173 100644 --- a/includes/SpecialRecentchangeslinked.php +++ b/includes/SpecialRecentchangeslinked.php @@ -47,7 +47,7 @@ function wfSpecialRecentchangeslinked( $par = NULL ) { } list( $limit, /* offset */ ) = wfCheckLimits( 100, 'rclimit' ); - $dbr =& wfGetDB( DB_SLAVE ); + $dbr = wfGetDB( DB_SLAVE ); $cutoff = $dbr->timestamp( time() - ( $days * 86400 ) ); $hideminor = ($hideminor ? 1 : 0); diff --git a/includes/SpecialSearch.php b/includes/SpecialSearch.php index 3790dac7dc..b58f91d030 100644 --- a/includes/SpecialSearch.php +++ b/includes/SpecialSearch.php @@ -312,7 +312,7 @@ class SpecialSearch { wfProfileOut( $fname ); return "\n"; } - $sk =& $wgUser->getSkin(); + $sk = $wgUser->getSkin(); $contextlines = $wgUser->getOption( 'contextlines', 5 ); $contextchars = $wgUser->getOption( 'contextchars', 50 ); diff --git a/includes/SpecialShortpages.php b/includes/SpecialShortpages.php index be11df72a7..72b093e0c7 100644 --- a/includes/SpecialShortpages.php +++ b/includes/SpecialShortpages.php @@ -27,7 +27,7 @@ class ShortPagesPage extends QueryPage { } function getSQL() { - $dbr =& wfGetDB( DB_SLAVE ); + $dbr = wfGetDB( DB_SLAVE ); $page = $dbr->tableName( 'page' ); $name = $dbr->addQuotes( $this->getName() ); diff --git a/includes/SpecialStatistics.php b/includes/SpecialStatistics.php index 569cab9ed9..359e7f07bf 100644 --- a/includes/SpecialStatistics.php +++ b/includes/SpecialStatistics.php @@ -13,7 +13,7 @@ function wfSpecialStatistics() { $action = $wgRequest->getVal( 'action' ); - $dbr =& wfGetDB( DB_SLAVE ); + $dbr = wfGetDB( DB_SLAVE ); $views = SiteStats::views(); $edits = SiteStats::edits(); @@ -63,7 +63,7 @@ function wfSpecialStatistics() { $res = $dbr->query( $sql, $fname ); if( $res ) { $wgOut->addHtml( '

' . wfMsgHtml( 'statistics-mostpopular' ) . '

' ); - $skin =& $wgUser->getSkin(); + $skin = $wgUser->getSkin(); $wgOut->addHtml( '
    ' ); while( $row = $dbr->fetchObject( $res ) ) { $link = $skin->makeKnownLinkObj( Title::makeTitleSafe( $row->page_namespace, $row->page_title ) ); diff --git a/includes/SpecialUncategorizedimages.php b/includes/SpecialUncategorizedimages.php index de1460c982..f91b25c112 100644 --- a/includes/SpecialUncategorizedimages.php +++ b/includes/SpecialUncategorizedimages.php @@ -26,7 +26,7 @@ class UncategorizedImagesPage extends QueryPage { } function getSQL() { - $dbr =& wfGetDB( DB_SLAVE ); + $dbr = wfGetDB( DB_SLAVE ); list( $page, $categorylinks ) = $dbr->tableNamesN( 'page', 'categorylinks' ); $ns = NS_IMAGE; diff --git a/includes/SpecialUncategorizedpages.php b/includes/SpecialUncategorizedpages.php index a71c25cdd0..cae34fe226 100644 --- a/includes/SpecialUncategorizedpages.php +++ b/includes/SpecialUncategorizedpages.php @@ -25,7 +25,7 @@ class UncategorizedPagesPage extends PageQueryPage { function isSyndicated() { return false; } function getSQL() { - $dbr =& wfGetDB( DB_SLAVE ); + $dbr = wfGetDB( DB_SLAVE ); list( $page, $categorylinks ) = $dbr->tableNamesN( 'page', 'categorylinks' ); $name = $dbr->addQuotes( $this->getName() ); diff --git a/includes/SpecialUnusedcategories.php b/includes/SpecialUnusedcategories.php index 980f98ee5e..5cd3406bb4 100644 --- a/includes/SpecialUnusedcategories.php +++ b/includes/SpecialUnusedcategories.php @@ -20,7 +20,7 @@ class UnusedCategoriesPage extends QueryPage { function getSQL() { $NScat = NS_CATEGORY; - $dbr =& wfGetDB( DB_SLAVE ); + $dbr = wfGetDB( DB_SLAVE ); list( $categorylinks, $page ) = $dbr->tableNamesN( 'categorylinks', 'page' ); return "SELECT 'Unusedcategories' as type, {$NScat} as namespace, page_title as title, page_title as value diff --git a/includes/SpecialUnusedimages.php b/includes/SpecialUnusedimages.php index 2052447955..35e9ca94fb 100644 --- a/includes/SpecialUnusedimages.php +++ b/includes/SpecialUnusedimages.php @@ -20,7 +20,7 @@ class UnusedimagesPage extends QueryPage { function getSQL() { global $wgCountCategorizedImagesAsUsed; - $dbr =& wfGetDB( DB_SLAVE ); + $dbr = wfGetDB( DB_SLAVE ); if ( $wgCountCategorizedImagesAsUsed ) { list( $page, $image, $imagelinks, $categorylinks ) = $dbr->tableNamesN( 'page', 'image', 'imagelinks', 'categorylinks' ); diff --git a/includes/SpecialUnusedtemplates.php b/includes/SpecialUnusedtemplates.php index 4414fa0f34..e31c10f9d5 100644 --- a/includes/SpecialUnusedtemplates.php +++ b/includes/SpecialUnusedtemplates.php @@ -20,7 +20,7 @@ class UnusedtemplatesPage extends QueryPage { function sortDescending() { return false; } function getSQL() { - $dbr =& wfGetDB( DB_SLAVE ); + $dbr = wfGetDB( DB_SLAVE ); list( $page, $templatelinks) = $dbr->tableNamesN( 'page', 'templatelinks' ); $sql = "SELECT 'Unusedtemplates' AS type, page_title AS title, page_namespace AS namespace, 0 AS value diff --git a/includes/SpecialUnwatchedpages.php b/includes/SpecialUnwatchedpages.php index c5eb9c38c2..6d067f3742 100644 --- a/includes/SpecialUnwatchedpages.php +++ b/includes/SpecialUnwatchedpages.php @@ -19,7 +19,7 @@ class UnwatchedpagesPage extends QueryPage { function isSyndicated() { return false; } function getSQL() { - $dbr =& wfGetDB( DB_SLAVE ); + $dbr = wfGetDB( DB_SLAVE ); list( $page, $watchlist ) = $dbr->tableNamesN( 'page', 'watchlist' ); $mwns = NS_MEDIAWIKI; return diff --git a/includes/SpecialUpload.php b/includes/SpecialUpload.php index a27d7b789a..a07d76f1d4 100644 --- a/includes/SpecialUpload.php +++ b/includes/SpecialUpload.php @@ -399,7 +399,7 @@ class UploadForm { global $wgUploadSizeWarning; if ( $wgUploadSizeWarning && ( $this->mUploadSize > $wgUploadSizeWarning ) ) { - $skin =& $wgUser->getSkin(); + $skin = $wgUser->getSkin(); $wsize = $skin->formatSize( $wgUploadSizeWarning ); $asize = $skin->formatSize( $this->mUploadSize ); $warning .= '
  1. ' . wfMsgHtml( 'large-file', $wsize, $asize ) . '
  2. '; diff --git a/includes/SpecialUserlogin.php b/includes/SpecialUserlogin.php index e3a26b6107..f14eede58c 100644 --- a/includes/SpecialUserlogin.php +++ b/includes/SpecialUserlogin.php @@ -792,7 +792,7 @@ class LoginForm { $attr[] = 'type=signup'; if( $this->mReturnTo ) $attr[] = 'returnto=' . $this->mReturnTo; - $skin =& $wgUser->getSkin(); + $skin = $wgUser->getSkin(); return $skin->makeKnownLinkObj( $self, htmlspecialchars( $text ), implode( '&', $attr ) ); } } diff --git a/includes/SpecialVersion.php b/includes/SpecialVersion.php index aacd85692b..5bc13186de 100644 --- a/includes/SpecialVersion.php +++ b/includes/SpecialVersion.php @@ -49,7 +49,7 @@ class SpecialVersion { */ function MediaWikiCredits() { $version = self::getVersion(); - $dbr =& wfGetDB( DB_SLAVE ); + $dbr = wfGetDB( DB_SLAVE ); $ret = "__NOTOC__ diff --git a/includes/SpecialWantedcategories.php b/includes/SpecialWantedcategories.php index 03641bfc0a..eab44d6bd2 100644 --- a/includes/SpecialWantedcategories.php +++ b/includes/SpecialWantedcategories.php @@ -19,7 +19,7 @@ class WantedCategoriesPage extends QueryPage { function isSyndicated() { return false; } function getSQL() { - $dbr =& wfGetDB( DB_SLAVE ); + $dbr = wfGetDB( DB_SLAVE ); list( $categorylinks, $page ) = $dbr->tableNamesN( 'categorylinks', 'page' ); $name = $dbr->addQuotes( $this->getName() ); return diff --git a/includes/SpecialWantedpages.php b/includes/SpecialWantedpages.php index 7053dbf95d..06e959e310 100644 --- a/includes/SpecialWantedpages.php +++ b/includes/SpecialWantedpages.php @@ -28,7 +28,7 @@ class WantedPagesPage extends QueryPage { function getSQL() { global $wgWantedPagesThreshold; $count = $wgWantedPagesThreshold - 1; - $dbr =& wfGetDB( DB_SLAVE ); + $dbr = wfGetDB( DB_SLAVE ); $pagelinks = $dbr->tableName( 'pagelinks' ); $page = $dbr->tableName( 'page' ); return diff --git a/includes/SpecialWatchlist.php b/includes/SpecialWatchlist.php index be28bc0c7e..92ee4d617b 100644 --- a/includes/SpecialWatchlist.php +++ b/includes/SpecialWatchlist.php @@ -20,7 +20,7 @@ function wfSpecialWatchlist( $par ) { global $wgEnotifWatchlist; $fname = 'wfSpecialWatchlist'; - $skin =& $wgUser->getSkin(); + $skin = $wgUser->getSkin(); $specialTitle = SpecialPage::getTitleFor( 'Watchlist' ); $wgOut->setRobotPolicy( 'noindex,nofollow' ); @@ -103,7 +103,7 @@ function wfSpecialWatchlist( $par ) { $wgOut->addHTML( "

    \n

    " . wfMsg( 'wldone' ) . "

    \n" ); } - $dbr =& wfGetDB( DB_SLAVE, 'watchlist' ); + $dbr = wfGetDB( DB_SLAVE, 'watchlist' ); list( $page, $watchlist, $recentchanges ) = $dbr->tableNamesN( 'page', 'watchlist', 'recentchanges' ); $sql = "SELECT COUNT(*) AS n FROM $watchlist WHERE wl_user=$uid"; @@ -446,7 +446,7 @@ function wlCutoffLinks( $days, $page = 'Watchlist', $options = array() ) { * @return integer */ function wlCountItems( &$user, $talk = true ) { - $dbr =& wfGetDB( DB_SLAVE, 'watchlist' ); + $dbr = wfGetDB( DB_SLAVE, 'watchlist' ); # Fetch the raw count $res = $dbr->select( 'watchlist', 'COUNT(*) AS count', array( 'wl_user' => $user->mId ), 'wlCountItems' ); @@ -482,7 +482,7 @@ function wlHandleClear( &$out, &$request, $par ) { # See if we're clearing or confirming if( $request->wasPosted() && $wgUser->matchEditToken( $request->getText( 'token' ), 'clearwatchlist' ) ) { # Clearing, so do it and report the result - $dbw =& wfGetDB( DB_MASTER ); + $dbw = wfGetDB( DB_MASTER ); $dbw->delete( 'watchlist', array( 'wl_user' => $wgUser->mId ), 'wlHandleClear' ); $out->addWikiText( wfMsgExt( 'watchlistcleardone', array( 'parsemag', 'escape'), $wgLang->formatNum( $count ) ) ); $out->returnToMain(); diff --git a/includes/SpecialWhatlinkshere.php b/includes/SpecialWhatlinkshere.php index b23a8dc154..c131c00655 100644 --- a/includes/SpecialWhatlinkshere.php +++ b/includes/SpecialWhatlinkshere.php @@ -22,7 +22,7 @@ class WhatLinksHerePage { function WhatLinksHerePage( &$request, $par = null ) { global $wgUser; $this->request =& $request; - $this->skin =& $wgUser->getSkin(); + $this->skin = $wgUser->getSkin(); $this->par = $par; } @@ -73,7 +73,7 @@ class WhatLinksHerePage { global $wgOut; $fname = 'WhatLinksHerePage::showIndirectLinks'; - $dbr =& wfGetDB( DB_READ ); + $dbr = wfGetDB( DB_READ ); // Some extra validation $from = intval( $from ); diff --git a/includes/SquidUpdate.php b/includes/SquidUpdate.php index ac8f2bafda..700fc8ef42 100644 --- a/includes/SquidUpdate.php +++ b/includes/SquidUpdate.php @@ -27,7 +27,7 @@ class SquidUpdate { wfProfileIn( $fname ); # Get a list of URLs linking to this page - $dbr =& wfGetDB( DB_SLAVE ); + $dbr = wfGetDB( DB_SLAVE ); $res = $dbr->select( array( 'links', 'page' ), array( 'page_namespace', 'page_title' ), array( diff --git a/includes/Title.php b/includes/Title.php index cd6c7e285e..cbba2198b4 100644 --- a/includes/Title.php +++ b/includes/Title.php @@ -197,7 +197,7 @@ class Title { */ public static function newFromID( $id ) { $fname = 'Title::newFromID'; - $dbr =& wfGetDB( DB_SLAVE ); + $dbr = wfGetDB( DB_SLAVE ); $row = $dbr->selectRow( 'page', array( 'page_namespace', 'page_title' ), array( 'page_id' => $id ), $fname ); if ( $row !== false ) { @@ -212,7 +212,7 @@ class Title { * Make an array of titles from an array of IDs */ function newFromIDs( $ids ) { - $dbr =& wfGetDB( DB_SLAVE ); + $dbr = wfGetDB( DB_SLAVE ); $res = $dbr->select( 'page', array( 'page_namespace', 'page_title' ), 'page_id IN (' . $dbr->makeList( $ids ) . ')', __METHOD__ ); @@ -323,7 +323,7 @@ class Title { */ function nameOf( $id ) { $fname = 'Title::nameOf'; - $dbr =& wfGetDB( DB_SLAVE ); + $dbr = wfGetDB( DB_SLAVE ); $s = $dbr->selectRow( 'page', array( 'page_namespace','page_title' ), array( 'page_id' => $id ), $fname ); if ( $s === false ) { return NULL; } @@ -416,7 +416,7 @@ class Title { return $s->iw_url; } - $dbr =& wfGetDB( DB_SLAVE ); + $dbr = wfGetDB( DB_SLAVE ); $res = $dbr->select( 'interwiki', array( 'iw_url', 'iw_local', 'iw_trans' ), array( 'iw_prefix' => $key ), $fname ); @@ -531,7 +531,7 @@ class Title { if ( count( $titles ) == 0 ) { return; } - $dbw =& wfGetDB( DB_MASTER ); + $dbw = wfGetDB( DB_MASTER ); if ( $timestamp == '' ) { $timestamp = $dbw->timestamp(); } @@ -1382,7 +1382,7 @@ class Title { wfProfileIn( __METHOD__ ); - $dbr =& wfGetDb( DB_SLAVE ); + $dbr = wfGetDb( DB_SLAVE ); if ( $this->getNamespace() == NS_IMAGE ) { $tables = array ('imagelinks', 'page_restrictions'); @@ -1458,7 +1458,7 @@ class Title { * @access public */ function loadRestrictionsFromRow( $res, $oldFashionedRestrictions = NULL ) { - $dbr =& wfGetDb( DB_SLAVE ); + $dbr = wfGetDb( DB_SLAVE ); $this->mRestrictions['edit'] = array(); $this->mRestrictions['move'] = array(); @@ -1522,7 +1522,7 @@ class Title { function loadRestrictions( $oldFashionedRestrictions = NULL ) { if( !$this->mRestrictionsLoaded ) { - $dbr =& wfGetDB( DB_SLAVE ); + $dbr = wfGetDB( DB_SLAVE ); $res = $dbr->select( 'page_restrictions', '*', array ( 'pr_page' => $this->getArticleId() ), __METHOD__ ); @@ -1571,7 +1571,7 @@ class Title { if ( $this->getNamespace() < 0 ) { $n = 0; } else { - $dbr =& wfGetDB( DB_SLAVE ); + $dbr = wfGetDB( DB_SLAVE ); $n = $dbr->selectField( 'archive', 'COUNT(*)', array( 'ar_namespace' => $this->getNamespace(), 'ar_title' => $this->getDBkey() ), $fname ); if( $this->getNamespace() == NS_IMAGE ) { @@ -1607,7 +1607,7 @@ class Title { if ($this->mLatestID !== false) return $this->mLatestID; - $db =& wfGetDB(DB_SLAVE); + $db = wfGetDB(DB_SLAVE); return $this->mLatestID = $db->selectField( 'revision', "max(rev_id)", array('rev_page' => $this->getArticleID()), @@ -1647,7 +1647,7 @@ class Title { return; } - $dbw =& wfGetDB( DB_MASTER ); + $dbw = wfGetDB( DB_MASTER ); $success = $dbw->update( 'page', array( /* SET */ 'page_touched' => $dbw->timestamp() @@ -1923,9 +1923,9 @@ class Title { $linkCache =& LinkCache::singleton(); if ( $options ) { - $db =& wfGetDB( DB_MASTER ); + $db = wfGetDB( DB_MASTER ); } else { - $db =& wfGetDB( DB_SLAVE ); + $db = wfGetDB( DB_SLAVE ); } $res = $db->select( array( 'page', $table ), @@ -1974,9 +1974,9 @@ class Title { */ function getBrokenLinksFrom( $options = '' ) { if ( $options ) { - $db =& wfGetDB( DB_MASTER ); + $db = wfGetDB( DB_MASTER ); } else { - $db =& wfGetDB( DB_SLAVE ); + $db = wfGetDB( DB_SLAVE ); } $res = $db->safeQuery( @@ -2125,7 +2125,7 @@ class Title { $redirid = $this->getArticleID(); # Fixing category links (those without piped 'alternate' names) to be sorted under the new title - $dbw =& wfGetDB( DB_MASTER ); + $dbw = wfGetDB( DB_MASTER ); $categorylinks = $dbw->tableName( 'categorylinks' ); $sql = "UPDATE $categorylinks SET cl_sortkey=" . $dbw->addQuotes( $nt->getPrefixedText() ) . " WHERE cl_from=" . $dbw->addQuotes( $pageid ) . @@ -2193,7 +2193,7 @@ class Title { $now = wfTimestampNow(); $newid = $nt->getArticleID(); $oldid = $this->getArticleID(); - $dbw =& wfGetDB( DB_MASTER ); + $dbw = wfGetDB( DB_MASTER ); $linkCache =& LinkCache::singleton(); # Delete the old redirect. We don't save it to history since @@ -2269,7 +2269,7 @@ class Title { $newid = $nt->getArticleID(); $oldid = $this->getArticleID(); - $dbw =& wfGetDB( DB_MASTER ); + $dbw = wfGetDB( DB_MASTER ); $now = $dbw->timestamp(); $linkCache =& LinkCache::singleton(); @@ -2334,7 +2334,7 @@ class Title { function isValidMoveTarget( $nt ) { $fname = 'Title::isValidMoveTarget'; - $dbw =& wfGetDB( DB_MASTER ); + $dbw = wfGetDB( DB_MASTER ); # Is it a redirect? $id = $nt->getArticleID(); @@ -2392,7 +2392,7 @@ class Title { global $wgContLang; $titlekey = $this->getArticleId(); - $dbr =& wfGetDB( DB_SLAVE ); + $dbr = wfGetDB( DB_SLAVE ); $categorylinks = $dbr->tableName( 'categorylinks' ); # NEW SQL @@ -2460,7 +2460,7 @@ class Title { * @return integer $oldrevision|false */ function getPreviousRevisionID( $revision ) { - $dbr =& wfGetDB( DB_SLAVE ); + $dbr = wfGetDB( DB_SLAVE ); return $dbr->selectField( 'revision', 'rev_id', 'rev_page=' . intval( $this->getArticleId() ) . ' AND rev_id<' . intval( $revision ) . ' ORDER BY rev_id DESC' ); @@ -2473,7 +2473,7 @@ class Title { * @return integer $oldrevision|false */ function getNextRevisionID( $revision ) { - $dbr =& wfGetDB( DB_SLAVE ); + $dbr = wfGetDB( DB_SLAVE ); return $dbr->selectField( 'revision', 'rev_id', 'rev_page=' . intval( $this->getArticleId() ) . ' AND rev_id>' . intval( $revision ) . ' ORDER BY rev_id' ); @@ -2487,7 +2487,7 @@ class Title { * @return integer Number of revisions between these IDs. */ function countRevisionsBetween( $old, $new ) { - $dbr =& wfGetDB( DB_SLAVE ); + $dbr = wfGetDB( DB_SLAVE ); return $dbr->selectField( 'revision', 'count(*)', 'rev_page = ' . intval( $this->getArticleId() ) . ' AND rev_id > ' . intval( $old ) . @@ -2545,7 +2545,7 @@ class Title { * Get the last touched timestamp */ function getTouched() { - $dbr =& wfGetDB( DB_SLAVE ); + $dbr = wfGetDB( DB_SLAVE ); $touched = $dbr->selectField( 'page', 'page_touched', array( 'page_namespace' => $this->getNamespace(), diff --git a/includes/User.php b/includes/User.php index 6475a2f03e..4a21d66aa7 100644 --- a/includes/User.php +++ b/includes/User.php @@ -269,7 +269,7 @@ class User { * @static */ static function newFromConfirmationCode( $code ) { - $dbr =& wfGetDB( DB_SLAVE ); + $dbr = wfGetDB( DB_SLAVE ); $id = $dbr->selectField( 'user', 'user_id', array( 'user_email_token' => md5( $code ), 'user_email_token_expires > ' . $dbr->addQuotes( $dbr->timestamp() ), @@ -301,7 +301,7 @@ class User { * @static */ static function whoIs( $id ) { - $dbr =& wfGetDB( DB_SLAVE ); + $dbr = wfGetDB( DB_SLAVE ); return $dbr->selectField( 'user', 'user_name', array( 'user_id' => $id ), 'User::whoIs' ); } @@ -312,7 +312,7 @@ class User { * @static */ static function whoIsReal( $id ) { - $dbr =& wfGetDB( DB_SLAVE ); + $dbr = wfGetDB( DB_SLAVE ); return $dbr->selectField( 'user', 'user_real_name', array( 'user_id' => $id ), 'User::whoIsReal' ); } @@ -328,7 +328,7 @@ class User { # Illegal name return null; } - $dbr =& wfGetDB( DB_SLAVE ); + $dbr = wfGetDB( DB_SLAVE ); $s = $dbr->selectRow( 'user', array( 'user_id' ), array( 'user_name' => $nt->getText() ), __METHOD__ ); if ( $s === false ) { @@ -546,7 +546,7 @@ class User { */ static function edits( $uid ) { wfProfileIn( __METHOD__ ); - $dbr =& wfGetDB( DB_SLAVE ); + $dbr = wfGetDB( DB_SLAVE ); // check if the user_editcount field has been initialized $field = $dbr->selectField( @@ -556,7 +556,7 @@ class User { ); if( $field === null ) { // it has not been initialized. do so. - $dbw =& wfGetDb( DB_MASTER ); + $dbw = wfGetDb( DB_MASTER ); $count = $dbr->selectField( 'revision', 'count(*)', array( 'rev_user' => $uid ), @@ -720,7 +720,7 @@ class User { return false; } - $dbr =& wfGetDB( DB_MASTER ); + $dbr = wfGetDB( DB_MASTER ); $s = $dbr->selectRow( 'user', '*', array( 'user_id' => $this->mId ), __METHOD__ ); if ( $s !== false ) { @@ -1183,7 +1183,7 @@ class User { * @private */ function checkNewtalk( $field, $id ) { - $dbr =& wfGetDB( DB_SLAVE ); + $dbr = wfGetDB( DB_SLAVE ); $ok = $dbr->selectField( 'user_newtalk', $field, array( $field => $id ), __METHOD__ ); return $ok !== false; @@ -1200,7 +1200,7 @@ class User { wfDebug( __METHOD__." already set ($field, $id), ignoring\n" ); return false; } - $dbw =& wfGetDB( DB_MASTER ); + $dbw = wfGetDB( DB_MASTER ); $dbw->insert( 'user_newtalk', array( $field => $id ), __METHOD__, @@ -1220,7 +1220,7 @@ class User { wfDebug( __METHOD__.": already gone ($field, $id), ignoring\n" ); return false; } - $dbw =& wfGetDB( DB_MASTER ); + $dbw = wfGetDB( DB_MASTER ); $dbw->delete( 'user_newtalk', array( $field => $id ), __METHOD__ ); @@ -1305,7 +1305,7 @@ class User { if( $this->mId ) { $this->mTouched = self::newTouchedTimestamp(); - $dbw =& wfGetDB( DB_MASTER ); + $dbw = wfGetDB( DB_MASTER ); $dbw->update( 'user', array( 'user_touched' => $dbw->timestamp( $this->mTouched ) ), array( 'user_id' => $this->mId ), @@ -1597,7 +1597,7 @@ class User { */ function addGroup( $group ) { $this->load(); - $dbw =& wfGetDB( DB_MASTER ); + $dbw = wfGetDB( DB_MASTER ); if( $this->getId() ) { $dbw->insert( 'user_groups', array( @@ -1621,7 +1621,7 @@ class User { */ function removeGroup( $group ) { $this->load(); - $dbw =& wfGetDB( DB_MASTER ); + $dbw = wfGetDB( DB_MASTER ); $dbw->delete( 'user_groups', array( 'ug_user' => $this->getID(), @@ -1773,7 +1773,7 @@ class User { // If the page is watched by the user (or may be watched), update the timestamp on any // any matching rows if ( $watched ) { - $dbw =& wfGetDB( DB_MASTER ); + $dbw = wfGetDB( DB_MASTER ); $dbw->update( 'watchlist', array( /* SET */ 'wl_notificationtimestamp' => NULL @@ -1804,7 +1804,7 @@ class User { } if( $currentUser != 0 ) { - $dbw =& wfGetDB( DB_MASTER ); + $dbw = wfGetDB( DB_MASTER ); $dbw->update( 'watchlist', array( /* SET */ 'wl_notificationtimestamp' => NULL @@ -1897,7 +1897,7 @@ class User { $this->mTouched = self::newTouchedTimestamp(); - $dbw =& wfGetDB( DB_MASTER ); + $dbw = wfGetDB( DB_MASTER ); $dbw->update( 'user', array( /* SET */ 'user_name' => $this->mName, @@ -1925,7 +1925,7 @@ class User { $s = trim( $this->getName() ); if ( 0 == strcmp( '', $s ) ) return 0; - $dbr =& wfGetDB( DB_SLAVE ); + $dbr = wfGetDB( DB_SLAVE ); $id = $dbr->selectField( 'user', 'user_id', array( 'user_name' => $s ), __METHOD__ ); if ( $id === false ) { $id = 0; @@ -1956,7 +1956,7 @@ class User { $user->mOptions = $params['options'] + $user->mOptions; unset( $params['options'] ); } - $dbw =& wfGetDB( DB_MASTER ); + $dbw = wfGetDB( DB_MASTER ); $seqVal = $dbw->nextSequenceValue( 'user_user_id_seq' ); $fields = array( 'user_id' => $seqVal, @@ -1989,7 +1989,7 @@ class User { */ function addToDatabase() { $this->load(); - $dbw =& wfGetDB( DB_MASTER ); + $dbw = wfGetDB( DB_MASTER ); $seqVal = $dbw->nextSequenceValue( 'user_user_id_seq' ); $dbw->insert( 'user', array( @@ -2119,7 +2119,7 @@ class User { if ( isset( $res ) ) return $res; else { - $dbr =& wfGetDB( DB_SLAVE ); + $dbr = wfGetDB( DB_SLAVE ); return $res = $dbr->selectField( 'user', 'max(user_id)', false, 'User::getMaxID' ); } } @@ -2295,7 +2295,7 @@ class User { $token = $this->generateToken( $this->mId . $this->mEmail . $expires ); $hash = md5( $token ); - $dbw =& wfGetDB( DB_MASTER ); + $dbw = wfGetDB( DB_MASTER ); $dbw->update( 'user', array( 'user_email_token' => $hash, 'user_email_token_expires' => $dbw->timestamp( $expires ) ), diff --git a/includes/UserMailer.php b/includes/UserMailer.php index 55f6799559..fe08ae2034 100644 --- a/includes/UserMailer.php +++ b/includes/UserMailer.php @@ -245,7 +245,7 @@ class EmailNotification { $userCondition = false; } if( $userCondition ) { - $dbr =& wfGetDB( DB_MASTER ); + $dbr = wfGetDB( DB_MASTER ); $res = $dbr->select( 'watchlist', array( 'wl_user' ), array( @@ -292,7 +292,7 @@ class EmailNotification { if ( $wgShowUpdatedMarker || $wgEnotifWatchlist ) { # mark the changed watch-listed page with a timestamp, so that the page is # listed with an "updated since your last visit" icon in the watch list, ... - $dbw =& wfGetDB( DB_MASTER ); + $dbw = wfGetDB( DB_MASTER ); $success = $dbw->update( 'watchlist', array( /* SET */ 'wl_notificationtimestamp' => $dbw->timestamp($timestamp) diff --git a/includes/WatchedItem.php b/includes/WatchedItem.php index 06451bc121..b0376e3d1e 100644 --- a/includes/WatchedItem.php +++ b/includes/WatchedItem.php @@ -37,7 +37,7 @@ class WatchedItem { # remember that talk namespaces are numbered as page namespace+1. $fname = 'WatchedItem::isWatched'; - $dbr =& wfGetDB( DB_SLAVE ); + $dbr = wfGetDB( DB_SLAVE ); $res = $dbr->select( 'watchlist', 1, array( 'wl_user' => $this->id, 'wl_namespace' => $this->ns, 'wl_title' => $this->ti ), $fname ); $iswatched = ($dbr->numRows( $res ) > 0) ? 1 : 0; @@ -53,7 +53,7 @@ class WatchedItem { // Use INSERT IGNORE to avoid overwriting the notification timestamp // if there's already an entry for this page - $dbw =& wfGetDB( DB_MASTER ); + $dbw = wfGetDB( DB_MASTER ); $dbw->insert( 'watchlist', array( 'wl_user' => $this->id, @@ -80,7 +80,7 @@ class WatchedItem { $fname = 'WatchedItem::removeWatch'; $success = false; - $dbw =& wfGetDB( DB_MASTER ); + $dbw = wfGetDB( DB_MASTER ); $dbw->delete( 'watchlist', array( 'wl_user' => $this->id, @@ -134,7 +134,7 @@ class WatchedItem { $oldtitle = $ot->getDBkey(); $newtitle = $nt->getDBkey(); - $dbw =& wfGetDB( DB_MASTER ); + $dbw = wfGetDB( DB_MASTER ); $res = $dbw->select( 'watchlist', 'wl_user', array( 'wl_namespace' => $oldnamespace, 'wl_title' => $oldtitle ), $fname, 'FOR UPDATE' diff --git a/includes/Wiki.php b/includes/Wiki.php index a0624e906d..cb5cce516c 100644 --- a/includes/Wiki.php +++ b/includes/Wiki.php @@ -234,7 +234,7 @@ class MediaWiki { if( $action == 'view' && !$request->getVal( 'oldid' ) && $request->getVal( 'redirect' ) != 'no' ) { - $dbr =& wfGetDB(DB_SLAVE); + $dbr = wfGetDB(DB_SLAVE); $article->loadPageData($article->pageDataFromTitle($dbr, $title)); /* Follow redirects only for... redirects */ @@ -288,7 +288,7 @@ class MediaWiki { */ function doUpdates ( &$updates ) { wfProfileIn( 'MediaWiki::doUpdates' ); - $dbw =& wfGetDB( DB_MASTER ); + $dbw = wfGetDB( DB_MASTER ); foreach( $updates as $up ) { $up->doUpdate(); diff --git a/includes/api/ApiPageSet.php b/includes/api/ApiPageSet.php index c1009ea4a2..1b555673bf 100644 --- a/includes/api/ApiPageSet.php +++ b/includes/api/ApiPageSet.php @@ -308,7 +308,7 @@ class ApiPageSet extends ApiQueryBase { if($linkBatch->isEmpty()) return; - $db = & $this->getDB(); + $db = $this->getDB(); $set = $linkBatch->constructSet('page', $db); // Get pageIDs data from the `page` table @@ -331,7 +331,7 @@ class ApiPageSet extends ApiQueryBase { 'page_id' => $pageids ); - $db = & $this->getDB(); + $db = $this->getDB(); // Get pageIDs data from the `page` table $this->profileDBIn(); @@ -406,7 +406,7 @@ class ApiPageSet extends ApiQueryBase { if(empty($revids)) return; - $db = & $this->getDB(); + $db = $this->getDB(); $pageids = array(); $remaining = array_flip($revids); @@ -438,7 +438,7 @@ class ApiPageSet extends ApiQueryBase { private function resolvePendingRedirects() { if($this->mResolveRedirects) { - $db = & $this->getDB(); + $db = $this->getDB(); $pageFlds = $this->getPageTableFields(); // Repeat until all redirects have been resolved @@ -470,7 +470,7 @@ class ApiPageSet extends ApiQueryBase { private function getRedirectTargets() { $linkBatch = new LinkBatch(); - $db = & $this->getDB(); + $db = $this->getDB(); // find redirect targets for all redirect pages $this->profileDBIn(); diff --git a/includes/api/ApiQuery.php b/includes/api/ApiQuery.php index d58cc5cae6..72859d8997 100644 --- a/includes/api/ApiQuery.php +++ b/includes/api/ApiQuery.php @@ -79,10 +79,10 @@ class ApiQuery extends ApiBase { $this->mAllowedGenerators = array_merge($this->mListModuleNames, $this->mPropModuleNames); } - public function & getDB() { + public function getDB() { if (!isset ($this->mSlaveDB)) { $this->profileDBIn(); - $this->mSlaveDB = & wfGetDB(DB_SLAVE); + $this->mSlaveDB = wfGetDB(DB_SLAVE); $this->profileDBOut(); } return $this->mSlaveDB; diff --git a/includes/api/ApiQueryAllpages.php b/includes/api/ApiQueryAllpages.php index 9b5b0a798e..df137d39ce 100644 --- a/includes/api/ApiQueryAllpages.php +++ b/includes/api/ApiQueryAllpages.php @@ -49,7 +49,7 @@ class ApiQueryAllpages extends ApiQueryGeneratorBase { private function run($resultPageSet = null) { wfProfileIn($this->getModuleProfileName() . '-getDB'); - $db = & $this->getDB(); + $db = $this->getDB(); wfProfileOut($this->getModuleProfileName() . '-getDB'); wfProfileIn($this->getModuleProfileName() . '-parseParams'); diff --git a/includes/api/ApiQueryBacklinks.php b/includes/api/ApiQueryBacklinks.php index c875df3ba3..a799c7d74f 100644 --- a/includes/api/ApiQueryBacklinks.php +++ b/includes/api/ApiQueryBacklinks.php @@ -122,7 +122,7 @@ class ApiQueryBacklinks extends ApiQueryGeneratorBase { if ($redirect) $this->addWhereFld('page_is_redirect', 0); - $db = & $this->getDB(); + $db = $this->getDB(); if (!is_null($continue)) { $plfrm = intval($this->contID); if ($this->contLevel == 0) { diff --git a/includes/api/ApiQueryLogEvents.php b/includes/api/ApiQueryLogEvents.php index f6d55bfce2..73e0c8452f 100644 --- a/includes/api/ApiQueryLogEvents.php +++ b/includes/api/ApiQueryLogEvents.php @@ -39,7 +39,7 @@ class ApiQueryLogEvents extends ApiQueryBase { $limit = $type = $start = $end = $dir = $user = $title = null; extract($this->extractRequestParams()); - $db = & $this->getDB(); + $db = $this->getDB(); list($tbl_logging, $tbl_page, $tbl_user) = $db->tableNamesN('logging', 'page', 'user'); diff --git a/includes/api/ApiQueryRecentChanges.php b/includes/api/ApiQueryRecentChanges.php index a25a4e0fcb..b1cf4102f8 100644 --- a/includes/api/ApiQueryRecentChanges.php +++ b/includes/api/ApiQueryRecentChanges.php @@ -87,7 +87,7 @@ class ApiQueryRecentChanges extends ApiQueryBase { $data = array (); $count = 0; - $db = & $this->getDB(); + $db = $this->getDB(); $res = $this->select(__METHOD__); while ($row = $db->fetchObject($res)) { if (++ $count > $limit) { diff --git a/includes/api/ApiQueryRevisions.php b/includes/api/ApiQueryRevisions.php index 4b77546a07..d2c043611a 100644 --- a/includes/api/ApiQueryRevisions.php +++ b/includes/api/ApiQueryRevisions.php @@ -149,7 +149,7 @@ class ApiQueryRevisions extends ApiQueryBase { $count = 0; $res = $this->select(__METHOD__); - $db = & $this->getDB(); + $db = $this->getDB(); while ($row = $db->fetchObject($res)) { if (++ $count > $limit) { diff --git a/includes/api/ApiQueryUserContributions.php b/includes/api/ApiQueryUserContributions.php index e0bb692463..d518e889d9 100644 --- a/includes/api/ApiQueryUserContributions.php +++ b/includes/api/ApiQueryUserContributions.php @@ -44,7 +44,7 @@ class ApiQueryContributions extends ApiQueryBase { extract($this->extractRequestParams()); //Get a database instance - $db = & $this->getDB(); + $db = $this->getDB(); if (is_null($user)) $this->dieUsage("User parameter may not be empty", 'param_user'); diff --git a/install-utils.inc b/install-utils.inc index 3ff06ecee3..7d599f50b8 100644 --- a/install-utils.inc +++ b/install-utils.inc @@ -94,10 +94,10 @@ function dbsource( $fname, $db = false ) { // Try $wgDatabase, which is used in the install and update scripts global $wgDatabase; if ( isset( $wgDatabase ) ) { - $db =& $wgDatabase; + $db = $wgDatabase; } else { // No? Well, we must be outside of those scripts, so use the standard method - $db =& wfGetDB( DB_MASTER ); + $db = wfGetDB( DB_MASTER ); } } $error = $db->sourceFile( $fname ); @@ -110,7 +110,7 @@ function dbsource( $fname, $db = false ) { # Obsolete, use Database::fieldExists() function field_exists( $table, $field ) { $fname = 'Update script: field_exists'; - $db =& wfGetDB( DB_SLAVE ); + $db = wfGetDB( DB_SLAVE ); $res = $db->query( "DESCRIBE $table", $fname ); $found = false; diff --git a/maintenance/addwiki.php b/maintenance/addwiki.php index 5a556bbb21..7bb31234f8 100644 --- a/maintenance/addwiki.php +++ b/maintenance/addwiki.php @@ -19,7 +19,7 @@ function addWiki( $lang, $site, $dbName ) $name = $wgLanguageNames[$lang]; - $dbw =& wfGetDB( DB_WRITE ); + $dbw = wfGetDB( DB_WRITE ); $common = "/home/wikipedia/common"; $maintenance = "$IP/maintenance"; diff --git a/maintenance/attachLatest.php b/maintenance/attachLatest.php index d9d0d5dbe6..b24143ca12 100644 --- a/maintenance/attachLatest.php +++ b/maintenance/attachLatest.php @@ -30,7 +30,7 @@ $fixit = isset( $options['fix'] ); $fname = 'attachLatest'; echo "Looking for pages with page_latest set to 0...\n"; -$dbw =& wfGetDB( DB_MASTER ); +$dbw = wfGetDB( DB_MASTER ); $result = $dbw->select( 'page', array( 'page_id', 'page_namespace', 'page_title' ), array( 'page_latest' => 0 ), diff --git a/maintenance/attribute.php b/maintenance/attribute.php index bfdddd7977..4f575cbaa5 100644 --- a/maintenance/attribute.php +++ b/maintenance/attribute.php @@ -22,7 +22,7 @@ if ( count( $args ) < 2 ) { $source = $args[0]; $dest = $args[1]; -$dbr =& wfGetDB( DB_SLAVE ); +$dbr = wfGetDB( DB_SLAVE ); extract( $dbr->tableNames( 'page', 'revision','user' )); $eSource = $dbr->strencode( $source ); $eDest = $dbr->strencode( $dest ); diff --git a/maintenance/backup.inc b/maintenance/backup.inc index a611569ee8..2c3ce6bb4d 100644 --- a/maintenance/backup.inc +++ b/maintenance/backup.inc @@ -209,7 +209,7 @@ class BackupDumper { $table = ($history == WikiExporter::CURRENT) ? 'page' : 'revision'; $field = ($history == WikiExporter::CURRENT) ? 'page_id' : 'rev_id'; - $dbr =& wfGetDB( DB_SLAVE ); + $dbr = wfGetDB( DB_SLAVE ); $this->maxCount = $dbr->selectField( $table, "MAX($field)", '', 'BackupDumper::dump' ); $this->startTime = wfTime(); } diff --git a/maintenance/changePassword.php b/maintenance/changePassword.php index 9c1cb48d2b..82913411ec 100644 --- a/maintenance/changePassword.php +++ b/maintenance/changePassword.php @@ -17,7 +17,7 @@ class ChangePassword { $this->user = User::newFromName( $user ); $this->password = $password; - $this->dbw =& wfGetDB( DB_MASTER ); + $this->dbw = wfGetDB( DB_MASTER ); } function main() { diff --git a/maintenance/checkUsernames.php b/maintenance/checkUsernames.php index 60e52181a4..cfff3468fa 100644 --- a/maintenance/checkUsernames.php +++ b/maintenance/checkUsernames.php @@ -11,7 +11,7 @@ class checkUsernames { function main() { $fname = 'checkUsernames::main'; - $dbr =& wfGetDB( DB_SLAVE ); + $dbr = wfGetDB( DB_SLAVE ); $res = $dbr->select( 'user', array( 'user_id', 'user_name' ), diff --git a/maintenance/cleanupDupes.inc b/maintenance/cleanupDupes.inc index cdabdff32c..ce1ffc6ea0 100644 --- a/maintenance/cleanupDupes.inc +++ b/maintenance/cleanupDupes.inc @@ -25,7 +25,7 @@ */ function fixDupes( $fixthem = false) { - $dbw =& wfGetDB( DB_MASTER ); + $dbw = wfGetDB( DB_MASTER ); $cur = $dbw->tableName( 'cur' ); $old = $dbw->tableName( 'old' ); $dbw->query( "LOCK TABLES $cur WRITE, $old WRITE" ); @@ -112,7 +112,7 @@ END } function checkDupes( $fixthem = false, $indexonly = false ) { - $dbw =& wfGetDB( DB_MASTER ); + $dbw = wfGetDB( DB_MASTER ); if( $dbw->indexExists( 'cur', 'name_title' ) && $dbw->indexUnique( 'cur', 'name_title' ) ) { echo wfWikiID().": cur table has the current unique index; no duplicate entries.\n"; diff --git a/maintenance/cleanupSpam.php b/maintenance/cleanupSpam.php index 2ad0a9c3b7..0972d03092 100644 --- a/maintenance/cleanupSpam.php +++ b/maintenance/cleanupSpam.php @@ -31,7 +31,7 @@ function cleanupArticle( $id, $domain ) { // This happens e.g. when a link comes from a template rather than the page itself print "False match\n"; } else { - $dbw =& wfGetDB( DB_MASTER ); + $dbw = wfGetDB( DB_MASTER ); $dbw->immediateBegin(); if ( !$rev ) { // Didn't find a non-spammy revision, blank the page @@ -74,11 +74,11 @@ if ( !$like ) { exit(1); } -$dbr =& wfGetDB( DB_SLAVE ); +$dbr = wfGetDB( DB_SLAVE ); if ( $options['all'] ) { // Clean up spam on all wikis - $dbr =& wfGetDB( DB_SLAVE ); + $dbr = wfGetDB( DB_SLAVE ); print "Finding spam on " . count($wgLocalDatabases) . " wikis\n"; $found = false; foreach ( $wgLocalDatabases as $db ) { diff --git a/maintenance/cleanupTitles.php b/maintenance/cleanupTitles.php index 96be570a3a..0fb97c6e57 100644 --- a/maintenance/cleanupTitles.php +++ b/maintenance/cleanupTitles.php @@ -84,7 +84,7 @@ class TitleCleanup extends TableCleanup { $this->log( "DRY RUN: would rename $row->page_id ($row->page_namespace,'$row->page_title') to ($row->page_namespace,'$dest')" ); } else { $this->log( "renaming $row->page_id ($row->page_namespace,'$row->page_title') to ($row->page_namespace,'$dest')" ); - $dbw =& wfGetDB( DB_MASTER ); + $dbw = wfGetDB( DB_MASTER ); $dbw->update( 'page', array( 'page_title' => $dest ), array( 'page_id' => $row->page_id ), @@ -117,7 +117,7 @@ class TitleCleanup extends TableCleanup { $this->log( "DRY RUN: would rename $row->page_id ($row->page_namespace,'$row->page_title') to ($row->page_namespace,'$dest')" ); } else { $this->log( "renaming $row->page_id ($row->page_namespace,'$row->page_title') to ($ns,'$dest')" ); - $dbw =& wfGetDB( DB_MASTER ); + $dbw = wfGetDB( DB_MASTER ); $dbw->update( 'page', array( 'page_namespace' => $ns, diff --git a/maintenance/cleanupWatchlist.php b/maintenance/cleanupWatchlist.php index 1e97f9b980..161a984665 100644 --- a/maintenance/cleanupWatchlist.php +++ b/maintenance/cleanupWatchlist.php @@ -119,7 +119,7 @@ class WatchlistCleanup extends FiveUpgrade { function removeWatch( $row ) { if( !$this->dryrun) { - $dbw =& wfGetDB( DB_MASTER ); + $dbw = wfGetDB( DB_MASTER ); $dbw->delete( 'watchlist', array( 'wl_user' => $row->wl_user, 'wl_namespace' => $row->wl_namespace, diff --git a/maintenance/clear_interwiki_cache.php b/maintenance/clear_interwiki_cache.php index 8a83d4deac..6f4cfe1783 100644 --- a/maintenance/clear_interwiki_cache.php +++ b/maintenance/clear_interwiki_cache.php @@ -8,7 +8,7 @@ /** */ require_once('commandLine.inc'); -$dbr =& wfGetDB( DB_SLAVE ); +$dbr = wfGetDB( DB_SLAVE ); $res = $dbr->select( 'interwiki', array( 'iw_prefix' ), false ); $prefixes = array(); while ( $row = $dbr->fetchObject( $res ) ) { diff --git a/maintenance/convertLinks.inc b/maintenance/convertLinks.inc index 92c59550c4..d0c57f784a 100644 --- a/maintenance/convertLinks.inc +++ b/maintenance/convertLinks.inc @@ -42,7 +42,7 @@ function convertLinks() { $perfLogFilename = "convLinksPerf.txt"; #-------------------------------------------------------------------- - $dbw =& wfGetDB( DB_MASTER ); + $dbw = wfGetDB( DB_MASTER ); list ($cur, $links, $links_temp, $links_backup) = $dbw->tableNamesN( 'cur', 'links', 'links_temp', 'links_backup' ); $res = $dbw->query( "SELECT l_from FROM $links LIMIT 1" ); diff --git a/maintenance/deleteBatch.php b/maintenance/deleteBatch.php index 14da6d84e3..3021b11884 100644 --- a/maintenance/deleteBatch.php +++ b/maintenance/deleteBatch.php @@ -45,7 +45,7 @@ if ( !$file ) { exit; } -$dbw =& wfGetDB( DB_MASTER ); +$dbw = wfGetDB( DB_MASTER ); for ( $linenum = 1; !feof( $file ); $linenum++ ) { $line = trim( fgets( $file ) ); diff --git a/maintenance/deleteDefaultMessages.php b/maintenance/deleteDefaultMessages.php index 7692400218..a649da4cac 100644 --- a/maintenance/deleteDefaultMessages.php +++ b/maintenance/deleteDefaultMessages.php @@ -18,7 +18,7 @@ function deleteDefaultMessages() { $wgUser = User::newFromName( $user ); $wgUser->addGroup( 'bot' ); - $dbr =& wfGetDB( DB_SLAVE ); + $dbr = wfGetDB( DB_SLAVE ); $res = $dbr->select( array( 'page', 'revision' ), array( 'page_namespace', 'page_title' ), array( @@ -28,7 +28,7 @@ function deleteDefaultMessages() { ) ); - $dbw =& wfGetDB( DB_MASTER ); + $dbw = wfGetDB( DB_MASTER ); while ( $row = $dbr->fetchObject( $res ) ) { if ( function_exists( 'wfWaitForSlaves' ) ) { diff --git a/maintenance/deleteImageMemcached.php b/maintenance/deleteImageMemcached.php index 6af0e3a9fa..267c2a6bd2 100644 --- a/maintenance/deleteImageMemcached.php +++ b/maintenance/deleteImageMemcached.php @@ -19,7 +19,7 @@ class DeleteImageCache { ini_set( 'display_errors', false ); - $dbr =& wfGetDB( DB_SLAVE ); + $dbr = wfGetDB( DB_SLAVE ); $res = $dbr->select( 'image', array( 'img_name' ), @@ -46,7 +46,7 @@ class DeleteImageCache { function getImageCount() { $fname = 'DeleteImageCache::getImageCount'; - $dbr =& wfGetDB( DB_SLAVE ); + $dbr = wfGetDB( DB_SLAVE ); return $dbr->selectField( 'image', 'COUNT(*)', array(), $fname ); } } diff --git a/maintenance/deleteOldRevisions.inc b/maintenance/deleteOldRevisions.inc index d6bb71400f..8d8ca9a1ee 100644 --- a/maintenance/deleteOldRevisions.inc +++ b/maintenance/deleteOldRevisions.inc @@ -12,7 +12,7 @@ require_once( 'purgeOldText.inc' ); function DeleteOldRevisions( $delete = false ) { # Data should come off the master, wrapped in a transaction - $dbw =& wfGetDB( DB_MASTER ); + $dbw = wfGetDB( DB_MASTER ); $dbw->begin(); $tbl_pag = $dbw->tableName( 'page' ); diff --git a/maintenance/deleteOrphanedRevisions.php b/maintenance/deleteOrphanedRevisions.php index a10d29c8ad..302099e68e 100644 --- a/maintenance/deleteOrphanedRevisions.php +++ b/maintenance/deleteOrphanedRevisions.php @@ -19,7 +19,7 @@ if( isset( $options['help'] ) ) $report = isset( $options['report'] ); -$dbw =& wfGetDB( DB_MASTER ); +$dbw = wfGetDB( DB_MASTER ); $dbw->immediateBegin(); extract( $dbw->tableNames( 'page', 'revision' ) ); diff --git a/maintenance/deleteRevision.php b/maintenance/deleteRevision.php index eb65e23406..af9726008d 100644 --- a/maintenance/deleteRevision.php +++ b/maintenance/deleteRevision.php @@ -1,7 +1,7 @@ [ ...]\n"; diff --git a/maintenance/dumpHTML.inc b/maintenance/dumpHTML.inc index f46a335c47..ca2a7df6d8 100644 --- a/maintenance/dumpHTML.inc +++ b/maintenance/dumpHTML.inc @@ -245,7 +245,7 @@ class DumpHTML { function doLocalImageDescriptions() { $chunkSize = 1000; - $dbr =& wfGetDB( DB_SLAVE ); + $dbr = wfGetDB( DB_SLAVE ); $cp = $this->getCheckpoint( 'local image' ); if ( $cp == 'done' ) { @@ -345,7 +345,7 @@ class DumpHTML { $chunkSize = 1000; $this->setupGlobals(); - $dbr =& wfGetDB( DB_SLAVE ); + $dbr = wfGetDB( DB_SLAVE ); $cp = $this->getCheckpoint( 'category' ); if ( $cp == 'done' ) { @@ -408,7 +408,7 @@ class DumpHTML { } $this->setupGlobals(); - $dbr =& wfGetDB( DB_SLAVE ); + $dbr = wfGetDB( DB_SLAVE ); $i = 0; for ( $chunkStart = $start; $chunkStart <= $end; $chunkStart += $chunkSize ) { @@ -956,7 +956,7 @@ ENDTEXT; function getMaxPageID() { if ( $this->maxPageID === false ) { - $dbr =& wfGetDB( DB_SLAVE ); + $dbr = wfGetDB( DB_SLAVE ); $this->maxPageID = $dbr->selectField( 'page', 'max(page_id)', false, __METHOD__ ); } return $this->maxPageID; diff --git a/maintenance/dumpHTML.php b/maintenance/dumpHTML.php index 726a649074..b9b052edd6 100644 --- a/maintenance/dumpHTML.php +++ b/maintenance/dumpHTML.php @@ -61,7 +61,7 @@ if ( !empty( $options['s'] ) ) { if ( !empty( $options['e'] ) ) { $end = $options['e']; } else { - $dbr =& wfGetDB( DB_SLAVE ); + $dbr = wfGetDB( DB_SLAVE ); $end = $dbr->selectField( 'page', 'max(page_id)', false ); } @@ -116,7 +116,7 @@ if ( $options['special'] ) { $wgHTMLDump->doSharedImageDescriptions(); } else { print "Creating static HTML dump in directory $dest. \n"; - $dbr =& wfGetDB( DB_SLAVE ); + $dbr = wfGetDB( DB_SLAVE ); $server = $dbr->getProperty( 'mServer' ); print "Using database {$server}\n"; diff --git a/maintenance/dumpLinks.php b/maintenance/dumpLinks.php index 71ae43f503..cb883e4f4d 100644 --- a/maintenance/dumpLinks.php +++ b/maintenance/dumpLinks.php @@ -31,7 +31,7 @@ require_once 'commandLine.inc'; -$dbr =& wfGetDB( DB_SLAVE ); +$dbr = wfGetDB( DB_SLAVE ); $result = $dbr->select( array( 'pagelinks', 'page' ), array( 'page_id', diff --git a/maintenance/dumpReplayLog.php b/maintenance/dumpReplayLog.php index 8902e7e6f8..07749f4149 100644 --- a/maintenance/dumpReplayLog.php +++ b/maintenance/dumpReplayLog.php @@ -10,7 +10,7 @@ require_once( 'includes/SpecialExport.php' ); /** */ function dumpReplayLog( $start ) { - $dbw =& wfGetDB( DB_MASTER ); + $dbw = wfGetDB( DB_MASTER ); $recentchanges = $dbw->tableName( 'recentchanges' ); $result =& $dbw->safeQuery( "SELECT * FROM $recentchanges WHERE rc_timestamp >= " . $dbw->timestamp( $start ) . ' ORDER BY rc_timestamp'); @@ -33,7 +33,7 @@ function dumpReplayEntry( $row ) { case RC_EDIT: case RC_NEW: # Edit - $dbr =& wfGetDB( DB_MASTER ); + $dbr = wfGetDB( DB_MASTER ); $out = " \n"; $out .= " " . xmlsafe( $title->getPrefixedText() ) . "\n"; @@ -64,7 +64,7 @@ function dumpReplayEntry( $row ) { $out .= " \n"; break; case RC_LOG: - $dbr =& wfGetDB( DB_MASTER ); + $dbr = wfGetDB( DB_MASTER ); $s = $dbr->selectRow( 'logging', array( 'log_type', 'log_action', 'log_timestamp', 'log_user', 'log_namespace', 'log_title', 'log_comment' ), diff --git a/maintenance/fixSlaveDesync.php b/maintenance/fixSlaveDesync.php index e62126acfa..aec77b1edb 100644 --- a/maintenance/fixSlaveDesync.php +++ b/maintenance/fixSlaveDesync.php @@ -20,7 +20,7 @@ $reportingInterval = 1000; if ( isset( $args[0] ) ) { desyncFixPage( $args[0] ); } else { - $dbw =& wfGetDB( DB_MASTER ); + $dbw = wfGetDB( DB_MASTER ); $maxPage = $dbw->selectField( 'page', 'MAX(page_id)', false, 'fixDesync.php' ); $corrupt = findPageLatestCorruption(); foreach ( $corrupt as $id => $dummy ) { @@ -38,7 +38,7 @@ if ( isset( $args[0] ) ) { function findPageLatestCorruption() { $desync = array(); $n = 0; - $dbw =& wfGetDB( DB_MASTER ); + $dbw = wfGetDB( DB_MASTER ); $masterIDs = array(); $res = $dbw->select( 'page', array( 'page_id', 'page_latest' ), array( 'page_id<6054123' ), __METHOD__ ); print "Number of pages: " . $dbw->numRows( $res ) . "\n"; @@ -53,7 +53,7 @@ function findPageLatestCorruption() { global $slaveIndexes; foreach ( $slaveIndexes as $i ) { - $db =& wfGetDB( $i ); + $db = wfGetDB( $i ); $res = $db->select( 'page', array( 'page_id', 'page_latest' ), array( 'page_id<6054123' ), __METHOD__ ); while ( $row = $db->fetchObject( $res ) ) { if ( isset( $masterIDs[$row->page_id] ) && $masterIDs[$row->page_id] != $row->page_latest ) { @@ -72,14 +72,14 @@ function desyncFixPage( $pageID ) { $fname = 'desyncFixPage'; # Check for a corrupted page_latest - $dbw =& wfGetDB( DB_MASTER ); + $dbw = wfGetDB( DB_MASTER ); $dbw->begin(); $realLatest = $dbw->selectField( 'page', 'page_latest', array( 'page_id' => $pageID ), $fname, 'FOR UPDATE' ); #list( $masterFile, $masterPos ) = $dbw->getMasterPos(); $found = false; foreach ( $slaveIndexes as $i ) { - $db =& wfGetDB( $i ); + $db = wfGetDB( $i ); /* if ( !$db->masterPosWait( $masterFile, $masterPos, 10 ) ) { echo "Slave is too lagged, aborting\n"; @@ -155,7 +155,7 @@ function desyncFixPage( $pageID ) { } } else { foreach ( $slaveIndexes as $i ) { - $db =& wfGetDB( $i ); + $db = wfGetDB( $i ); $db->insert( 'revision', get_object_vars( $row ), $fname, 'IGNORE' ); } } @@ -166,7 +166,7 @@ function desyncFixPage( $pageID ) { $dbw->insert( 'text', get_object_vars( $row ), $fname, 'IGNORE' ); } else { foreach ( $slaveIndexes as $i ) { - $db =& wfGetDB( $i ); + $db = wfGetDB( $i ); $db->insert( 'text', get_object_vars( $row ), $fname, 'IGNORE' ); } } @@ -180,7 +180,7 @@ function desyncFixPage( $pageID ) { #$dbw->update( 'page', array( 'page_latest' => $realLatest ), array( 'page_id' => $pageID ), $fname ); } else { foreach ( $slaveIndexes as $i ) { - $db =& wfGetDB( $i ); + $db = wfGetDB( $i ); $db->update( 'page', array( 'page_latest' => $realLatest ), array( 'page_id' => $pageID ), $fname ); } } diff --git a/maintenance/fixTimestamps.php b/maintenance/fixTimestamps.php index 784e35cdfc..abd861d401 100644 --- a/maintenance/fixTimestamps.php +++ b/maintenance/fixTimestamps.php @@ -22,7 +22,7 @@ $fname = 'fixTimestamps.php'; $grace = 60; // maximum normal clock offset # Find bounding revision IDs -$dbw =& wfGetDB( DB_MASTER ); +$dbw = wfGetDB( DB_MASTER ); $revisionTable = $dbw->tableName( 'revision' ); $res = $dbw->query( "SELECT MIN(rev_id) as minrev, MAX(rev_id) as maxrev FROM $revisionTable " . "WHERE rev_timestamp BETWEEN '{$start}' AND '{$end}'", $fname ); diff --git a/maintenance/fixUserRegistration.php b/maintenance/fixUserRegistration.php index af8a68c2b0..471ef05598 100644 --- a/maintenance/fixUserRegistration.php +++ b/maintenance/fixUserRegistration.php @@ -8,8 +8,8 @@ require_once( 'commandLine.inc' ); $fname = 'fixUserRegistration.php'; -$dbr =& wfGetDB( DB_SLAVE ); -$dbw =& wfGetDB( DB_MASTER ); +$dbr = wfGetDB( DB_SLAVE ); +$dbw = wfGetDB( DB_MASTER ); // Get user IDs which need fixing $res = $dbr->select( 'user', 'user_id', 'user_registration IS NULL', $fname ); diff --git a/maintenance/generateSitemap.php b/maintenance/generateSitemap.php index 05427bd98e..164929197f 100644 --- a/maintenance/generateSitemap.php +++ b/maintenance/generateSitemap.php @@ -153,7 +153,7 @@ class GenerateSitemap { $this->compress = $compress; $this->stderr = fopen( 'php://stderr', 'wt' ); - $this->dbr =& wfGetDB( DB_SLAVE ); + $this->dbr = wfGetDB( DB_SLAVE ); $this->generateNamespaces(); $this->timestamp = wfTimestamp( TS_ISO_8601, wfTimestampNow() ); $this->findex = fopen( "{$this->fspath}sitemap-index-" . wfWikiID() . ".xml", 'wb' ); diff --git a/maintenance/importLogs.inc b/maintenance/importLogs.inc index cf584dad0a..0dc87eab8f 100644 --- a/maintenance/importLogs.inc +++ b/maintenance/importLogs.inc @@ -42,7 +42,7 @@ class LogImporter { function LogImporter( $type ) { $this->type = $type; - $this->db =& wfGetDB( DB_MASTER ); + $this->db = wfGetDB( DB_MASTER ); $this->actions = $this->setupActions(); } diff --git a/maintenance/moveBatch.php b/maintenance/moveBatch.php index 28a4495516..058652dcdc 100644 --- a/maintenance/moveBatch.php +++ b/maintenance/moveBatch.php @@ -55,7 +55,7 @@ if ( !$file ) { exit; } -$dbw =& wfGetDB( DB_MASTER ); +$dbw = wfGetDB( DB_MASTER ); for ( $linenum = 1; !feof( $file ); $linenum++ ) { $line = fgets( $file ); diff --git a/maintenance/namespaceDupes.php b/maintenance/namespaceDupes.php index acd3a7085c..c5c1ec583a 100644 --- a/maintenance/namespaceDupes.php +++ b/maintenance/namespaceDupes.php @@ -175,7 +175,7 @@ $fix = isset( $options['fix'] ); $suffix = isset( $options['suffix'] ) ? $options['suffix'] : ''; $prefix = isset( $options['prefix'] ) ? $options['prefix'] : ''; $key = isset( $options['key'] ) ? intval( $options['key'] ) : 0; -$dbw =& wfGetDB( DB_MASTER ); +$dbw = wfGetDB( DB_MASTER ); $duper = new NamespaceConflictChecker( $dbw ); if( $prefix ) { diff --git a/maintenance/nukeNS.php b/maintenance/nukeNS.php index a1ae3f02a3..8e280b2027 100644 --- a/maintenance/nukeNS.php +++ b/maintenance/nukeNS.php @@ -39,7 +39,7 @@ NukeNS( $ns, $delete); function NukeNS($ns_no, $delete) { - $dbw =& wfGetDB( DB_MASTER ); + $dbw = wfGetDB( DB_MASTER ); $dbw->begin(); $tbl_pag = $dbw->tableName( 'page' ); diff --git a/maintenance/nukePage.inc b/maintenance/nukePage.inc index b2ce6b83eb..7b17261449 100644 --- a/maintenance/nukePage.inc +++ b/maintenance/nukePage.inc @@ -11,7 +11,7 @@ require_once( 'purgeOldText.inc' ); function NukePage( $name, $delete = false ) { - $dbw =& wfGetDB( DB_MASTER ); + $dbw = wfGetDB( DB_MASTER ); $dbw->begin(); $tbl_pag = $dbw->tableName( 'page' ); @@ -64,7 +64,7 @@ function NukePage( $name, $delete = false ) { function DeleteRevisions( $ids ) { - $dbw =& wfGetDB( DB_MASTER ); + $dbw = wfGetDB( DB_MASTER ); $dbw->begin(); $tbl_rev = $dbw->tableName( 'revision' ); diff --git a/maintenance/orphans.php b/maintenance/orphans.php index 406de8f461..0729a23969 100644 --- a/maintenance/orphans.php +++ b/maintenance/orphans.php @@ -40,7 +40,7 @@ checkSeparation( isset( $options['fix'] ) ); # ------ function checkOrphans( $fix ) { - $dbw =& wfGetDB( DB_MASTER ); + $dbw = wfGetDB( DB_MASTER ); $page = $dbw->tableName( 'page' ); $revision = $dbw->tableName( 'revision' ); @@ -91,7 +91,7 @@ function checkOrphans( $fix ) { * but valid revisions do exist) */ function checkWidows( $fix ) { - $dbw =& wfGetDB( DB_MASTER ); + $dbw = wfGetDB( DB_MASTER ); $page = $dbw->tableName( 'page' ); $revision = $dbw->tableName( 'revision' ); @@ -134,7 +134,7 @@ function checkWidows( $fix ) { function checkSeparation( $fix ) { - $dbw =& wfGetDB( DB_MASTER ); + $dbw = wfGetDB( DB_MASTER ); $page = $dbw->tableName( 'page' ); $revision = $dbw->tableName( 'revision' ); $text = $dbw->tableName( 'text' ); diff --git a/maintenance/parserTests.inc b/maintenance/parserTests.inc index d4f09eb4bb..6bcb490e7f 100644 --- a/maintenance/parserTests.inc +++ b/maintenance/parserTests.inc @@ -245,7 +245,9 @@ class ParserTest { $data[$section] .= $line; } } - print "\n"; + if ( $this->showProgress ) { + print "\n"; + } return $ok; } @@ -338,7 +340,7 @@ class ParserTest { */ function setupGlobals($opts = '') { # Save the prefixed / quoted table names for later use when we make the temporaries. - $db =& wfGetDB( DB_READ ); + $db = wfGetDB( DB_READ ); $this->oldTableNames = array(); foreach( $this->listTables() as $table ) { $this->oldTableNames[$table] = $db->tableName( $table ); @@ -448,7 +450,7 @@ class ParserTest { if (!$setupDB && $wgDBprefix === 'parsertest_') { # oh teh horror $GLOBALS['wgLoadBalancer'] = LoadBalancer::newFromParams( $GLOBALS['wgDBservers'] ); - $db =& wfGetDB( DB_MASTER ); + $db = wfGetDB( DB_MASTER ); $tables = $this->listTables(); @@ -1018,7 +1020,7 @@ class DbTestRecorder extends TestRecorder { $differences = $this->compareResult( $before, $after ); if( $differences ) { $count = count($differences); - printf( "%4d %s\n", $count, $label ); + printf( "\n%4d %s\n", $count, $label ); foreach ($differences as $differing_test_name) { print " * $differing_test_name\n"; } diff --git a/maintenance/purgeOldText.inc b/maintenance/purgeOldText.inc index b6942e793b..8938cc0d85 100644 --- a/maintenance/purgeOldText.inc +++ b/maintenance/purgeOldText.inc @@ -10,7 +10,7 @@ function PurgeRedundantText( $delete = false ) { # Data should come off the master, wrapped in a transaction - $dbw =& wfGetDB( DB_MASTER ); + $dbw = wfGetDB( DB_MASTER ); $dbw->begin(); $tbl_arc = $dbw->tableName( 'archive' ); diff --git a/maintenance/reassignEdits.inc.php b/maintenance/reassignEdits.inc.php index ddabbb6774..375d2d9485 100644 --- a/maintenance/reassignEdits.inc.php +++ b/maintenance/reassignEdits.inc.php @@ -18,7 +18,7 @@ * @return integer Number of entries changed, or that would be changed */ function reassignEdits( &$from, &$to, $rc = false, $report = false ) { - $dbw =& wfGetDB( DB_MASTER ); + $dbw = wfGetDB( DB_MASTER ); $dbw->immediateBegin(); $fname = 'reassignEdits'; diff --git a/maintenance/rebuildInterwiki.inc b/maintenance/rebuildInterwiki.inc index 447c746690..d85612bd15 100644 --- a/maintenance/rebuildInterwiki.inc +++ b/maintenance/rebuildInterwiki.inc @@ -252,7 +252,7 @@ function makeLink( $entry, &$first, $source ) { } else { $sql .= ",\n"; } - $dbr =& wfGetDB( DB_SLAVE ); + $dbr = wfGetDB( DB_SLAVE ); $sql .= "(" . $dbr->makeList( $entry ) . ")"; return $sql; } diff --git a/maintenance/rebuildrecentchanges.inc b/maintenance/rebuildrecentchanges.inc index 8608ac44c8..d34c6e3722 100644 --- a/maintenance/rebuildrecentchanges.inc +++ b/maintenance/rebuildrecentchanges.inc @@ -10,7 +10,7 @@ function rebuildRecentChangesTablePass1() { $fname = 'rebuildRecentChangesTablePass1'; - $dbw =& wfGetDB( DB_MASTER ); + $dbw = wfGetDB( DB_MASTER ); extract( $dbw->tableNames( 'recentchanges', 'cur', 'old' ) ); $dbw->delete( 'recentchanges', '*' ); @@ -46,7 +46,7 @@ function rebuildRecentChangesTablePass1() function rebuildRecentChangesTablePass2() { - $dbw =& wfGetDB( DB_MASTER ); + $dbw = wfGetDB( DB_MASTER ); list ($recentchanges, $revision) = $dbw->tableNamesN( 'recentchanges', 'revision' ); print( "Updating links...\n" ); diff --git a/maintenance/refreshImageCount.php b/maintenance/refreshImageCount.php index 88ac3c52c3..91145bad8b 100644 --- a/maintenance/refreshImageCount.php +++ b/maintenance/refreshImageCount.php @@ -5,7 +5,7 @@ require_once( "commandLine.inc" ); -$dbw =& wfGetDB( DB_MASTER ); +$dbw = wfGetDB( DB_MASTER ); // Load the current value from the master $count = $dbw->selectField( 'site_stats', 'ss_images' ); diff --git a/maintenance/refreshLinks.inc b/maintenance/refreshLinks.inc index 847a35f6fc..7a560e973c 100644 --- a/maintenance/refreshLinks.inc +++ b/maintenance/refreshLinks.inc @@ -12,7 +12,7 @@ function refreshLinks( $start, $newOnly = false, $maxLag = false, $end = 0 ) { global $wgUser, $wgParser, $wgUseImageResize, $wgUseTidy; $fname = 'refreshLinks'; - $dbr =& wfGetDB( DB_SLAVE ); + $dbr = wfGetDB( DB_SLAVE ); $start = intval( $start ); # Don't generate TeX PNGs (lack of a sensible current directory causes errors anyway) @@ -68,7 +68,7 @@ function fixLinksFromArticle( $id ) { global $wgTitle, $wgParser; $wgTitle = Title::newFromID( $id ); - $dbw =& wfGetDB( DB_MASTER ); + $dbw = wfGetDB( DB_MASTER ); $linkCache =& LinkCache::singleton(); $linkCache->clear(); @@ -95,7 +95,7 @@ function deleteLinksFromNonexistent( $maxLag = 0 ) { wfWaitForSlaves( $maxLag ); - $dbw =& wfGetDB( DB_WRITE ); + $dbw = wfGetDB( DB_WRITE ); $linksTables = array( 'pagelinks' => 'pl_from', diff --git a/maintenance/removeUnusedAccounts.inc b/maintenance/removeUnusedAccounts.inc index fb24387ba3..2079123018 100644 --- a/maintenance/removeUnusedAccounts.inc +++ b/maintenance/removeUnusedAccounts.inc @@ -17,7 +17,7 @@ * @return bool */ function isInactiveAccount( $id, $master = false ) { - $dbo =& wfGetDB( $master ? DB_MASTER : DB_SLAVE ); + $dbo = wfGetDB( $master ? DB_MASTER : DB_SLAVE ); $fname = 'isInactiveAccount'; $checks = array( 'revision' => 'rev', 'archive' => 'ar', 'logging' => 'log', 'image' => 'img', 'oldimage' => 'oi' ); diff --git a/maintenance/removeUnusedAccounts.php b/maintenance/removeUnusedAccounts.php index 3cf46ee6cc..42c5f059eb 100644 --- a/maintenance/removeUnusedAccounts.php +++ b/maintenance/removeUnusedAccounts.php @@ -26,7 +26,7 @@ if( isset( $options['help'] ) ) { # Do an initial scan for inactive accounts and report the result echo( "Checking for unused user accounts...\n" ); $del = array(); -$dbr =& wfGetDB( DB_SLAVE ); +$dbr = wfGetDB( DB_SLAVE ); $res = $dbr->select( 'user', array( 'user_id', 'user_name' ), '', $fname ); while( $row = $dbr->fetchObject( $res ) ) { # Check the account, but ignore it if it's the primary administrator @@ -42,7 +42,7 @@ echo( "...found {$count}.\n" ); # If required, go back and delete each marked account if( $count > 0 && isset( $options['delete'] ) ) { echo( "\nDeleting inactive accounts..." ); - $dbw =& wfGetDB( DB_MASTER ); + $dbw = wfGetDB( DB_MASTER ); $dbw->delete( 'user', array( 'user_id' => $del ), $fname ); echo( "done.\n" ); # Update the site_stats.ss_users field diff --git a/maintenance/runJobs.php b/maintenance/runJobs.php index 530a406337..7f7ed9a8a0 100644 --- a/maintenance/runJobs.php +++ b/maintenance/runJobs.php @@ -14,7 +14,7 @@ if ( isset( $options['maxjobs'] ) ) { $wgTitle = Title::newFromText( 'RunJobs.php' ); -$dbw =& wfGetDB( DB_MASTER ); +$dbw = wfGetDB( DB_MASTER ); $n = 0; while ( $dbw->selectField( 'job', 'count(*)', '', 'runJobs.php' ) ) { while ( false != ($job = Job::pop()) ) { diff --git a/maintenance/showJobs.php b/maintenance/showJobs.php index 98e47de2fe..14aff3d56c 100644 --- a/maintenance/showJobs.php +++ b/maintenance/showJobs.php @@ -12,7 +12,7 @@ require_once( "$IP/includes/FakeTitle.php" ); // Trigger errors on inappropriate use of $wgTitle $wgTitle = new FakeTitle; -$dbw =& wfGetDB( DB_MASTER ); +$dbw = wfGetDB( DB_MASTER ); $count = $dbw->selectField( 'job', 'count(*)', '', 'runJobs.php' ); print $count."\n"; diff --git a/maintenance/showStats.php b/maintenance/showStats.php index 27f9be6b01..abab26cbfc 100644 --- a/maintenance/showStats.php +++ b/maintenance/showStats.php @@ -28,7 +28,7 @@ $fields = array( ); // Get cached stats from slave database -$dbr =& wfGetDB( DB_SLAVE ); +$dbr = wfGetDB( DB_SLAVE ); $fname = 'showStats'; $stats = $dbr->selectRow( 'site_stats', '*', '' ); diff --git a/maintenance/storage/checkStorage.php b/maintenance/storage/checkStorage.php index 0c0ab04237..46b938ef45 100644 --- a/maintenance/storage/checkStorage.php +++ b/maintenance/storage/checkStorage.php @@ -40,9 +40,9 @@ class CheckStorage function check( $fix = false, $xml = '' ) { $fname = 'checkStorage'; - $dbr =& wfGetDB( DB_SLAVE ); + $dbr = wfGetDB( DB_SLAVE ); if ( $fix ) { - $dbw =& wfGetDB( DB_MASTER ); + $dbw = wfGetDB( DB_MASTER ); print "Checking, will fix errors if possible...\n"; } else { print "Checking...\n"; @@ -411,8 +411,8 @@ class CheckStorage return; } - $dbr =& wfGetDB( DB_SLAVE ); - $dbw =& wfGetDB( DB_MASTER ); + $dbr = wfGetDB( DB_SLAVE ); + $dbw = wfGetDB( DB_MASTER ); $dbr->ping(); $dbw->ping(); @@ -444,7 +444,7 @@ class CheckStorage } // Find text row again - $dbr =& wfGetDB( DB_SLAVE ); + $dbr = wfGetDB( DB_SLAVE ); $oldId = $dbr->selectField( 'revision', 'rev_text_id', array( 'rev_id' => $id ), $fname ); if ( !$oldId ) { echo "Missing revision row for rev_id $id\n"; @@ -455,7 +455,7 @@ class CheckStorage $flags = Revision::compressRevisionText( $text ); // Update the text row - $dbw =& wfGetDB( DB_MASTER ); + $dbw = wfGetDB( DB_MASTER ); $dbw->update( 'text', array( 'old_flags' => $flags, 'old_text' => $text ), array( 'old_id' => $oldId ), diff --git a/maintenance/storage/compressOld.inc b/maintenance/storage/compressOld.inc index 96ffc89db3..bd1bace2ea 100644 --- a/maintenance/storage/compressOld.inc +++ b/maintenance/storage/compressOld.inc @@ -13,7 +13,7 @@ function compressOldPages( $start = 0, $extdb = '' ) { $chunksize = 50; print "Starting from old_id $start...\n"; - $dbw =& wfGetDB( DB_MASTER ); + $dbw = wfGetDB( DB_MASTER ); do { $res = $dbw->select( 'text', array( 'old_id','old_flags','old_namespace','old_title','old_text' ), "old_id>=$start", $fname, array( 'ORDER BY' => 'old_id', 'LIMIT' => $chunksize, 'FOR UPDATE' ) ); @@ -39,7 +39,7 @@ function compressPage( $row, $extdb ) { #print "Already compressed row {$row->old_id}\n"; return false; } - $dbw =& wfGetDB( DB_MASTER ); + $dbw = wfGetDB( DB_MASTER ); $flags = $row->old_flags ? "{$row->old_flags},gzip" : "gzip"; $compress = gzdeflate( $row->old_text ); @@ -75,8 +75,8 @@ function compressWithConcat( $startId, $maxChunkSize, $maxChunkFactor, $factorTh $fname = 'compressWithConcat'; $loadStyle = LS_CHUNKED; - $dbr =& wfGetDB( DB_SLAVE ); - $dbw =& wfGetDB( DB_MASTER ); + $dbr = wfGetDB( DB_SLAVE ); + $dbw = wfGetDB( DB_MASTER ); # Set up external storage if ( $extdb != '' ) { diff --git a/maintenance/storage/dumpRev.php b/maintenance/storage/dumpRev.php index 4d0ccb5853..a082edc00f 100644 --- a/maintenance/storage/dumpRev.php +++ b/maintenance/storage/dumpRev.php @@ -1,7 +1,7 @@ selectRow( 'old', array( 'old_flags', 'old_text' ), array( 'old_id' => $args[0] ) ); $obj = unserialize( $row->old_text ); @@ -11,4 +11,4 @@ if ( get_class( $obj ) == 'concatenatedgziphistoryblob' ) { var_dump( $obj ); } -?> +?> \ No newline at end of file diff --git a/maintenance/storage/moveToExternal.php b/maintenance/storage/moveToExternal.php index 2b58615144..40ac84d7ee 100644 --- a/maintenance/storage/moveToExternal.php +++ b/maintenance/storage/moveToExternal.php @@ -17,7 +17,7 @@ if ( !defined( 'MEDIAWIKI' ) ) { } $cluster = $args[0]; - $dbw =& wfGetDB( DB_MASTER ); + $dbw = wfGetDB( DB_MASTER ); if ( isset( $options['e'] ) ) { $maxID = $options['e']; @@ -33,8 +33,8 @@ if ( !defined( 'MEDIAWIKI' ) ) { function moveToExternal( $cluster, $maxID, $minID = 1 ) { $fname = 'moveToExternal'; - $dbw =& wfGetDB( DB_MASTER ); - $dbr =& wfGetDB( DB_SLAVE ); + $dbw = wfGetDB( DB_MASTER ); + $dbr = wfGetDB( DB_SLAVE ); $count = $maxID - $minID + 1; $blockSize = 1000; diff --git a/maintenance/storage/resolveStubs.php b/maintenance/storage/resolveStubs.php index 8eb4df247b..973b7b0d5f 100644 --- a/maintenance/storage/resolveStubs.php +++ b/maintenance/storage/resolveStubs.php @@ -18,7 +18,7 @@ if ( !defined( 'MEDIAWIKI' ) ) { function resolveStubs() { $fname = 'resolveStubs'; - $dbr =& wfGetDB( DB_SLAVE ); + $dbr = wfGetDB( DB_SLAVE ); $maxID = $dbr->selectField( 'text', 'MAX(old_id)', false, $fname ); $blockSize = 10000; $numBlocks = intval( $maxID / $blockSize ) + 1; @@ -56,8 +56,8 @@ function resolveStub( $id, $stubText, $flags ) { $stub = unserialize( $stubText ); $flags = explode( ',', $flags ); - $dbr =& wfGetDB( DB_SLAVE ); - $dbw =& wfGetDB( DB_MASTER ); + $dbr = wfGetDB( DB_SLAVE ); + $dbw = wfGetDB( DB_MASTER ); if ( strtolower( get_class( $stub ) ) !== 'historyblobstub' ) { print "Error found object of class " . get_class( $stub ) . ", expecting historyblobstub\n"; diff --git a/maintenance/updateArticleCount.inc.php b/maintenance/updateArticleCount.inc.php index 126593c6ab..d4e2a9e8fc 100644 --- a/maintenance/updateArticleCount.inc.php +++ b/maintenance/updateArticleCount.inc.php @@ -15,7 +15,7 @@ class ArticleCounter { function ArticleCounter() { global $wgContentNamespaces; $this->namespaces = $wgContentNamespaces; - $this->dbr =& wfGetDB( DB_SLAVE ); + $this->dbr = wfGetDB( DB_SLAVE ); } /** diff --git a/maintenance/updateArticleCount.php b/maintenance/updateArticleCount.php index 92ae0ee7e5..03c7939cf3 100644 --- a/maintenance/updateArticleCount.php +++ b/maintenance/updateArticleCount.php @@ -27,7 +27,7 @@ if( $result !== false ) { echo( "found {$result}.\n" ); if( isset( $options['update'] ) && $options['update'] ) { echo( "Updating site statistics table... " ); - $dbw =& wfGetDB( DB_MASTER ); + $dbw = wfGetDB( DB_MASTER ); $dbw->update( 'site_stats', array( 'ss_good_articles' => $result ), array( 'ss_row_id' => 1 ), __METHOD__ ); echo( "done.\n" ); } else { diff --git a/maintenance/updateSearchIndex.inc b/maintenance/updateSearchIndex.inc index 060c8d08df..bf2b8c37e6 100644 --- a/maintenance/updateSearchIndex.inc +++ b/maintenance/updateSearchIndex.inc @@ -13,7 +13,7 @@ function updateSearchIndex( $start, $end, $maxLockTime, $quiet ) { $wgQuiet = $quiet; $wgDisableSearchUpdate = false; - $dbw =& wfGetDB( DB_MASTER ); + $dbw = wfGetDB( DB_MASTER ); $recentchanges = $dbw->tableName( 'recentchanges' ); output( "Updating searchindex between $start and $end\n" ); diff --git a/maintenance/updateSpecialPages.php b/maintenance/updateSpecialPages.php index fae0722c2f..c7f9749d04 100644 --- a/maintenance/updateSpecialPages.php +++ b/maintenance/updateSpecialPages.php @@ -17,7 +17,7 @@ if(@$options['help']) { } $wgOut->disable(); -$dbw =& wfGetDB( DB_MASTER ); +$dbw = wfGetDB( DB_MASTER ); foreach ( $wgQueryPages as $page ) { @list( $class, $special, $limit ) = $page; @@ -86,7 +86,7 @@ foreach ( $wgQueryPages as $page ) { # Wait for the slave to catch up /* - $slaveDB =& wfGetDB( DB_SLAVE, array('QueryPage::recache', 'vslow' ) ); + $slaveDB = wfGetDB( DB_SLAVE, array('QueryPage::recache', 'vslow' ) ); while( $slaveDB->getLag() > 600 ) { print "Slave lagged, waiting...\n"; sleep(30); diff --git a/maintenance/userDupes.php b/maintenance/userDupes.php index 2469c6eb0c..90de160dd9 100644 --- a/maintenance/userDupes.php +++ b/maintenance/userDupes.php @@ -26,7 +26,7 @@ require_once( 'maintenance/userDupes.inc' ); $wgTitle = Title::newFromText( 'Dupe user entry cleanup script' ); $fix = isset( $options['fix'] ); -$dbw =& wfGetDB( DB_MASTER ); +$dbw = wfGetDB( DB_MASTER ); $duper = new UserDupes( $dbw ); $retval = $duper->checkDupes( $fix ); diff --git a/skins/disabled/HTMLDump.php b/skins/disabled/HTMLDump.php index dd2c153c3e..4e1ca4e9bc 100644 --- a/skins/disabled/HTMLDump.php +++ b/skins/disabled/HTMLDump.php @@ -75,7 +75,7 @@ class SkinHTMLDump extends SkinTemplate { if ( $nt->getNamespace() == NS_CATEGORY ) { # Determine if the category has any articles in it - $dbr =& wfGetDB( DB_SLAVE ); + $dbr = wfGetDB( DB_SLAVE ); $hasMembers = $dbr->selectField( 'categorylinks', '1', array( 'cl_to' => $nt->getDBkey() ), __METHOD__ ); if ( $hasMembers ) { diff --git a/skins/disabled/MonoBookCBT.php b/skins/disabled/MonoBookCBT.php index 73562eb0f1..aa9abb0014 100644 --- a/skins/disabled/MonoBookCBT.php +++ b/skins/disabled/MonoBookCBT.php @@ -1017,7 +1017,7 @@ class SkinMonoBookCBT extends SkinTemplate { global $wgPageShowWatchingUsers; if ( !$wgPageShowWatchingUsers ) return ''; - $dbr =& wfGetDB( DB_SLAVE ); + $dbr = wfGetDB( DB_SLAVE ); extract( $dbr->tableNames( 'watchlist' ) ); $sql = "SELECT COUNT(*) AS n FROM $watchlist WHERE wl_title='" . $dbr->strencode($this->mTitle->getDBKey()) . diff --git a/trackback.php b/trackback.php index 843e50809c..50a3341142 100644 --- a/trackback.php +++ b/trackback.php @@ -40,7 +40,7 @@ if ( !isset($_POST['url']) || !isset($_REQUEST['article'])) XMLerror("Required field not specified"); -$dbw =& wfGetDB(DB_MASTER); +$dbw = wfGetDB(DB_MASTER); $tbtitle = $_POST['title']; $tbex = $_POST['excerpt']; -- 2.20.1