MediaWiki  master
Go to the documentation of this file.
1 <?php
18  public function timing( $key, $time ) {
19  }
27  public function gauge( $key, $value ) {
28  }
47  public function set( $key, $value ) {
48  return [];
49  }
58  public function increment( $key ) {
59  return [];
60  }
70  public function decrement( $key ) {
71  return [];
72  }
82  public function updateCount( $key, $delta ) {
83  return [];
84  }
96  public function produceStatsdData(
97  $key,
98  $value = 1,
99  $metric = StatsdDataInterface::STATSD_METRIC_COUNT
100  ) {
101  $data = new StatsdData();
102  $data->setKey( $key );
103  $data->setValue( $value );
104  $data->setMetric( $metric );
105  return $data;
106  }
108  public function hasData() {
109  return false;
110  }
112  public function getData() {
113  return [];
114  }
116  public function clearData() {
117  // Nothing to do, always empty
118  }
120  public function getDataCount() {
121  return 0;
122  }
124  public function setEnabled( $enabled ) {
125  // Nothing to do, null factory is always disabled.
126  }
127 }
Apache License January AND DISTRIBUTION Definitions License shall mean the terms and conditions for use
Return the buffered data from the factory.
see documentation in includes Linker php for Linker::makeImageLink & $time
Definition: hooks.txt:1780
updateCount( $key, $delta)
This function creates a &#39;updateCount&#39; StatsdData object.
Clear all buffered data from the factory.
Check whether this data factory has any buffered data.
gauge( $key, $value)
This function creates a &#39;gauge&#39; StatsdData.
decrement( $key)
This function creates a &#39;decrement&#39; StatsdData object.
timing( $key, $time)
This function creates a &#39;timing&#39; StatsdData.
produceStatsdData( $key, $value=1, $metric=StatsdDataInterface::STATSD_METRIC_COUNT)
Produce a StatsdDataInterface Object.
injection txt This is an overview of how MediaWiki makes use of dependency injection The design described here grew from the discussion of RFC T384 The term dependency this means that anything an object needs to operate should be injected from the the object itself should only know narrow no concrete implementation of the logic it relies on The requirement to inject everything typically results in an architecture that based on two main types of and essentially stateless service objects that use other service objects to operate on the value objects As of the beginning MediaWiki is only starting to use the DI approach Much of the code still relies on global state or direct resulting in a highly cyclical dependency which acts as the top level factory for services in MediaWiki which can be used to gain access to default instances of various services MediaWikiServices however also allows new services to be defined and default services to be redefined Services are defined or redefined by providing a callback the instantiator that will return a new instance of the service When it will create an instance of MediaWikiServices and populate it with the services defined in the files listed by thereby bootstrapping the DI framework Per $wgServiceWiringFiles lists includes ServiceWiring php
Definition: injection.txt:35
setEnabled( $enabled)
Set collection enable status.
increment( $key)
This function creates a &#39;increment&#39; StatsdData object.
Return the number of buffered statsd data entries.