Avoid use of __METHOD__ in closure.
authorAaron Schulz <aschulz@wikimedia.org>
Mon, 22 Apr 2013 19:08:28 +0000 (12:08 -0700)
committerAaron Schulz <aschulz@wikimedia.org>
Mon, 22 Apr 2013 19:08:28 +0000 (12:08 -0700)
Change-Id: Ib25063f41cc25647003442cbd5851c3b777b2a7a

includes/User.php

index e911cb0..cb5ad7a 100644 (file)
@@ -1974,7 +1974,8 @@ class User {
                        $dbw = wfGetDB( DB_MASTER );
                        $userid = $this->mId;
                        $touched = $this->mTouched;
-                       $dbw->onTransactionIdle( function() use ( $dbw, $userid, $touched ) {
+                       $method = __METHOD__;
+                       $dbw->onTransactionIdle( function() use ( $dbw, $userid, $touched, $method ) {
                                // Prevent contention slams by checking user_touched first
                                $encTouched = $dbw->addQuotes( $dbw->timestamp( $touched ) );
                                $needsPurge = $dbw->selectField( 'user', '1',
@@ -1983,7 +1984,7 @@ class User {
                                        $dbw->update( 'user',
                                                array( 'user_touched' => $dbw->timestamp( $touched ) ),
                                                array( 'user_id' => $userid, 'user_touched < ' . $encTouched ),
-                                               __METHOD__
+                                               $method
                                        );
                                }
                        } );