Page Menu
Home
WickedGov Phorge
Search
Configure Global Search
Log In
Files
F4106403
Utils.php
No One
Temporary
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Flag For Later
Award Token
Size
799 B
Referenced Files
None
Subscribers
None
Utils.php
View Options
<?php
namespace
MediaWiki\Extension\Notifications\Push
;
use
MediaWiki\MediaWikiServices
;
use
MediaWiki\User\CentralId\CentralIdLookup
;
use
MediaWiki\User\UserIdentity
;
class
Utils
{
/**
* Attempt to get a unique ID for the specified user, accounting for installations both with
* and without CentralAuth: Return the user's central ID, if available. If there is no central
* user associated with the local user (i.e., centralIdFromLocalUser returns 0), fall back to
* returning the local user ID.
* @param UserIdentity $user
* @return int
*/
public
static
function
getPushUserId
(
UserIdentity
$user
):
int
{
return
MediaWikiServices
::
getInstance
()
->
getCentralIdLookup
()
->
centralIdFromLocalUser
(
$user
,
CentralIdLookup
::
AUDIENCE_RAW
)
?:
$user
->
getId
();
}
}
File Metadata
Details
Attached
Mime Type
text/x-php
Expires
Tue, Aug 18, 19:31 (2 w, 4 d ago)
Storage Engine
local-disk
Storage Format
Raw Data
Storage Handle
b7/f0/a9d1f1cb5782b35aa20d3bf1ceca
Default Alt Text
Utils.php (799 B)
Attached To
Mode
rMWPROD MediaWiki Production
Attached
Detach File
Event Timeline
Log In to Comment