Page Menu
Home
WickedGov Phorge
Search
Configure Global Search
Log In
Files
F6126916
IPInfoHandler.php
No One
Temporary
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Flag For Later
Award Token
Size
1 KB
Referenced Files
None
Subscribers
None
IPInfoHandler.php
View Options
<?php
namespace
MediaWiki\CheckUser\HookHandler
;
use
LogicException
;
use
MediaWiki\CheckUser\GlobalContributions\CheckUserGlobalContributionsLookup
;
use
MediaWiki\IPInfo\Hook\IPInfoIPInfoHandlerHook
;
use
MediaWiki\Permissions\Authority
;
class
IPInfoHandler
implements
IPInfoIPInfoHandlerHook
{
private
CheckUserGlobalContributionsLookup
$globalContributionsLookup
;
public
function
__construct
(
CheckUserGlobalContributionsLookup
$globalContributionsLookup
)
{
$this
->
globalContributionsLookup
=
$globalContributionsLookup
;
}
/**
* @inheritDoc
*/
public
function
onIPInfoHandlerRun
(
string
$target
,
Authority
$performer
,
string
$dataContext
,
array
&
$dataContainer
):
void
{
if
(
$dataContext
!==
'infobox'
)
{
return
;
}
try
{
$globalContributionsCount
=
$this
->
globalContributionsLookup
->
getGlobalContributionsCount
(
$target
,
$performer
);
$dataContainer
[
'ipinfo-source-checkuser'
]
=
[
'globalContributionsCount'
=>
$globalContributionsCount
,
];
}
catch
(
LogicException
)
{
// Do nothing if the count could not be found and passed through
return
;
}
}
}
File Metadata
Details
Attached
Mime Type
text/x-php
Expires
Oct 7 2026, 09:45 (6 w, 3 d ago)
Storage Engine
local-disk
Storage Format
Raw Data
Storage Handle
90/44/5d473318adc2abdf863057138341
Default Alt Text
IPInfoHandler.php (1 KB)
Attached To
Mode
rMWPROD MediaWiki Production
Attached
Detach File
Event Timeline
Log In to Comment