MediaWiki REL1_33
ExternalStoreForTesting.php
Go to the documentation of this file.
1<?php
2
4
5 protected $data = [
6 'cluster1' => [
7 '200' => 'Hello',
8 '300' => [
9 'Hello', 'World',
10 ],
11 // gzip string below generated with gzdeflate( 'AAAABBAAA' )
12 '12345' => "sttttr\002\022\000",
13 ],
14 ];
15
21 public function fetchFromURL( $url ) {
22 // Based on ExternalStoreDB
23 $path = explode( '/', $url );
24 $cluster = $path[2];
25 $id = $path[3];
26 if ( isset( $path[4] ) ) {
27 $itemID = $path[4];
28 } else {
29 $itemID = false;
30 }
31
32 if ( !isset( $this->data[$cluster][$id] ) ) {
33 return null;
34 }
35
36 if ( $itemID !== false
37 && is_array( $this->data[$cluster][$id] )
38 && isset( $this->data[$cluster][$id][$itemID] )
39 ) {
40 return $this->data[$cluster][$id][$itemID];
41 }
42
43 return $this->data[$cluster][$id];
44 }
45
46}
fetchFromURL( $url)
Fetch data from given URL.
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
This document describes the state of Postgres support in and is fairly well maintained The main code is very well while extensions are very hit and miss it is probably the most supported database after MySQL Much of the work in making MediaWiki database agnostic came about through the work of creating Postgres but without copying over all the usage comments General notes on the but these can almost always be programmed around *Although Postgres has a true BOOLEAN boolean columns are always mapped to as the code does not always treat the column as a and VARBINARY columns should simply be TEXT The only exception is when VARBINARY is used to store true binary data
Definition postgres.txt:37