r92681 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r92680‎ | r92681 | r92682 >
Date:20:45, 20 July 2011
Author:werdna
Status:ok
Tags:
Comment:
Move global declarations to the top of the functions
Modified paths:
  • /trunk/extensions/EditPageTracking/EditPageTracking.php (modified) (history)

Diff [purge]

Index: trunk/extensions/EditPageTracking/EditPageTracking.php
@@ -39,15 +39,13 @@
4040 * Monitors edit page usage
4141 */
4242 public static function onEditForm( EditPage $editPage ) {
43 - global $wgUser;
 43+ global $wgUser, $wgEditPageTrackingRegistrationCutoff;
4444
4545 // Anonymous users
4646 if ( $wgUser->isAnon() ) {
4747 return true;
4848 }
4949
50 - global $wgEditPageTrackingRegistrationCutoff;
51 -
5250 if ( $wgEditPageTrackingRegistrationCutoff &&
5351 $wgUser->getRegistration() < $wgEditPageTrackingRegistrationCutoff )
5452 {
@@ -87,6 +85,8 @@
8886 * false for an anonymous user, null for a user who has never opened an edit page.
8987 */
9088 public static function getFirstEditPage( $user ) {
 89+ global $wgMemc;
 90+
9191 if ( isset($user->mFirstEditPage) ) {
9292 return $user->mFirstEditPage;
9393 }
@@ -95,7 +95,6 @@
9696 return false;
9797 }
9898
99 - global $wgMemc;
10099 $cacheKey = wfMemcKey( 'first-edit-page', $user->getId() );
101100 $cacheVal = $wgMemc->get($cacheKey);
102101

Status & tagging log