The war on redundant ampersand usage!
[lhc/web/wiklou.git] / includes / User.php
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 ) ),