MediaWiki  REL1_31
MockApiQueryBase.php
Go to the documentation of this file.
1 <?php
3  private $name;
4 
5  public function execute() {
6  }
7 
8  public function __construct( $name = 'mock' ) {
9  $this->name = $name;
10  }
11 
12  public function getModuleName() {
13  return $this->name;
14  }
15 
16  public function getModulePath() {
17  return 'query+' . $this->getModuleName();
18  }
19 }
MockApiQueryBase\getModuleName
getModuleName()
Get the name of the module being executed by this instance.
Definition: MockApiQueryBase.php:12
php
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:37
ApiQueryBase
This is a base class for all Query modules.
Definition: ApiQueryBase.php:33
MockApiQueryBase\getModulePath
getModulePath()
Get the path to this module.
Definition: MockApiQueryBase.php:16
MockApiQueryBase\execute
execute()
Evaluates the parameters, performs the requested query, and sets up the result.
Definition: MockApiQueryBase.php:5
MockApiQueryBase\__construct
__construct( $name='mock')
Definition: MockApiQueryBase.php:8
name
design txt This is a brief overview of the new design More thorough and up to date information is available on the documentation wiki at name
Definition: design.txt:12
MockApiQueryBase
Definition: MockApiQueryBase.php:2
MockApiQueryBase\$name
$name
Definition: MockApiQueryBase.php:3