Page Menu
Home
WickedGov Phorge
Search
Configure Global Search
Log In
Files
F1433013
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
Sat, May 16, 22:34 (1 h, 58 m)
Storage Engine
local-disk
Storage Format
Raw Data
Storage Handle
62/44/0043b182d920eee845d7084f45df
Default Alt Text
Integration.php (1 KB)
Attached To
Mode
rMWPROD MediaWiki Production
Attached
Detach File
Event Timeline
Log In to Comment