Page Menu
Home
WickedGov Phorge
Search
Configure Global Search
Log In
Files
F6077947
Integration.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
Integration.php
View Options
<?php
namespace
MediaWiki\Extension\EventLogging\MetricsPlatform
;
use
MediaWiki\Context\IContextSource
;
use
Wikimedia\MetricsPlatform\Integration
as
MetricsPlatformIntegration
;
/**
* Provides the following functionality for the Metrics Platform Client:
*
* 1. Sending events to a remote service via EventBus; and
* 2. Gets the values of various context attributes from the execution environment
*
* Note well that #2 is done lazily, during the first call to `Integration#getContextAttribute()`
* and not at construction time, which keeps the cost of instantiating `Integration` instances low.
*
* @internal
*/
class
Integration
implements
MetricsPlatformIntegration
{
/**
* @var ContextAttributesFactory
*/
private
$contextAttributesFactory
;
/**
* @var IContextSource
*/
private
$contextSource
;
/**
* @var array
*/
private
$contextAttributes
;
public
function
__construct
(
ContextAttributesFactory
$contextAttributesFactory
,
IContextSource
$contextSource
)
{
$this
->
contextAttributesFactory
=
$contextAttributesFactory
;
$this
->
contextSource
=
$contextSource
;
}
/** @inheritDoc */
public
function
getContextAttribute
(
string
$name
)
{
$contextAttributes
=
$this
->
contextAttributes
??=
$this
->
contextAttributesFactory
->
newContextAttributes
(
$this
->
contextSource
);
return
$contextAttributes
[
$name
]
??
null
;
}
}
File Metadata
Details
Attached
Mime Type
text/x-php
Expires
Oct 5 2026, 09:55 (6 w, 1 d ago)
Storage Engine
local-disk
Storage Format
Raw Data
Storage Handle
24/a9/83138ee918db99ed5f5cd7d86d5d
Default Alt Text
Integration.php (1 KB)
Attached To
Mode
rMWPROD MediaWiki Production
Attached
Detach File
Event Timeline
Log In to Comment