5use InvalidArgumentException;
6use UnexpectedValueException;
60 if ( preg_match(
'!^(.+)\.(\d+)/(\d+)$!', $position, $m ) ) {
61 $this->binLog = $m[1];
62 $this->logPos = [ self::CORD_INDEX => (int)$m[2], self::CORD_EVENT => (
int)$m[3] ];
65 $gtids = array_filter( array_map(
'trim', explode(
',', $position ) ) );
69 throw new InvalidArgumentException(
"Invalid GTID '$gtid'." );
72 list( $domain, $pos ) = $components;
73 if ( isset( $this->gtids[$domain] ) ) {
78 if ( $pos > $otherPos ) {
79 $this->gtids[$domain] = $gtid;
82 $this->gtids[$domain] = $gtid;
85 if ( is_int( $domain ) ) {
91 if ( !$this->gtids ) {
92 throw new InvalidArgumentException(
"GTID set cannot be empty." );
104 if ( !( $pos instanceof
self ) ) {
105 throw new InvalidArgumentException(
"Position not an instance of " . __CLASS__ );
110 $thatPosByDomain = $pos->getActiveGtidCoordinates();
111 if ( $thisPosByDomain && $thatPosByDomain ) {
114 foreach ( $thatPosByDomain
as $domain => $thatPos ) {
115 if ( isset( $thisPosByDomain[$domain] ) ) {
116 $comparisons[] = ( $thatPos <= $thisPosByDomain[$domain] );
123 return ( $comparisons && !in_array(
false, $comparisons,
true ) );
128 $thatBinPos = $pos->getBinlogCoordinates();
129 if ( $thisBinPos && $thatBinPos && $thisBinPos[
'binlog'] === $thatBinPos[
'binlog'] ) {
130 return ( $thisBinPos[
'pos'] >= $thatBinPos[
'pos'] );
138 if ( !( $pos instanceof
self ) ) {
139 throw new InvalidArgumentException(
"Position not an instance of " . __CLASS__ );
144 $thatPosDomains = array_keys( $pos->getActiveGtidCoordinates() );
145 if ( $thisPosDomains && $thatPosDomains ) {
150 return array_intersect( $thatPosDomains, $thisPosDomains ) ?
true :
false;
155 $thatBinPos = $pos->getBinlogCoordinates();
157 return ( $thisBinPos && $thatBinPos && $thisBinPos[
'binlog'] === $thatBinPos[
'binlog'] );
181 return $this->gtids ?
null :
"{$this->binLog}.{$this->logPos[self::CORD_INDEX]}";
197 $this->activeDomain = (int)$id;
205 $this->activeServerId = (int)$id;
213 $this->activeServerUUID = $id;
236 foreach ( $this->gtids
as $domain => $gtid ) {
241 if ( $this->
style === self::GTID_MARIA && $this->activeDomain !==
null ) {
245 if ( $this->
style === self::GTID_MARIA && $this->activeServerId !==
null ) {
247 } elseif ( $this->
style === self::GTID_MYSQL && $this->activeServerUUID !==
null ) {
252 $gtidInfos[$domain] = $pos;
265 if ( preg_match(
'!^(\d+)-(\d+)-(\d+)$!', $id, $m ) ) {
267 return [ (int)$m[1], (
int)$m[3], (int)$m[2] ];
268 } elseif ( preg_match(
'!^(\w{8}-\w{4}-\w{4}-\w{4}-\w{12}):(?:\d+-|)(\d+)$!', $id, $m ) ) {
273 return [ $m[1], (int)$m[2], $m[1] ];
285 return ( $this->binLog !==
null && $this->logPos !==
null )
293 'activeDomain' => $this->activeDomain,
294 'activeServerId' => $this->activeServerId,
295 'activeServerUUID' => $this->activeServerUUID,
302 if ( !is_array(
$data ) ) {
303 throw new UnexpectedValueException( __METHOD__ .
": cannot unserialize position" );
307 if ( isset(
$data[
'activeDomain'] ) ) {
310 if ( isset(
$data[
'activeServerId'] ) ) {
313 if ( isset(
$data[
'activeServerUUID'] ) ) {
323 ? implode(
',', $this->gtids )
324 : $this->
getLogFile() .
"/{$this->logPos[self::CORD_EVENT]}";
Apache License January AND DISTRIBUTION Definitions License shall mean the terms and conditions for use
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
This document is intended to provide useful advice for parties seeking to redistribute MediaWiki to end users It s targeted particularly at maintainers for Linux since it s been observed that distribution packages of MediaWiki often break We ve consistently had to recommend that users seeking support use official tarballs instead of their distribution s and this often solves whatever problem the user is having It would be nice if this could such as
$data
Utility to generate mapping file used in mw.Title (phpCharToUpper.json)
this hook is for auditing only or null if authentication failed before getting that far or null if we can t even determine that When $user is not null
null means default in associative array with keys and values unescaped Should be merged with default with a value of false meaning to suppress the attribute in associative array with keys and values unescaped noclasses just before the function returns a value If you return true
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
foreach( $res as $row) $serialized