jenkins-bot has submitted this change and it was merged. (
https://gerrit.wikimedia.org/r/403864 )
Change subject: wfMemcKey (deprecated in MW 1.30) -> makeKey() on a BagOStuff
instance
......................................................................
wfMemcKey (deprecated in MW 1.30) -> makeKey() on a BagOStuff instance
Change-Id: Icad1be17fc1426d0defbe8e65d2d127e3d7dc737
---
M SystemGifts/SystemGiftsClass.php
M SystemGifts/UserSystemGiftsClass.php
M UserActivity/SiteActivityHook.php
M UserBoard/UserBoardClass.php
M UserGifts/SpecialGiveGift.php
M UserGifts/SpecialRemoveGift.php
M UserGifts/UserGiftsClass.php
M UserProfile/AvatarClass.php
M UserProfile/SpecialRemoveAvatar.php
M UserProfile/SpecialToggleUserPageType.php
M UserProfile/SpecialUpdateProfile.php
M UserProfile/UploadAvatar.php
M UserProfile/UserProfilePage.php
M UserRelationship/UserRelationshipClass.php
14 files changed, 48 insertions(+), 48 deletions(-)
Approvals:
SamanthaNguyen: Looks good to me, approved
jenkins-bot: Verified
diff --git a/SystemGifts/SystemGiftsClass.php b/SystemGifts/SystemGiftsClass.php
index 646c7eb..141ee07 100644
--- a/SystemGifts/SystemGiftsClass.php
+++ b/SystemGifts/SystemGiftsClass.php
@@ -82,7 +82,7 @@
__METHOD__
);
- $sg_key = wfMemcKey( 'user',
'profile', 'system_gifts', "{$row2->stats_user_id}" );
+ $sg_key = $wgMemc->makeKey(
'user', 'profile', 'system_gifts', "{$row2->stats_user_id}" );
$wgMemc->delete( $sg_key );
// Update counters
(https://phabricator.wikimedia.org/T29981)
diff --git a/SystemGifts/UserSystemGiftsClass.php
b/SystemGifts/UserSystemGiftsClass.php
index 9b0f269..1824918 100644
--- a/SystemGifts/UserSystemGiftsClass.php
+++ b/SystemGifts/UserSystemGiftsClass.php
@@ -70,7 +70,7 @@
) );
}
- $wgMemc->delete( wfMemcKey( 'user', 'profile', 'system_gifts',
$this->user_id ) );
+ $wgMemc->delete( $wgMemc->makeKey( 'user', 'profile',
'system_gifts', $this->user_id ) );
return $sg_gift_id;
}
@@ -251,7 +251,7 @@
*/
public function incNewSystemGiftCount( $user_id ) {
global $wgMemc;
- $key = wfMemcKey( 'system_gifts', 'new_count', $user_id );
+ $key = $wgMemc->makeKey( 'system_gifts', 'new_count', $user_id
);
$wgMemc->incr( $key );
}
@@ -263,7 +263,7 @@
*/
public function decNewSystemGiftCount( $user_id ) {
global $wgMemc;
- $key = wfMemcKey( 'system_gifts', 'new_count', $user_id );
+ $key = $wgMemc->makeKey( 'system_gifts', 'new_count', $user_id
);
$wgMemc->decr( $key );
}
@@ -273,7 +273,7 @@
*/
public function clearNewSystemGiftCountCache() {
global $wgMemc;
- $key = wfMemcKey( 'system_gifts', 'new_count', $user_id );
+ $key = $wgMemc->makeKey( 'system_gifts', 'new_count', $user_id
);
$wgMemc->set( $key, 0 );
}
@@ -287,7 +287,7 @@
*/
static function getNewSystemGiftCountCache( $user_id ) {
global $wgMemc;
- $key = wfMemcKey( 'system_gifts', 'new_count', $user_id );
+ $key = $wgMemc->makeKey( 'system_gifts', 'new_count', $user_id
);
$data = $wgMemc->get( $key );
if ( $data != '' ) {
wfDebug( "Got new award count of $data for id $user_id
from cache\n" );
@@ -329,7 +329,7 @@
wfDebug( "Got new award count for id $user_id from DB\n" );
global $wgMemc;
- $key = wfMemcKey( 'system_gifts', 'new_count', $user_id );
+ $key = $wgMemc->makeKey( 'system_gifts', 'new_count', $user_id
);
$dbr = wfGetDB( DB_REPLICA );
$new_gift_count = 0;
$s = $dbr->selectRow(
diff --git a/UserActivity/SiteActivityHook.php
b/UserActivity/SiteActivityHook.php
index 049e6f2..65f7942 100644
--- a/UserActivity/SiteActivityHook.php
+++ b/UserActivity/SiteActivityHook.php
@@ -23,7 +23,7 @@
// so that <siteactivity limit=5 /> will return 5 items instead
of 4...
$fixedLimit = $limit + 1;
- $key = wfMemcKey( 'site_activity', 'all', $fixedLimit );
+ $key = $wgMemc->makeKey( 'site_activity', 'all', $fixedLimit );
$data = $wgMemc->get( $key );
if ( !$data ) {
wfDebug( "Got site activity from DB\n" );
diff --git a/UserBoard/UserBoardClass.php b/UserBoard/UserBoardClass.php
index a1dadc2..2b59a45 100644
--- a/UserBoard/UserBoardClass.php
+++ b/UserBoard/UserBoardClass.php
@@ -119,7 +119,7 @@
*/
public function incNewMessageCount( $user_id ) {
global $wgMemc;
- $key = wfMemcKey( 'user', 'newboardmessage', $user_id );
+ $key = $wgMemc->makeKey( 'user', 'newboardmessage', $user_id );
$wgMemc->incr( $key );
}
@@ -132,7 +132,7 @@
*/
static function clearNewMessageCount( $user_id ) {
global $wgMemc;
- $key = wfMemcKey( 'user', 'newboardmessage', $user_id );
+ $key = $wgMemc->makeKey( 'user', 'newboardmessage', $user_id );
$wgMemc->set( $key, 0 );
}
@@ -146,7 +146,7 @@
*/
static function getNewMessageCountCache( $user_id ) {
global $wgMemc;
- $key = wfMemcKey( 'user', 'newboardmessage', $user_id );
+ $key = $wgMemc->makeKey( 'user', 'newboardmessage', $user_id );
$data = $wgMemc->get( $key );
if ( $data != '' ) {
wfDebug( "Got new message count of $data for id
$user_id from cache\n" );
@@ -167,7 +167,7 @@
wfDebug( "Got new message count for id $user_id from DB\n" );
- $key = wfMemcKey( 'user', 'newboardmessage', $user_id );
+ $key = $wgMemc->makeKey( 'user', 'newboardmessage', $user_id );
$newCount = 0;
/*
$dbw = wfGetDB( DB_MASTER );
diff --git a/UserGifts/SpecialGiveGift.php b/UserGifts/SpecialGiveGift.php
index e7677bc..4d72b53 100644
--- a/UserGifts/SpecialGiveGift.php
+++ b/UserGifts/SpecialGiveGift.php
@@ -97,9 +97,9 @@
);
// clear the cache for the user profile gifts
for this user
- $wgMemc->delete( wfMemcKey( 'user', 'profile',
'gifts', $this->user_id_to ) );
+ $wgMemc->delete( $wgMemc->makeKey( 'user',
'profile', 'gifts', $this->user_id_to ) );
- $key = wfMemcKey( 'gifts', 'unique', 4 );
+ $key = $wgMemc->makeKey( 'gifts', 'unique', 4 );
$data = $wgMemc->get( $key );
// check to see if this type of gift is in the
unique list
diff --git a/UserGifts/SpecialRemoveGift.php b/UserGifts/SpecialRemoveGift.php
index 417515c..b472cc6 100644
--- a/UserGifts/SpecialRemoveGift.php
+++ b/UserGifts/SpecialRemoveGift.php
@@ -59,8 +59,8 @@
$user_page_link = Title::makeTitle( NS_USER,
$user->getName() );
- if ( $rel->doesUserOwnGift( $user->getID(),
$this->gift_id ) == true ) {
- $wgMemc->delete( wfMemcKey( 'user', 'profile',
'gifts', $user->getID() ) );
+ if ( $rel->doesUserOwnGift( $user->getId(),
$this->gift_id ) == true ) {
+ $wgMemc->delete( $wgMemc->makeKey( 'user',
'profile', 'gifts', $user->getID() ) );
$rel->deleteGift( $this->gift_id );
}
diff --git a/UserGifts/UserGiftsClass.php b/UserGifts/UserGiftsClass.php
index 080340c..45b928e 100644
--- a/UserGifts/UserGiftsClass.php
+++ b/UserGifts/UserGiftsClass.php
@@ -230,7 +230,7 @@
*/
public function incNewGiftCount( $user_id ) {
global $wgMemc;
- $key = wfMemcKey( 'user_gifts', 'new_count', $user_id );
+ $key = $wgMemc->makeKey( 'user_gifts', 'new_count', $user_id );
$wgMemc->incr( $key );
}
@@ -242,7 +242,7 @@
*/
public function decNewGiftCount( $user_id ) {
global $wgMemc;
- $key = wfMemcKey( 'user_gifts', 'new_count', $user_id );
+ $key = $wgMemc->makeKey( 'user_gifts', 'new_count', $user_id );
$wgMemc->decr( $key );
}
@@ -252,7 +252,7 @@
*/
public function clearNewGiftCountCache() {
global $wgMemc;
- $key = wfMemcKey( 'user_gifts', 'new_count', $this->user_id );
+ $key = $wgMemc->makeKey( 'user_gifts', 'new_count',
$this->user_id );
$wgMemc->set( $key, 0 );
}
@@ -266,7 +266,7 @@
*/
static function getNewGiftCountCache( $user_id ) {
global $wgMemc;
- $key = wfMemcKey( 'user_gifts', 'new_count', $user_id );
+ $key = $wgMemc->makeKey( 'user_gifts', 'new_count', $user_id );
$data = $wgMemc->get( $key );
if ( $data != '' ) {
wfDebug( "Got new gift count of $data for id $user_id
from cache\n" );
@@ -307,7 +307,7 @@
wfDebug( "Got new gift count for id $user_id from DB\n" );
global $wgMemc;
- $key = wfMemcKey( 'user_gifts', 'new_count', $user_id );
+ $key = $wgMemc->makeKey( 'user_gifts', 'new_count', $user_id );
$dbr = wfGetDB( DB_REPLICA );
$newGiftCount = 0;
$s = $dbr->selectRow(
diff --git a/UserProfile/AvatarClass.php b/UserProfile/AvatarClass.php
index ab2ee31..7deaf1e 100644
--- a/UserProfile/AvatarClass.php
+++ b/UserProfile/AvatarClass.php
@@ -36,7 +36,7 @@
function getAvatarImage() {
global $wgAvatarKey, $wgUploadDirectory, $wgMemc;
- $key = wfMemcKey( 'user', 'profile', 'avatar', $this->user_id,
$this->avatar_size );
+ $key = $wgMemc->makeKey( 'user', 'profile', 'avatar',
$this->user_id, $this->avatar_size );
$data = $wgMemc->get( $key );
// Load from memcached if possible
diff --git a/UserProfile/SpecialRemoveAvatar.php
b/UserProfile/SpecialRemoveAvatar.php
index 36a8f07..b15f8bb 100644
--- a/UserProfile/SpecialRemoveAvatar.php
+++ b/UserProfile/SpecialRemoveAvatar.php
@@ -244,7 +244,7 @@
}
// clear cache
- $key = wfMemcKey( 'user', 'profile', 'avatar', $id, $size );
+ $key = $wgMemc->makeKey( 'user', 'profile', 'avatar', $id,
$size );
$wgMemc->delete( $key );
}
}
diff --git a/UserProfile/SpecialToggleUserPageType.php
b/UserProfile/SpecialToggleUserPageType.php
index d6f9aa5..3a45bdc 100644
--- a/UserProfile/SpecialToggleUserPageType.php
+++ b/UserProfile/SpecialToggleUserPageType.php
@@ -69,7 +69,7 @@
), __METHOD__
);
- $key = wfMemcKey( 'user', 'profile', 'info', $user->getID() );
+ $key = $wgMemc->makeKey( 'user', 'profile', 'info',
$user->getID() );
$wgMemc->delete( $key );
if ( $user_page_type == 1 && !$user->isBlocked() ) {
diff --git a/UserProfile/SpecialUpdateProfile.php
b/UserProfile/SpecialUpdateProfile.php
index 45d8620..1d64694 100644
--- a/UserProfile/SpecialUpdateProfile.php
+++ b/UserProfile/SpecialUpdateProfile.php
@@ -376,7 +376,7 @@
Hooks::run( 'BasicProfileChanged', array( $user,
$basicProfileData ) );
// end of the hook
- $wgMemc->delete( wfMemcKey( 'user', 'profile', 'info',
$user->getID() ) );
+ $wgMemc->delete( $wgMemc->makeKey( 'user', 'profile', 'info',
$user->getID() ) );
}
/**
@@ -408,7 +408,7 @@
__METHOD__
);
- $wgMemc->delete( wfMemcKey( 'user', 'profile', 'info',
$user->getID() ) );
+ $wgMemc->delete( $wgMemc->makeKey( 'user', 'profile', 'info',
$user->getID() ) );
}
/**
@@ -452,7 +452,7 @@
Hooks::run( 'PersonalInterestsChanged', array( $user,
$interestsData ) );
// end of the hook
- $wgMemc->delete( wfMemcKey( 'user', 'profile', 'info',
$user->getID() ) );
+ $wgMemc->delete( $wgMemc->makeKey( 'user', 'profile', 'info',
$user->getID() ) );
}
/**
diff --git a/UserProfile/UploadAvatar.php b/UserProfile/UploadAvatar.php
index dff2e95..fdb498e 100644
--- a/UserProfile/UploadAvatar.php
+++ b/UserProfile/UploadAvatar.php
@@ -187,16 +187,16 @@
}
}
- $key = wfMemcKey( 'user', 'profile', 'avatar', $uid, 's' );
+ $key = $wgMemc->makeKey( 'user', 'profile', 'avatar', $uid, 's'
);
$data = $wgMemc->delete( $key );
- $key = wfMemcKey( 'user', 'profile', 'avatar', $uid, 'm' );
+ $key = $wgMemc->makeKey( 'user', 'profile', 'avatar', $uid, 'm'
);
$data = $wgMemc->delete( $key );
- $key = wfMemcKey( 'user', 'profile', 'avatar', $uid , 'l' );
+ $key = $wgMemc->makeKey( 'user', 'profile', 'avatar', $uid ,
'l' );
$data = $wgMemc->delete( $key );
- $key = wfMemcKey( 'user', 'profile', 'avatar', $uid, 'ml' );
+ $key = $wgMemc->makeKey( 'user', 'profile', 'avatar', $uid,
'ml' );
$data = $wgMemc->delete( $key );
$this->mExtension = $ext;
diff --git a/UserProfile/UserProfilePage.php b/UserProfile/UserProfilePage.php
index ef03e13..e4de315 100644
--- a/UserProfile/UserProfilePage.php
+++ b/UserProfile/UserProfilePage.php
@@ -259,7 +259,7 @@
$polls = array();
// Try cache
- $key = wfMemcKey( 'user', 'profile', 'polls', $this->user_id );
+ $key = $wgMemc->makeKey( 'user', 'profile', 'polls',
$this->user_id );
$data = $wgMemc->get( $key );
if( $data ) {
@@ -299,7 +299,7 @@
$quiz = array();
// Try cache
- $key = wfMemcKey( 'user', 'profile', 'quiz', $this->user_id );
+ $key = $wgMemc->makeKey( 'user', 'profile', 'quiz',
$this->user_id );
$data = $wgMemc->get( $key );
if( $data ) {
@@ -346,7 +346,7 @@
$pics = array();
// Try cache
- $key = wfMemcKey( 'user', 'profile', 'picgame', $this->user_id
);
+ $key = $wgMemc->makeKey( 'user', 'profile', 'picgame',
$this->user_id );
$data = $wgMemc->get( $key );
if( $data ) {
wfDebug( "Got profile picgames for user
{$this->user_id} from cache\n" );
@@ -1162,7 +1162,7 @@
$count = 4;
$rel = new UserRelationship( $user_name );
- $key = wfMemcKey( 'relationship', 'profile',
"{$rel->user_id}-{$rel_type}" );
+ $key = $wgMemc->makeKey( 'relationship', 'profile',
"{$rel->user_id}-{$rel_type}" );
$data = $wgMemc->get( $key );
// Try cache
@@ -1441,7 +1441,7 @@
$user_safe = urlencode( $user_name );
// Try cache
- $key = wfMemcKey( 'user', 'profile', 'gifts', "{$g->user_id}" );
+ $key = $wgMemc->makeKey( 'user', 'profile', 'gifts',
"{$g->user_id}" );
$data = $wgMemc->get( $key );
if ( !$data ) {
@@ -1532,7 +1532,7 @@
$sg = new UserSystemGifts( $user_name );
// Try cache
- $sg_key = wfMemcKey( 'user', 'profile', 'system_gifts',
"{$sg->user_id}" );
+ $sg_key = $wgMemc->makeKey( 'user', 'profile', 'system_gifts',
"{$sg->user_id}" );
$data = $wgMemc->get( $sg_key );
if ( !$data ) {
wfDebug( "Got profile awards for user {$user_name} from
DB\n" );
@@ -1745,7 +1745,7 @@
// Try cache
/*
- $key = wfMemcKey( 'user', 'profile', 'fanboxes',
"{$f->user_id}" );
+ $key = $wgMemc->makeKey( 'user', 'profile', 'fanboxes',
"{$f->user_id}" );
$data = $wgMemc->get( $key );
if ( !$data ) {
diff --git a/UserRelationship/UserRelationshipClass.php
b/UserRelationship/UserRelationshipClass.php
index 449dd1c..66fb376 100644
--- a/UserRelationship/UserRelationshipClass.php
+++ b/UserRelationship/UserRelationshipClass.php
@@ -314,8 +314,8 @@
}
// Purge caches
- $wgMemc->delete( wfMemcKey( 'relationship', 'profile',
"{$this->user_id}-{$ur_type}" ) );
- $wgMemc->delete( wfMemcKey( 'relationship', 'profile',
"{$ur_user_id_from}-{$ur_type}" ) );
+ $wgMemc->delete( $wgMemc->makeKey( 'relationship',
'profile', "{$this->user_id}-{$ur_type}" ) );
+ $wgMemc->delete( $wgMemc->makeKey( 'relationship',
'profile', "{$ur_user_id_from}-{$ur_type}" ) );
if ( ExtensionRegistry::getInstance()->isLoaded( 'Echo'
) ) {
$userFrom = User::newFromId( $this->user_id );
@@ -371,11 +371,11 @@
__METHOD__
);
- $wgMemc->delete( wfMemcKey( 'relationship', 'profile',
"{$user1}-1" ) );
- $wgMemc->delete( wfMemcKey( 'relationship', 'profile',
"{$user2}-1" ) );
+ $wgMemc->delete( $wgMemc->makeKey( 'relationship', 'profile',
"{$user1}-1" ) );
+ $wgMemc->delete( $wgMemc->makeKey( 'relationship', 'profile',
"{$user2}-1" ) );
- $wgMemc->delete( wfMemcKey( 'relationship', 'profile',
"{$user1}-2" ) );
- $wgMemc->delete( wfMemcKey( 'relationship', 'profile',
"{$user2}-2" ) );
+ $wgMemc->delete( $wgMemc->makeKey( 'relationship', 'profile',
"{$user1}-2" ) );
+ $wgMemc->delete( $wgMemc->makeKey( 'relationship', 'profile',
"{$user2}-2" ) );
// RelationshipRemovedByUserID hook
Hooks::run( 'RelationshipRemovedByUserID', array( $user1,
$user2 ) );
@@ -588,7 +588,7 @@
*/
private function incNewRequestCount( $userId, $relType ) {
global $wgMemc;
- $key = wfMemcKey( 'user_relationship', 'open_request',
$relType, $userId );
+ $key = $wgMemc->makeKey( 'user_relationship', 'open_request',
$relType, $userId );
$wgMemc->incr( $key );
}
@@ -600,7 +600,7 @@
*/
private function decNewRequestCount( $userId, $relType ) {
global $wgMemc;
- $key = wfMemcKey( 'user_relationship', 'open_request',
$relType, $userId );
+ $key = $wgMemc->makeKey( 'user_relationship', 'open_request',
$relType, $userId );
$wgMemc->decr( $key );
}
@@ -617,7 +617,7 @@
wfDebug( "Got open request count (type={$relType}) for id
$userId from DB\n" );
- $key = wfMemcKey( 'user_relationship', 'open_request',
$relType, $userId );
+ $key = $wgMemc->makeKey( 'user_relationship', 'open_request',
$relType, $userId );
$dbr = wfGetDB( DB_REPLICA );
$requestCount = 0;
@@ -650,7 +650,7 @@
*/
static function getOpenRequestCountCache( $userId, $relType ) {
global $wgMemc;
- $key = wfMemcKey( 'user_relationship', 'open_request',
$relType, $userId );
+ $key = $wgMemc->makeKey( 'user_relationship', 'open_request',
$relType, $userId );
$data = $wgMemc->get( $key );
if ( $data != '' ) {
wfDebug( "Got open request count of $data
(type={$relType}) for id $userId from cache\n" );
--
To view, visit https://gerrit.wikimedia.org/r/403864
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: merged
Gerrit-Change-Id: Icad1be17fc1426d0defbe8e65d2d127e3d7dc737
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/SocialProfile
Gerrit-Branch: master
Gerrit-Owner: Jack Phoenix <[email protected]>
Gerrit-Reviewer: Lewis Cawte <[email protected]>
Gerrit-Reviewer: SamanthaNguyen <[email protected]>
Gerrit-Reviewer: jenkins-bot <>
_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits