Page Menu
Home
WickedGov Phorge
Search
Configure Global Search
Log In
Files
F4109695
EventLogger.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
EventLogger.php
View Options
<?php
namespace
MediaWiki\CheckUser\Investigate\Utilities
;
use
MediaWiki\Extension\EventLogging\EventLogging
;
use
MediaWiki\Registration\ExtensionRegistry
;
use
Wikimedia\Timestamp\ConvertibleTimestamp
;
class
EventLogger
{
private
ExtensionRegistry
$extensionRegistry
;
/**
* @param ExtensionRegistry $extensionRegistry
*/
public
function
__construct
(
ExtensionRegistry
$extensionRegistry
)
{
$this
->
extensionRegistry
=
$extensionRegistry
;
}
/**
* If the EventLogging extension is loaded, then submit an analytics event to the event
* ingestion service.
*
* The event will be validated using the /analytics/legacy/specialinvestigate schema.
*
* @param array $event
*/
public
function
logEvent
(
$event
):
void
{
if
(
$this
->
extensionRegistry
->
isLoaded
(
'EventLogging'
)
)
{
EventLogging
::
submit
(
'eventlogging_SpecialInvestigate'
,
[
'$schema'
=>
'/analytics/legacy/specialinvestigate/1.0.0'
,
'event'
=>
$event
,
]
);
}
}
/**
* Get a timestamp in milliseconds.
*
* @return int
*/
public
function
getTime
():
int
{
// phpcs:ignore Generic.PHP.NoSilencedErrors.Discouraged
return
(
int
)
round
(
@
ConvertibleTimestamp
::
microtime
()
*
1000
);
}
}
File Metadata
Details
Attached
Mime Type
text/x-php
Expires
Tue, Aug 18, 21:11 (5 d, 13 h ago)
Storage Engine
local-disk
Storage Format
Raw Data
Storage Handle
cd/d3/fe06450464565e152d6a215c9aa5
Default Alt Text
EventLogger.php (1 KB)
Attached To
Mode
rMWPROD MediaWiki Production
Attached
Detach File
Event Timeline
Log In to Comment