Go to the documentation of this file.
74 parent::__construct( $config );
76 $this->dbServers = $config[
'dbServers'];
78 $this->srvsByBucket = array_filter( $config[
'dbsByBucket'],
'is_array' );
79 $this->srvsByBucket = array_values( $this->srvsByBucket );
81 if ( isset( $config[
'lockExpiry'] ) ) {
82 $this->lockExpiry = $config[
'lockExpiry'];
84 $met = ini_get(
'max_execution_time' );
85 $this->lockExpiry = $met ? $met : 60;
87 $this->safeDelay = ( $this->lockExpiry <= 0 )
93 $this->statusCache = isset( $config[
'srvCache'] )
106 foreach ( $pathsByType
as $type => $paths ) {
148 if ( !isset( $this->conns[$lockDb] ) ) {
149 if ( $this->dbServers[$lockDb] instanceof
IDatabase ) {
151 $db = $this->dbServers[$lockDb];
152 } elseif ( is_array( $this->dbServers[$lockDb] ) ) {
154 $config = $this->dbServers[$lockDb];
155 $db = Database::factory( $config[
'type'], $config );
157 throw new UnexpectedValueException(
"No server called '$lockDb'." );
161 # If the connection drops, try to avoid letting the DB rollback
162 # and release the locks before the file operations are finished.
163 # This won't handle the case of DB server restarts however.
165 if ( $this->lockExpiry > 0 ) {
171 $this->conns[$lockDb] = $db;
174 return $this->conns[$lockDb];
195 return ( $this->safeDelay > 0 )
196 ? !$this->statusCache->get( $this->
getMissKey( $lockDb ) )
207 return ( $this->safeDelay > 0 )
208 ? $this->statusCache->set( $this->
getMissKey( $lockDb ), 1, $this->safeDelay )
219 return 'dblockmanager:downservers:' . str_replace(
' ',
'_', $lockDb );
227 foreach ( $this->conns
as $db ) {
Simple store for keeping values in an associative array for the current process.
this hook is for auditing only RecentChangesLinked and Watchlist RecentChangesLinked and Watchlist Do not use this to implement individual filters if they are compatible with the ChangesListFilter and ChangesListFilterGroup structure use sub classes of those in conjunction with the ChangesListSpecialPageStructuredFilters hook This hook can be used to implement filters that do not implement that or custom behavior that is not an individual filter e g Watchlist and Watchlist you will want to construct new ChangesListBooleanFilter or ChangesListStringOptionsFilter objects When constructing you specify which group they belong to You can reuse existing or create your you must register them with $special registerFilterGroup removed from all revisions and log entries to which it was applied This gives extensions a chance to take it off their books as the deletion has already been partly carried out by this point or something similar the user will be unable to create the tag set $status
cacheRecordFailure( $lockDb)
Log a lock request failure to the cache.
as see the revision history and available at free of to any person obtaining a copy of this software and associated documentation to deal in the Software without including without limitation the rights to use
__construct(array $config)
Construct a new instance from configuration.
getLocksOnServer( $lockSrv, array $pathsByType)
@TODO change this code to work in one batch
interface is intended to be more or less compatible with the PHP memcached client.
do that in ParserLimitReportFormat instead use this to modify the parameters of the image and a DIV can begin in one section and end in another Make sure your code can handle that case gracefully See the EditSectionClearerLink extension for an example zero but section is usually empty its values are the globals values before the output is cached my talk my contributions etc etc otherwise the built in rate limiting checks are if enabled allows for interception of redirect as a string mapping parameter names to values & $type
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
cacheCheckFailures( $lockDb)
Checks if the DB has not recently had connection/query errors.
Version of LockManager that uses a quorum from peer servers for locks.
releaseAllLocks()
Release all locks that this session is holding.
getMissKey( $lockDb)
Get a cache key for recent query misses for a DB.
doGetLocksOnServer( $lockSrv, array $paths, $type)
initConnection( $lockDb, IDatabase $db)
Do additional initialization for new lock DB connection.
array[] IDatabase[] $dbServers
Map of (DB names => server config or IDatabase)
IDatabase[] $conns
Map Database connections (DB name => Database)
__destruct()
Make sure remaining locks get cleared for sanity.
div flags Integer display flags(NO_ACTION_LINK, NO_EXTRA_USER_LINKS) 'LogException' returning false will NOT prevent logging $e
static newGood( $value=null)
Factory function for good results.
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
getConnection( $lockDb)
Get (or reuse) a connection to a lock DB.
Version of LockManager based on using named/row DB locks.
this hook is for auditing only RecentChangesLinked and Watchlist RecentChangesLinked and Watchlist Do not use this to implement individual filters if they are compatible with the ChangesListFilter and ChangesListFilterGroup structure use sub classes of those in conjunction with the ChangesListSpecialPageStructuredFilters hook This hook can be used to implement filters that do not implement that or custom behavior that is not an individual filter e g Watchlist and Watchlist you will want to construct new ChangesListBooleanFilter or ChangesListStringOptionsFilter objects When constructing you specify which group they belong to You can reuse existing or create your you must register them with $special registerFilterGroup removed from all revisions and log entries to which it was applied This gives extensions a chance to take it off their books as the deletion has already been partly carried out by this point or something similar the user will be unable to create the tag set and then return false from the hook function Ensure you consume the ChangeTagAfterDelete hook to carry out custom deletion actions as context called by AbstractContent::getParserOutput May be used to override the normal model specific rendering of page content as context as context $options
the array() calling protocol came about after MediaWiki 1.4rc1.
freeLocksOnServer( $lockSrv, array $pathsByType)
Get a connection to a lock server and release locks on $paths.