Page MenuHomeWickedGov Phorge

Utils.php
No OneTemporary

Size
799 B
Referenced Files
None
Subscribers
None

Utils.php

<?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

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)

Event Timeline