5use InvalidArgumentException;
40 } elseif ( is_array(
$conn ) && count(
$conn ) >= 4 &&
$conn[self::FLD_DOMAIN] !==
false ) {
41 $this->params =
$conn;
43 throw new InvalidArgumentException(
"Missing lazy connection arguments." );
48 if ( $this->conn ===
null ) {
50 $this->conn = $this->lb->getConnection( $db, $groups, $wiki, $flags );
53 return $this->conn->$name( ...$arguments );
65 return $this->
__call( __FUNCTION__, func_get_args() );
69 return $this->
__call( __FUNCTION__, func_get_args() );
73 return $this->
__call( __FUNCTION__, func_get_args() );
77 return $this->
__call( __FUNCTION__, func_get_args() );
81 return $this->
__call( __FUNCTION__, func_get_args() );
85 return $this->
__call( __FUNCTION__, func_get_args() );
89 if ( $this->conn ===
null && $prefix ===
null ) {
92 return $domain->getTablePrefix();
93 } elseif ( $this->conn !==
null && $prefix ===
null ) {
95 return $this->
__call( __FUNCTION__, func_get_args() );
98 throw new DBUnexpectedError( $this,
"Database selection is disallowed to enable reuse." );
102 if ( $this->conn ===
null && $schema ===
null ) {
105 return $domain->getSchema();
106 } elseif ( $this->conn !==
null && $schema ===
null ) {
108 return $this->
__call( __FUNCTION__, func_get_args() );
111 throw new DBUnexpectedError( $this,
"Database selection is disallowed to enable reuse." );
115 return $this->
__call( __FUNCTION__, func_get_args() );
120 throw new DBUnexpectedError( $this,
"Changing LB info is disallowed to enable reuse." );
125 throw new DBUnexpectedError( $this,
"Database injection is disallowed to enable reuse." );
129 return $this->
__call( __FUNCTION__, func_get_args() );
133 return $this->
__call( __FUNCTION__, func_get_args() );
137 return $this->
__call( __FUNCTION__, func_get_args() );
141 return $this->
__call( __FUNCTION__, func_get_args() );
145 return $this->
__call( __FUNCTION__, func_get_args() );
149 return $this->
__call( __FUNCTION__, func_get_args() );
153 return $this->
__call( __FUNCTION__, func_get_args() );
157 return $this->
__call( __FUNCTION__, func_get_args() );
161 return $this->
__call( __FUNCTION__, func_get_args() );
165 return $this->
__call( __FUNCTION__, func_get_args() );
169 return $this->
__call( __FUNCTION__, func_get_args() );
173 return $this->
__call( __FUNCTION__, func_get_args() );
176 public function setFlag( $flag, $remember = self::REMEMBER_NOTHING ) {
177 return $this->
__call( __FUNCTION__, func_get_args() );
180 public function clearFlag( $flag, $remember = self::REMEMBER_NOTHING ) {
181 return $this->
__call( __FUNCTION__, func_get_args() );
185 return $this->
__call( __FUNCTION__, func_get_args() );
189 return $this->
__call( __FUNCTION__, func_get_args() );
193 return $this->
__call( __FUNCTION__, func_get_args() );
197 if ( $this->conn ===
null ) {
203 return $this->
__call( __FUNCTION__, func_get_args() );
214 return $this->
__call( __FUNCTION__, func_get_args() );
218 return $this->
__call( __FUNCTION__, func_get_args() );
222 return $this->
__call( __FUNCTION__, func_get_args() );
226 return $this->
__call( __FUNCTION__, func_get_args() );
230 return $this->
__call( __FUNCTION__, func_get_args() );
234 return $this->
__call( __FUNCTION__, func_get_args() );
238 return $this->
__call( __FUNCTION__, func_get_args() );
242 return $this->
__call( __FUNCTION__, func_get_args() );
246 return $this->
__call( __FUNCTION__, func_get_args() );
250 return $this->
__call( __FUNCTION__, func_get_args() );
254 return $this->
__call( __FUNCTION__, func_get_args() );
258 return $this->
__call( __FUNCTION__, func_get_args() );
262 return $this->
__call( __FUNCTION__, func_get_args() );
270 if ( $this->role !== ILoadBalancer::DB_MASTER ) {
271 $flags |= IDatabase::QUERY_REPLICA_ROLE;
274 return $this->
__call( __FUNCTION__, [ $sql,
$fname, $flags ] );
278 return $this->
__call( __FUNCTION__, func_get_args() );
282 $table, $var, $cond =
'',
$fname = __METHOD__,
$options = [], $join_conds = []
284 return $this->
__call( __FUNCTION__, func_get_args() );
288 $table, $var, $cond =
'',
$fname = __METHOD__,
$options = [], $join_conds = []
290 return $this->
__call( __FUNCTION__, func_get_args() );
297 return $this->
__call( __FUNCTION__, func_get_args() );
304 return $this->
__call( __FUNCTION__, func_get_args() );
311 return $this->
__call( __FUNCTION__, func_get_args() );
317 return $this->
__call( __FUNCTION__, func_get_args() );
323 return $this->
__call( __FUNCTION__, func_get_args() );
327 $table, $conds =
'',
$fname = __METHOD__,
$options = [], $join_conds = []
331 return $this->
__call( __FUNCTION__, func_get_args() );
335 return $this->
__call( __FUNCTION__, func_get_args() );
339 return $this->
__call( __FUNCTION__, func_get_args() );
343 return $this->
__call( __FUNCTION__, func_get_args() );
349 return $this->
__call( __FUNCTION__, func_get_args() );
355 return $this->
__call( __FUNCTION__, func_get_args() );
358 public function makeList( $a, $mode = self::LIST_COMMA ) {
359 return $this->
__call( __FUNCTION__, func_get_args() );
363 return $this->
__call( __FUNCTION__, func_get_args() );
367 return $this->
__call( __FUNCTION__, func_get_args() );
371 return $this->
__call( __FUNCTION__, func_get_args() );
374 public function bitAnd( $fieldLeft, $fieldRight ) {
375 return $this->
__call( __FUNCTION__, func_get_args() );
378 public function bitOr( $fieldLeft, $fieldRight ) {
379 return $this->
__call( __FUNCTION__, func_get_args() );
383 return $this->
__call( __FUNCTION__, func_get_args() );
387 $delim, $table, $field, $conds =
'', $join_conds = []
389 return $this->
__call( __FUNCTION__, func_get_args() );
393 return $this->
__call( __FUNCTION__, func_get_args() );
397 return $this->
__call( __FUNCTION__, func_get_args() );
401 return $this->
__call( __FUNCTION__, func_get_args() );
408 return $this->
__call( __FUNCTION__, func_get_args() );
412 return $this->
__call( __FUNCTION__, func_get_args() );
417 throw new DBUnexpectedError( $this,
"Database selection is disallowed to enable reuse." );
422 throw new DBUnexpectedError( $this,
"Database selection is disallowed to enable reuse." );
426 if ( $this->conn ===
null ) {
429 return $domain->getDatabase();
432 return $this->
__call( __FUNCTION__, func_get_args() );
436 return $this->
__call( __FUNCTION__, func_get_args() );
440 return $this->
__call( __FUNCTION__, func_get_args() );
444 return $this->
__call( __FUNCTION__, func_get_args() );
448 return $this->
__call( __FUNCTION__, func_get_args() );
452 return $this->
__call( __FUNCTION__, func_get_args() );
456 return $this->
__call( __FUNCTION__, func_get_args() );
462 return $this->
__call( __FUNCTION__, func_get_args() );
468 return $this->
__call( __FUNCTION__, func_get_args() );
476 return $this->
__call( __FUNCTION__, func_get_args() );
480 $delTable, $joinTable, $delVar, $joinVar, $conds,
$fname = __METHOD__
484 return $this->
__call( __FUNCTION__, func_get_args() );
487 public function delete( $table, $conds,
$fname = __METHOD__ ) {
490 return $this->
__call( __FUNCTION__, func_get_args() );
494 $destTable, $srcTable, $varMap, $conds,
495 $fname = __METHOD__, $insertOptions = [], $selectOptions = [], $selectJoinConds = []
499 return $this->
__call( __FUNCTION__, func_get_args() );
503 return $this->
__call( __FUNCTION__, func_get_args() );
507 return $this->
__call( __FUNCTION__, func_get_args() );
511 $table,
$vars,
array $permute_conds, $extra_conds =
'',
$fname = __METHOD__,
514 return $this->
__call( __FUNCTION__, func_get_args() );
518 return $this->
__call( __FUNCTION__, func_get_args() );
522 return $this->
__call( __FUNCTION__, func_get_args() );
526 return $this->
__call( __FUNCTION__, func_get_args() );
530 return $this->
__call( __FUNCTION__, func_get_args() );
534 return $this->
__call( __FUNCTION__, func_get_args() );
538 return $this->
__call( __FUNCTION__, func_get_args() );
542 return $this->
__call( __FUNCTION__, func_get_args() );
546 return $this->
__call( __FUNCTION__, func_get_args() );
550 return $this->
__call( __FUNCTION__, func_get_args() );
554 return $this->
__call( __FUNCTION__, func_get_args() );
558 return $this->
__call( __FUNCTION__, func_get_args() );
562 return $this->
__call( __FUNCTION__, func_get_args() );
567 return $this->
__call( __FUNCTION__, func_get_args() );
572 return $this->
__call( __FUNCTION__, func_get_args() );
581 return $this->
__call( __FUNCTION__, func_get_args() );
585 return $this->
__call( __FUNCTION__, func_get_args() );
589 return $this->
__call( __FUNCTION__, func_get_args() );
593 $fname = __METHOD__, $cancelable = IDatabase::ATOMIC_NOT_CANCELABLE
596 return $this->
__call( __FUNCTION__, func_get_args() );
601 return $this->
__call( __FUNCTION__, func_get_args() );
606 return $this->
__call( __FUNCTION__, func_get_args() );
610 $fname, callable $callback, $cancelable = self::ATOMIC_NOT_CANCELABLE
613 return $this->
__call( __FUNCTION__, func_get_args() );
616 public function begin(
$fname = __METHOD__, $mode = IDatabase::TRANSACTION_EXPLICIT ) {
617 return $this->
__call( __FUNCTION__, func_get_args() );
621 return $this->
__call( __FUNCTION__, func_get_args() );
625 return $this->
__call( __FUNCTION__, func_get_args() );
629 return $this->
__call( __FUNCTION__, func_get_args() );
633 return $this->
__call( __FUNCTION__, func_get_args() );
637 return $this->
__call( __FUNCTION__, func_get_args() );
640 public function ping( &$rtt =
null ) {
641 return func_num_args()
642 ? $this->
__call( __FUNCTION__, [ &$rtt ] )
643 : $this->
__call( __FUNCTION__, [] );
647 return $this->
__call( __FUNCTION__, func_get_args() );
651 return $this->
__call( __FUNCTION__, func_get_args() );
655 return $this->
__call( __FUNCTION__, func_get_args() );
659 return $this->
__call( __FUNCTION__, func_get_args() );
663 return $this->
__call( __FUNCTION__, func_get_args() );
667 return $this->
__call( __FUNCTION__, func_get_args() );
671 return $this->
__call( __FUNCTION__, func_get_args() );
677 return $this->
__call( __FUNCTION__, func_get_args() );
680 public function lock( $lockName, $method, $timeout = 5 ) {
683 return $this->
__call( __FUNCTION__, func_get_args() );
686 public function unlock( $lockName, $method ) {
689 return $this->
__call( __FUNCTION__, func_get_args() );
695 return $this->
__call( __FUNCTION__, func_get_args() );
699 return $this->
__call( __FUNCTION__, func_get_args() );
703 return $this->
__call( __FUNCTION__, func_get_args() );
707 return $this->
__call( __FUNCTION__, func_get_args() );
711 return $this->
__call( __FUNCTION__, func_get_args() );
715 return $this->
__call( __FUNCTION__, func_get_args() );
719 return $this->
__call( __FUNCTION__, func_get_args() );
723 return $this->
__call( __FUNCTION__, func_get_args() );
727 return $this->
__call( __FUNCTION__, func_get_args() );
745 if ( $this->role !== ILoadBalancer::DB_MASTER ) {
755 $this->lb->reuseConnection( $this->conn );
764class_alias( DBConnRef::class,
'DBConnRef' );
Apache License January AND DISTRIBUTION Definitions License shall mean the terms and conditions for use
if(defined( 'MW_SETUP_CALLBACK')) $fname
Customization point after all loading (constants, functions, classes, DefaultSettings,...
Class to handle database/prefix specification for IDatabase domains.
static newFromId( $domain)
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
$data
Utility to generate mapping file used in mw.Title (phpCharToUpper.json)
static configuration should be added through ResourceLoaderGetConfigVars instead & $vars
do that in ParserLimitReportFormat instead use this to modify the parameters of the image all existing parser cache entries will be invalid To avoid you ll need to handle that somehow(e.g. with the RejectParserCacheValue hook) because MediaWiki won 't do it for you. & $defaults also a ContextSource after deleting those rows but within the same transaction $rows
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 & $options
this hook is for auditing only 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 & $tables
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
The wiki should then use memcached to cache various data To use multiple just add more items to the array To increase the weight of a make its entry a array("192.168.0.1:11211", 2))
if(is_array($mode)) switch( $mode) $input