57 'ChronologyProtector',
58 md5( $client[
'ip'] .
"\n" . $client[
'agent'] )
97 if ( !empty( $this->startupPositions[$masterName] ) ) {
99 $pos = $this->startupPositions[$masterName];
101 ": LB '" . $info[
'id'] .
"' waiting for master pos $pos\n" );
123 if ( !$db || !$db->doneWrites() ) {
124 wfDebugLog(
'replication', __METHOD__ .
": LB {$info['id']}, no writes done\n" );
129 $pos = $db->getMasterPos();
130 wfDebugLog(
'replication', __METHOD__ .
": LB {$info['id']} has master pos $pos\n" );
131 $this->shutdownPositions[$masterName] = $pos;
141 if ( !$this->enabled || !count( $this->shutdownPositions ) ) {
146 __METHOD__ .
": saving master pos for " .
147 implode(
', ', array_keys( $this->shutdownPositions ) ) .
"\n"
151 $ok = $this->
store->merge(
155 if ( $curValue ===
false ) {
158 $curPositions = $curValue[
'positions'];
161 if ( !isset( $curPositions[$db] )
162 || $pos->asOfTime() > $curPositions[$db]->asOfTime()
164 $curPositions[$db] = $pos;
169 return [
'positions' => $curPositions ];
179 __METHOD__ .
": failed to save master pos for " .
180 implode(
', ', array_keys( $this->shutdownPositions ) ) .
"\n"
193 if ( $this->initialized ) {
197 $this->initialized =
true;
199 $data = $this->
store->get( $this->
key );
200 $this->startupPositions = $data ? $data[
'positions'] : [];
202 wfDebugLog(
'replication', __METHOD__ .
": key is {$this->key} (read)\n" );
204 $this->startupPositions = [];
206 wfDebugLog(
'replication', __METHOD__ .
": key is {$this->key} (unread)\n" );
bool $initialized
Whether the client data was loaded.
the array() calling protocol came about after MediaWiki 1.4rc1.
getAnyOpenConnection($i)
Get any open connection to a given server index, local or foreign Returns false if there is no connec...
initLB(LoadBalancer $lb)
Initialise a LoadBalancer to give it appropriate chronology protection.
bool $enabled
Whether to no-op all method calls.
getServerCount()
Get the number of defined servers (not the number of open connections)
DBMasterPos[] $shutdownPositions
Map of (DB master name => position)
Apache License January AND DISTRIBUTION Definitions License shall mean the terms and conditions for use
initPositions()
Load in previous master positions for the client.
MediaWiki s SiteStore can be cached and stored in a flat in a json format If the SiteStore is frequently the file cache may provide a performance benefit over a database store
bool $wait
Whether to check and wait on positions.
shutdownLB(LoadBalancer $lb)
Notify the ChronologyProtector that the LoadBalancer is about to shut down.
Database load balancing object.
wfDebugLog($logGroup, $text, $dest= 'all', array $context=[])
Send a line to a supplementary debug log file, if configured, or main debug log if not...
interface is intended to be more or less compatible with the PHP memcached client.
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 etc Handles the details of getting and saving to the user table of the and dealing with sessions and cookies OutputPage Encapsulates the entire HTML page that will be sent in response to any server request It is used by calling its functions to add in any and then calling but I prefer the flexibility This should also do the output encoding The system allocates a global one in $wgOut Title Represents the title of an and does all the work of translating among various forms such as plain database key
array $client
Map of (ip: <IP>, agent: <user-agent>)
const WRITE_SYNC
Bitfield constants for set()/merge()
parentInfo($x=null)
Get or set arbitrary data used by the parent object, usually an LBFactory.
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
__construct(BagOStuff $store, array $client)
string $key
Storage key name.
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
Class for ensuring a consistent ordering of events as seen by the user, despite replication.
shutdown()
Notify the ChronologyProtector that the LBFactory is done calling shutdownLB() for now...
waitFor($pos)
Set the master wait position If a DB_SLAVE connection has been opened already, waits Otherwise sets a...
getServerName($i)
Get the host name or IP address of the server with the specified index Prefer a readable name if avai...
DBMasterPos[] $startupPositions
Map of (DB master name => position)
makeGlobalKey()
Make a global cache key.