The war on redundant ampersand usage!
authorNick Jenkins <nickj@users.mediawiki.org>
Mon, 22 Jan 2007 23:50:42 +0000 (23:50 +0000)
committerNick Jenkins <nickj@users.mediawiki.org>
Mon, 22 Jan 2007 23:50:42 +0000 (23:50 +0000)
* 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.

156 files changed:
includes/AjaxFunctions.php
includes/Article.php
includes/BagOStuff.php
includes/Block.php
includes/CacheDependency.php
includes/CategoryPage.php
includes/Categoryfinder.php
includes/ChangesList.php
includes/DatabaseFunctions.php
includes/EditPage.php
includes/HTMLCacheUpdate.php
includes/HistoryBlob.php
includes/Image.php
includes/ImageGallery.php
includes/ImagePage.php
includes/JobQueue.php
includes/LinkBatch.php
includes/LinkCache.php
includes/Linker.php
includes/LinksUpdate.php
includes/LogPage.php
includes/Math.php
includes/MessageCache.php
includes/OutputPage.php
includes/PageHistory.php
includes/Parser.php
includes/ParserOptions.php
includes/Profiler.php
includes/QueryPage.php
includes/RecentChange.php
includes/Revision.php
includes/SearchMySQL.php
includes/SearchMySQL4.php
includes/SearchPostgres.php
includes/SearchTsearch2.php
includes/SiteStats.php
includes/Skin.php
includes/SkinTemplate.php
includes/SpecialAllmessages.php
includes/SpecialAllpages.php
includes/SpecialAncientpages.php
includes/SpecialBrokenRedirects.php
includes/SpecialCategories.php
includes/SpecialContributions.php
includes/SpecialDeadendpages.php
includes/SpecialDisambiguations.php
includes/SpecialDoubleRedirects.php
includes/SpecialExport.php
includes/SpecialImagelist.php
includes/SpecialImport.php
includes/SpecialListredirects.php
includes/SpecialListusers.php
includes/SpecialLog.php
includes/SpecialLonelypages.php
includes/SpecialMIMEsearch.php
includes/SpecialMostcategories.php
includes/SpecialMostimages.php
includes/SpecialMostlinked.php
includes/SpecialMostlinkedcategories.php
includes/SpecialMostrevisions.php
includes/SpecialNewimages.php
includes/SpecialNewpages.php
includes/SpecialPopularpages.php
includes/SpecialPrefixindex.php
includes/SpecialRandompage.php
includes/SpecialRandomredirect.php
includes/SpecialRecentchanges.php
includes/SpecialRecentchangeslinked.php
includes/SpecialSearch.php
includes/SpecialShortpages.php
includes/SpecialStatistics.php
includes/SpecialUncategorizedimages.php
includes/SpecialUncategorizedpages.php
includes/SpecialUnusedcategories.php
includes/SpecialUnusedimages.php
includes/SpecialUnusedtemplates.php
includes/SpecialUnwatchedpages.php
includes/SpecialUpload.php
includes/SpecialUserlogin.php
includes/SpecialVersion.php
includes/SpecialWantedcategories.php
includes/SpecialWantedpages.php
includes/SpecialWatchlist.php
includes/SpecialWhatlinkshere.php
includes/SquidUpdate.php
includes/Title.php
includes/User.php
includes/UserMailer.php
includes/WatchedItem.php
includes/Wiki.php
includes/api/ApiPageSet.php
includes/api/ApiQuery.php
includes/api/ApiQueryAllpages.php
includes/api/ApiQueryBacklinks.php
includes/api/ApiQueryLogEvents.php
includes/api/ApiQueryRecentChanges.php
includes/api/ApiQueryRevisions.php
includes/api/ApiQueryUserContributions.php
install-utils.inc
maintenance/addwiki.php
maintenance/attachLatest.php
maintenance/attribute.php
maintenance/backup.inc
maintenance/changePassword.php
maintenance/checkUsernames.php
maintenance/cleanupDupes.inc
maintenance/cleanupSpam.php
maintenance/cleanupTitles.php
maintenance/cleanupWatchlist.php
maintenance/clear_interwiki_cache.php
maintenance/convertLinks.inc
maintenance/deleteBatch.php
maintenance/deleteDefaultMessages.php
maintenance/deleteImageMemcached.php
maintenance/deleteOldRevisions.inc
maintenance/deleteOrphanedRevisions.php
maintenance/deleteRevision.php
maintenance/dumpHTML.inc
maintenance/dumpHTML.php
maintenance/dumpLinks.php
maintenance/dumpReplayLog.php
maintenance/fixSlaveDesync.php
maintenance/fixTimestamps.php
maintenance/fixUserRegistration.php
maintenance/generateSitemap.php
maintenance/importLogs.inc
maintenance/moveBatch.php
maintenance/namespaceDupes.php
maintenance/nukeNS.php
maintenance/nukePage.inc
maintenance/orphans.php
maintenance/parserTests.inc
maintenance/purgeOldText.inc
maintenance/reassignEdits.inc.php
maintenance/rebuildInterwiki.inc
maintenance/rebuildrecentchanges.inc
maintenance/refreshImageCount.php
maintenance/refreshLinks.inc
maintenance/removeUnusedAccounts.inc
maintenance/removeUnusedAccounts.php
maintenance/runJobs.php
maintenance/showJobs.php
maintenance/showStats.php
maintenance/storage/checkStorage.php
maintenance/storage/compressOld.inc
maintenance/storage/dumpRev.php
maintenance/storage/moveToExternal.php
maintenance/storage/resolveStubs.php
maintenance/updateArticleCount.inc.php
maintenance/updateArticleCount.php
maintenance/updateSearchIndex.inc
maintenance/updateSpecialPages.php
maintenance/userDupes.php
skins/disabled/HTMLDump.php
skins/disabled/MonoBookCBT.php
trackback.php

index 600cd57..5f906a3 100644 (file)
@@ -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();
index 2d7504c..122558b 100644 (file)
@@ -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();
index a958d41..7b7aaab 100644 (file)
@@ -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)
index 5645ed3..29a8b9d 100644 (file)
@@ -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;
index 4bb3d32..5d849f5 100644 (file)
@@ -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' ),
index 65aa1f1..13610a9 100644 (file)
@@ -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 ) );
index 0aaf157..773c6b2 100644 (file)
@@ -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 () ;
                }
index 4d08add..8f0ec8e 100644 (file)
@@ -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 );
index 307e0d9..4b31b4f 100644 (file)
@@ -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 {
index e9b9713..84ee98b 100644 (file)
@@ -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(
index bda4720..cc392d9 100644 (file)
@@ -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 );
index b53176d..8d54e36 100644 (file)
@@ -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;
index f65c2aa..c2bf39f 100644 (file)
@@ -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 ),
index cfbc6ea..09cbd07 100644 (file)
@@ -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;
        }
index 5936541..2e6e94e 100644 (file)
@@ -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' );
 
index 746cf5d..a4a2e67 100644 (file)
@@ -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__ );
index 4f3eabc..065c540 100644 (file)
@@ -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 ) {
index 0f4e620..14072c5 100644 (file)
@@ -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();
                        }
 
index b7ee95a..8dcb44e 100644 (file)
@@ -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 ) {
index 8b000b5..bd6e241 100644 (file)
@@ -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( 
index 6841c1f..65dbbe4 100644 (file)
@@ -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();
index 79ca462..88934e5 100644 (file)
@@ -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
index 6a12ff7..319b9f6 100644 (file)
@@ -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
index 1244830..31c7236 100644 (file)
@@ -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.'"';
index 3d35e03..8608a08 100644 (file)
@@ -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',
index 587c637..8f04aa2 100644 (file)
@@ -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 = "<a href=\"{$url}\"{$la}>{$keyword} {$id}</a>";
                }
@@ -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__ );
 
index cf1b748..f165343 100644 (file)
@@ -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();
                }
index b9e3d14..8485edb 100644 (file)
@@ -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 );
index 1ebf108..6c35697 100644 (file)
@@ -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' );
index 292e3f7..fced434 100644 (file)
@@ -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 */
index dea15cb..3e7e77e 100644 (file)
@@ -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__ );
                }
index 8627b78..87878b6 100644 (file)
@@ -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 ),
index 9ba5860..dbd88ec 100644 (file)
@@ -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 */
index 87b90ab..293c593 100644 (file)
@@ -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 ".
index 36f97bb..b504f03 100644 (file)
@@ -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" );
        }
 
 }
index cb617de..46700cc 100644 (file)
@@ -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";
index ad4af79..ed8d3de 100644 (file)
@@ -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()) .
index c7a2bfe..337666a 100644 (file)
@@ -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()) .
index bfba3e3..9f68d14 100644 (file)
@@ -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 );
index 679de63..40acd0a 100644 (file)
@@ -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',
index 5499857..8894f5b 100644 (file)
@@ -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
index 2f0a14b..95a705e 100644 (file)
@@ -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,
index 402a727..6e09cc8 100644 (file)
@@ -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,
index 70ff0c7..bc44888 100644 (file)
@@ -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 ) {
index c164e2f..0f8cbe5 100644 (file)
@@ -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 " .
index 125e696..da0562a 100644 (file)
@@ -20,7 +20,7 @@ class DisambiguationsPage extends PageQueryPage {
        }
 
        function getSQL() {
-               $dbr =& wfGetDB( DB_SLAVE );
+               $dbr = wfGetDB( DB_SLAVE );
 
                $dMsgText = wfMsgForContent('disambiguationspage');
 
index 5acc262..4db785f 100644 (file)
@@ -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 ) {
index 201fbef..27e81b4 100644 (file)
@@ -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();
index 2cc1769..84cbfce 100644 (file)
@@ -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 );
index 2c1e195..d36757f 100644 (file)
@@ -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' ) );
        }
 
index dbdfaab..bc39692 100644 (file)
@@ -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 );
index 59a8a6d..c0292c0 100644 (file)
@@ -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 ),
index 66f11c0..d84b194 100644 (file)
@@ -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;
        }
 
index 1de11bb..810bd1e 100644 (file)
@@ -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
index 333d7ea..1e69b23 100644 (file)
@@ -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 );
index 8f1a729..e761942 100644 (file)
@@ -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
                        "
index e65e9e8..6a6d8c5 100644 (file)
@@ -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
                        "
index ff95d2d..2ba9015 100644 (file)
@@ -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,
index c2e465d..536a48a 100644 (file)
@@ -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
index 1b2a5a8..5915705 100644 (file)
@@ -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
                        "
index b7d8776..b41ff56 100644 (file)
@@ -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);
index f817fd7..928ae15 100644 (file)
@@ -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 );
index fc84826..a4e509b 100644 (file)
@@ -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
index 9ec9d63..73a67ee 100644 (file)
@@ -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' ),
index 244dac6..0dd0f51 100644 (file)
@@ -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' );
 
index 0562fdb..40df984 100644 (file)
@@ -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' );
 
index 4e0042a..d0cec16 100644 (file)
@@ -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' );
 
 
index c6bef2e..a194747 100644 (file)
@@ -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);
index 3790dac..b58f91d 100644 (file)
@@ -312,7 +312,7 @@ class SpecialSearch {
                        wfProfileOut( $fname );
                        return "<!-- Broken link in search result -->\n";
                }
-               $sk =& $wgUser->getSkin();
+               $sk = $wgUser->getSkin();
 
                $contextlines = $wgUser->getOption( 'contextlines',  5 );
                $contextchars = $wgUser->getOption( 'contextchars', 50 );
index be11df7..72b093e 100644 (file)
@@ -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() );
 
index 569cab9..359e7f0 100644 (file)
@@ -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( '<h2>' . wfMsgHtml( 'statistics-mostpopular' ) . '</h2>' );
-                               $skin =& $wgUser->getSkin();
+                               $skin = $wgUser->getSkin();
                                $wgOut->addHtml( '<ol>' );
                                while( $row = $dbr->fetchObject( $res ) ) {
                                        $link = $skin->makeKnownLinkObj( Title::makeTitleSafe( $row->page_namespace, $row->page_title ) );
index de1460c..f91b25c 100644 (file)
@@ -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;
 
index a71c25c..cae34fe 100644 (file)
@@ -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() );
 
index 980f98e..5cd3406 100644 (file)
@@ -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
index 2052447..35e9ca9 100644 (file)
@@ -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' );
index 4414fa0..e31c10f 100644 (file)
@@ -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
index c5eb9c3..6d067f3 100644 (file)
@@ -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
index a27d7b7..a07d76f 100644 (file)
@@ -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 .= '<li>' . wfMsgHtml( 'large-file', $wsize, $asize ) . '</li>';
index e3a26b6..f14eede 100644 (file)
@@ -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 ) );
        }
 }
index aacd856..5bc1318 100644 (file)
@@ -49,7 +49,7 @@ class SpecialVersion {
         */
        function MediaWikiCredits() {
                $version = self::getVersion();
-               $dbr =& wfGetDB( DB_SLAVE );
+               $dbr = wfGetDB( DB_SLAVE );
 
                $ret =
                "__NOTOC__
index 03641bf..eab44d6 100644 (file)
@@ -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
index 7053dbf..06e959e 100644 (file)
@@ -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
index be28bc0..92ee4d6 100644 (file)
@@ -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( "</p>\n<p>" . wfMsg( 'wldone' ) . "</p>\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();
index b23a8dc..c131c00 100644 (file)
@@ -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 );
index ac8f2ba..700fc8e 100644 (file)
@@ -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(
index cd6c7e2..cbba219 100644 (file)
@@ -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(),
index 6475a2f..4a21d66 100644 (file)
@@ -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 ) ),
index 55f6799..fe08ae2 100644 (file)
@@ -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)
index 06451bc..b0376e3 100644 (file)
@@ -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'
index a0624e9..cb5cce5 100644 (file)
@@ -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();
 
index c1009ea..1b55567 100644 (file)
@@ -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();
index d58cc5c..72859d8 100644 (file)
@@ -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;
index 9b5b0a7..df137d3 100644 (file)
@@ -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');
index c875df3..a799c7d 100644 (file)
@@ -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) {
index f6d55bf..73e0c84 100644 (file)
@@ -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');
 
index a25a4e0..b1cf410 100644 (file)
@@ -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) {
index 4b77546..d2c0436 100644 (file)
@@ -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) {
index e0bb692..d518e88 100644 (file)
@@ -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');
index 3ff06ec..7d599f5 100644 (file)
@@ -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;
 
index 5a556bb..7bb3123 100644 (file)
@@ -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";
 
index d9d0d5d..b24143c 100644 (file)
@@ -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 ),
index bfdddd7..4f575cb 100644 (file)
@@ -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 );
index a611569..2c3ce6b 100644 (file)
@@ -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();
        }
index 9c1cb48..8291341 100644 (file)
@@ -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() {
index 60e5218..cfff346 100644 (file)
@@ -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' ),
index cdabdff..ce1ffc6 100644 (file)
@@ -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";
index 2ad0a9c..0972d03 100644 (file)
@@ -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 ) {
index 96be570..0fb97c6 100644 (file)
@@ -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,
index 1e97f9b..161a984 100644 (file)
@@ -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,
index 8a83d4d..6f4cfe1 100644 (file)
@@ -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 ) ) {
index 92c5955..d0c57f7 100644 (file)
@@ -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" );
index 14da6d8..3021b11 100644 (file)
@@ -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 ) );
index 7692400..a649da4 100644 (file)
@@ -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' ) ) {
index 6af0e3a..267c2a6 100644 (file)
@@ -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 );
        }
 }
index d6bb714..8d8ca9a 100644 (file)
@@ -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' );
index a10d29c..302099e 100644 (file)
@@ -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' ) );
 
index eb65e23..af97260 100644 (file)
@@ -1,7 +1,7 @@
 <?php
 require_once( 'commandLine.inc' );
 
-$dbw =& wfGetDB( DB_MASTER );
+$dbw = wfGetDB( DB_MASTER );
 
 if ( count( $args ) == 0 ) {
        echo "Usage: php deleteRevision.php <revid> [<revid> ...]\n";
index f46a335..ca2a7df 100644 (file)
@@ -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;
index 726a649..b9b052e 100644 (file)
@@ -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";
 
index 71ae43f..cb883e4 100644 (file)
@@ -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',
index 8902e7e..07749f4 100644 (file)
@@ -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 = "  <edit>\n";
                $out .= "    <title>" . xmlsafe( $title->getPrefixedText() ) . "</title>\n";
@@ -64,7 +64,7 @@ function dumpReplayEntry( $row ) {
                $out .= "  </edit>\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' ),
index e62126a..aec77b1 100644 (file)
@@ -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 );
                        }
                }
index 784e35c..abd861d 100644 (file)
@@ -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 );
index af8a68c..471ef05 100644 (file)
@@ -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 );
index 05427bd..1649291 100644 (file)
@@ -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' );
index cf584da..0dc87ea 100644 (file)
@@ -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();
        }
 
index 28a4495..058652d 100644 (file)
@@ -55,7 +55,7 @@ if ( !$file ) {
        exit;
 }
 
-$dbw =& wfGetDB( DB_MASTER );
+$dbw = wfGetDB( DB_MASTER );
 
 for ( $linenum = 1; !feof( $file ); $linenum++ ) {
        $line = fgets( $file );
index acd3a70..c5c1ec5 100644 (file)
@@ -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 ) {
index a1ae3f0..8e280b2 100644 (file)
@@ -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' );
index b2ce6b8..7b17261 100644 (file)
@@ -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' );
index 406de8f..0729a23 100644 (file)
@@ -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' );
index d4f09eb..6bcb490 100644 (file)
@@ -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";
                                        }
index b6942e7..8938cc0 100644 (file)
@@ -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' );
index ddabbb6..375d2d9 100644 (file)
@@ -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';
                
index 447c746..d85612b 100644 (file)
@@ -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;
 }
index 8608ac4..d34c6e3 100644 (file)
@@ -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" );
index 88ac3c5..91145ba 100644 (file)
@@ -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' );
index 847a35f..7a560e9 100644 (file)
@@ -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',
index fb24387..2079123 100644 (file)
@@ -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' );
index 3cf46ee..42c5f05 100644 (file)
@@ -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
index 530a406..7f7ed9a 100644 (file)
@@ -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()) ) {
index 98e47de..14aff3d 100644 (file)
@@ -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";
 
index 27f9be6..abab26c 100644 (file)
@@ -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', '*', '' );
 
index 0c0ab04..46b938e 100644 (file)
@@ -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 ),
index 96ffc89..bd1bace 100644 (file)
@@ -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 != '' ) {
index 4d0ccb5..a082edc 100644 (file)
@@ -1,7 +1,7 @@
 <?php
 
 require_once( 'commandLine.inc' );
-$dbr =& wfGetDB( DB_SLAVE );
+$dbr = wfGetDB( DB_SLAVE );
 $row = $dbr->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
index 2b58615..40ac84d 100644 (file)
@@ -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;
index 8eb4df2..973b7b0 100644 (file)
@@ -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";
index 126593c..d4e2a9e 100644 (file)
@@ -15,7 +15,7 @@ class ArticleCounter {
        function ArticleCounter() {
                global $wgContentNamespaces;
                $this->namespaces = $wgContentNamespaces;
-               $this->dbr =& wfGetDB( DB_SLAVE );
+               $this->dbr = wfGetDB( DB_SLAVE );
        }
        
        /**
index 92ae0ee..03c7939 100644 (file)
@@ -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 {
index 060c8d0..bf2b8c3 100644 (file)
@@ -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" );
index fae0722..c7f9749 100644 (file)
@@ -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);
index 2469c6e..90de160 100644 (file)
@@ -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 );
 
index dd2c153..4e1ca4e 100644 (file)
@@ -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 ) {
index 73562eb..aa9abb0 100644 (file)
@@ -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()) .
index 843e508..50a3341 100644 (file)
@@ -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'];