MediaWiki  1.32.5
License.php
Go to the documentation of this file.
1 <?php
30 class License {
32  public $template;
33 
35  public $text;
36 
40  public function __construct( $str ) {
41  $str = $this->parse( $str );
42  list( $this->template, $this->text ) = $this->split( $str );
43  }
44 
49  protected function parse( $str ) {
50  return $str;
51  }
52 
57  protected function split( $str ) {
58  list( $text, $template ) = explode( '|', strrev( $str ), 2 );
59  return [ strrev( $template ), strrev( $text ) ];
60  }
61 }
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:35
License\$text
string $text
Definition: License.php:35
list
deferred txt A few of the database updates required by various functions here can be deferred until after the result page is displayed to the user For updating the view updating the linked to tables after a etc PHP does not yet have any way to tell the server to actually return and disconnect while still running these but it might have such a feature in the future We handle these by creating a deferred update object and putting those objects on a global list
Definition: deferred.txt:11
License\$template
string $template
Definition: License.php:32
License
A License class for use on Special:Upload (represents a single type of license).
Definition: License.php:30
License\split
split( $str)
Definition: License.php:57
text
This list may contain false positives That usually means there is additional text with links below the first Each row contains links to the first and second as well as the first line of the second redirect text
Definition: All_system_messages.txt:1267
License\parse
parse( $str)
Definition: License.php:49
License\__construct
__construct( $str)
Definition: License.php:40