MediaWiki  1.32.0
DBConnRef.php
Go to the documentation of this file.
1 <?php
2 
3 namespace Wikimedia\Rdbms;
4 
5 use InvalidArgumentException;
6 
15 class DBConnRef implements IDatabase {
17  private $lb;
19  private $conn;
21  private $params;
22 
23  const FLD_INDEX = 0;
24  const FLD_GROUP = 1;
25  const FLD_DOMAIN = 2;
26  const FLD_FLAGS = 3;
27 
32  public function __construct( ILoadBalancer $lb, $conn ) {
33  $this->lb = $lb;
34  if ( $conn instanceof Database ) {
35  $this->conn = $conn; // live handle
36  } elseif ( is_array( $conn ) && count( $conn ) >= 4 && $conn[self::FLD_DOMAIN] !== false ) {
37  $this->params = $conn;
38  } else {
39  throw new InvalidArgumentException( "Missing lazy connection arguments." );
40  }
41  }
42 
43  function __call( $name, array $arguments ) {
44  if ( $this->conn === null ) {
45  list( $db, $groups, $wiki, $flags ) = $this->params;
46  $this->conn = $this->lb->getConnection( $db, $groups, $wiki, $flags );
47  }
48 
49  return $this->conn->$name( ...$arguments );
50  }
51 
52  public function getServerInfo() {
53  return $this->__call( __FUNCTION__, func_get_args() );
54  }
55 
56  public function bufferResults( $buffer = null ) {
57  return $this->__call( __FUNCTION__, func_get_args() );
58  }
59 
60  public function trxLevel() {
61  return $this->__call( __FUNCTION__, func_get_args() );
62  }
63 
64  public function trxTimestamp() {
65  return $this->__call( __FUNCTION__, func_get_args() );
66  }
67 
68  public function explicitTrxActive() {
69  return $this->__call( __FUNCTION__, func_get_args() );
70  }
71 
72  public function assertNoOpenTransactions() {
73  return $this->__call( __FUNCTION__, func_get_args() );
74  }
75 
76  public function tablePrefix( $prefix = null ) {
77  return $this->__call( __FUNCTION__, func_get_args() );
78  }
79 
80  public function dbSchema( $schema = null ) {
81  return $this->__call( __FUNCTION__, func_get_args() );
82  }
83 
84  public function getLBInfo( $name = null ) {
85  return $this->__call( __FUNCTION__, func_get_args() );
86  }
87 
88  public function setLBInfo( $name, $value = null ) {
89  return $this->__call( __FUNCTION__, func_get_args() );
90  }
91 
92  public function setLazyMasterHandle( IDatabase $conn ) {
93  return $this->__call( __FUNCTION__, func_get_args() );
94  }
95 
96  public function implicitGroupby() {
97  return $this->__call( __FUNCTION__, func_get_args() );
98  }
99 
100  public function implicitOrderby() {
101  return $this->__call( __FUNCTION__, func_get_args() );
102  }
103 
104  public function lastQuery() {
105  return $this->__call( __FUNCTION__, func_get_args() );
106  }
107 
108  public function doneWrites() {
109  return $this->__call( __FUNCTION__, func_get_args() );
110  }
111 
112  public function lastDoneWrites() {
113  return $this->__call( __FUNCTION__, func_get_args() );
114  }
115 
116  public function writesPending() {
117  return $this->__call( __FUNCTION__, func_get_args() );
118  }
119 
120  public function preCommitCallbacksPending() {
121  return $this->__call( __FUNCTION__, func_get_args() );
122  }
123 
124  public function writesOrCallbacksPending() {
125  return $this->__call( __FUNCTION__, func_get_args() );
126  }
127 
128  public function pendingWriteQueryDuration( $type = self::ESTIMATE_TOTAL ) {
129  return $this->__call( __FUNCTION__, func_get_args() );
130  }
131 
132  public function pendingWriteCallers() {
133  return $this->__call( __FUNCTION__, func_get_args() );
134  }
135 
136  public function pendingWriteRowsAffected() {
137  return $this->__call( __FUNCTION__, func_get_args() );
138  }
139 
140  public function isOpen() {
141  return $this->__call( __FUNCTION__, func_get_args() );
142  }
143 
144  public function setFlag( $flag, $remember = self::REMEMBER_NOTHING ) {
145  return $this->__call( __FUNCTION__, func_get_args() );
146  }
147 
148  public function clearFlag( $flag, $remember = self::REMEMBER_NOTHING ) {
149  return $this->__call( __FUNCTION__, func_get_args() );
150  }
151 
152  public function restoreFlags( $state = self::RESTORE_PRIOR ) {
153  return $this->__call( __FUNCTION__, func_get_args() );
154  }
155 
156  public function getFlag( $flag ) {
157  return $this->__call( __FUNCTION__, func_get_args() );
158  }
159 
160  public function getProperty( $name ) {
161  return $this->__call( __FUNCTION__, func_get_args() );
162  }
163 
164  public function getDomainID() {
165  if ( $this->conn === null ) {
166  $domain = $this->params[self::FLD_DOMAIN];
167  // Avoid triggering a database connection
168  return $domain instanceof DatabaseDomain ? $domain->getId() : $domain;
169  }
170 
171  return $this->__call( __FUNCTION__, func_get_args() );
172  }
173 
177  public function getWikiID() {
178  return $this->getDomainID();
179  }
180 
181  public function getType() {
182  return $this->__call( __FUNCTION__, func_get_args() );
183  }
184 
185  public function fetchObject( $res ) {
186  return $this->__call( __FUNCTION__, func_get_args() );
187  }
188 
189  public function fetchRow( $res ) {
190  return $this->__call( __FUNCTION__, func_get_args() );
191  }
192 
193  public function numRows( $res ) {
194  return $this->__call( __FUNCTION__, func_get_args() );
195  }
196 
197  public function numFields( $res ) {
198  return $this->__call( __FUNCTION__, func_get_args() );
199  }
200 
201  public function fieldName( $res, $n ) {
202  return $this->__call( __FUNCTION__, func_get_args() );
203  }
204 
205  public function insertId() {
206  return $this->__call( __FUNCTION__, func_get_args() );
207  }
208 
209  public function dataSeek( $res, $row ) {
210  return $this->__call( __FUNCTION__, func_get_args() );
211  }
212 
213  public function lastErrno() {
214  return $this->__call( __FUNCTION__, func_get_args() );
215  }
216 
217  public function lastError() {
218  return $this->__call( __FUNCTION__, func_get_args() );
219  }
220 
221  public function affectedRows() {
222  return $this->__call( __FUNCTION__, func_get_args() );
223  }
224 
225  public function getSoftwareLink() {
226  return $this->__call( __FUNCTION__, func_get_args() );
227  }
228 
229  public function getServerVersion() {
230  return $this->__call( __FUNCTION__, func_get_args() );
231  }
232 
233  public function close() {
234  return $this->__call( __FUNCTION__, func_get_args() );
235  }
236 
237  public function query( $sql, $fname = __METHOD__, $tempIgnore = false ) {
238  return $this->__call( __FUNCTION__, func_get_args() );
239  }
240 
241  public function freeResult( $res ) {
242  return $this->__call( __FUNCTION__, func_get_args() );
243  }
244 
245  public function selectField(
246  $table, $var, $cond = '', $fname = __METHOD__, $options = [], $join_conds = []
247  ) {
248  return $this->__call( __FUNCTION__, func_get_args() );
249  }
250 
251  public function selectFieldValues(
252  $table, $var, $cond = '', $fname = __METHOD__, $options = [], $join_conds = []
253  ) {
254  return $this->__call( __FUNCTION__, func_get_args() );
255  }
256 
257  public function select(
258  $table, $vars, $conds = '', $fname = __METHOD__,
259  $options = [], $join_conds = []
260  ) {
261  return $this->__call( __FUNCTION__, func_get_args() );
262  }
263 
264  public function selectSQLText(
265  $table, $vars, $conds = '', $fname = __METHOD__,
266  $options = [], $join_conds = []
267  ) {
268  return $this->__call( __FUNCTION__, func_get_args() );
269  }
270 
271  public function selectRow(
272  $table, $vars, $conds, $fname = __METHOD__,
273  $options = [], $join_conds = []
274  ) {
275  return $this->__call( __FUNCTION__, func_get_args() );
276  }
277 
278  public function estimateRowCount(
279  $table, $vars = '*', $conds = '', $fname = __METHOD__, $options = [], $join_conds = []
280  ) {
281  return $this->__call( __FUNCTION__, func_get_args() );
282  }
283 
284  public function selectRowCount(
285  $tables, $vars = '*', $conds = '', $fname = __METHOD__, $options = [], $join_conds = []
286  ) {
287  return $this->__call( __FUNCTION__, func_get_args() );
288  }
289 
290  public function lockForUpdate(
291  $table, $conds = '', $fname = __METHOD__, $options = [], $join_conds = []
292  ) {
293  return $this->__call( __FUNCTION__, func_get_args() );
294  }
295 
296  public function fieldExists( $table, $field, $fname = __METHOD__ ) {
297  return $this->__call( __FUNCTION__, func_get_args() );
298  }
299 
300  public function indexExists( $table, $index, $fname = __METHOD__ ) {
301  return $this->__call( __FUNCTION__, func_get_args() );
302  }
303 
304  public function tableExists( $table, $fname = __METHOD__ ) {
305  return $this->__call( __FUNCTION__, func_get_args() );
306  }
307 
308  public function insert( $table, $a, $fname = __METHOD__, $options = [] ) {
309  return $this->__call( __FUNCTION__, func_get_args() );
310  }
311 
312  public function update( $table, $values, $conds, $fname = __METHOD__, $options = [] ) {
313  return $this->__call( __FUNCTION__, func_get_args() );
314  }
315 
316  public function makeList( $a, $mode = self::LIST_COMMA ) {
317  return $this->__call( __FUNCTION__, func_get_args() );
318  }
319 
320  public function makeWhereFrom2d( $data, $baseKey, $subKey ) {
321  return $this->__call( __FUNCTION__, func_get_args() );
322  }
323 
324  public function aggregateValue( $valuedata, $valuename = 'value' ) {
325  return $this->__call( __FUNCTION__, func_get_args() );
326  }
327 
328  public function bitNot( $field ) {
329  return $this->__call( __FUNCTION__, func_get_args() );
330  }
331 
332  public function bitAnd( $fieldLeft, $fieldRight ) {
333  return $this->__call( __FUNCTION__, func_get_args() );
334  }
335 
336  public function bitOr( $fieldLeft, $fieldRight ) {
337  return $this->__call( __FUNCTION__, func_get_args() );
338  }
339 
340  public function buildConcat( $stringList ) {
341  return $this->__call( __FUNCTION__, func_get_args() );
342  }
343 
344  public function buildGroupConcatField(
345  $delim, $table, $field, $conds = '', $join_conds = []
346  ) {
347  return $this->__call( __FUNCTION__, func_get_args() );
348  }
349 
350  public function buildSubstring( $input, $startPosition, $length = null ) {
351  return $this->__call( __FUNCTION__, func_get_args() );
352  }
353 
354  public function buildStringCast( $field ) {
355  return $this->__call( __FUNCTION__, func_get_args() );
356  }
357 
358  public function buildIntegerCast( $field ) {
359  return $this->__call( __FUNCTION__, func_get_args() );
360  }
361 
362  public function buildSelectSubquery(
363  $table, $vars, $conds = '', $fname = __METHOD__,
364  $options = [], $join_conds = []
365  ) {
366  return $this->__call( __FUNCTION__, func_get_args() );
367  }
368 
369  public function databasesAreIndependent() {
370  return $this->__call( __FUNCTION__, func_get_args() );
371  }
372 
373  public function selectDB( $db ) {
374  // Disallow things that might confuse the LoadBalancer tracking
375  throw new DBUnexpectedError( $this, "Database selection is disallowed to enable reuse." );
376  }
377 
378  public function selectDomain( $domain ) {
379  // Disallow things that might confuse the LoadBalancer tracking
380  throw new DBUnexpectedError( $this, "Database selection is disallowed to enable reuse." );
381  }
382 
383  public function getDBname() {
384  return $this->__call( __FUNCTION__, func_get_args() );
385  }
386 
387  public function getServer() {
388  return $this->__call( __FUNCTION__, func_get_args() );
389  }
390 
391  public function addQuotes( $s ) {
392  return $this->__call( __FUNCTION__, func_get_args() );
393  }
394 
395  public function buildLike() {
396  return $this->__call( __FUNCTION__, func_get_args() );
397  }
398 
399  public function anyChar() {
400  return $this->__call( __FUNCTION__, func_get_args() );
401  }
402 
403  public function anyString() {
404  return $this->__call( __FUNCTION__, func_get_args() );
405  }
406 
407  public function nextSequenceValue( $seqName ) {
408  return $this->__call( __FUNCTION__, func_get_args() );
409  }
410 
411  public function replace( $table, $uniqueIndexes, $rows, $fname = __METHOD__ ) {
412  return $this->__call( __FUNCTION__, func_get_args() );
413  }
414 
415  public function upsert(
416  $table, array $rows, array $uniqueIndexes, array $set, $fname = __METHOD__
417  ) {
418  return $this->__call( __FUNCTION__, func_get_args() );
419  }
420 
421  public function deleteJoin(
422  $delTable, $joinTable, $delVar, $joinVar, $conds, $fname = __METHOD__
423  ) {
424  return $this->__call( __FUNCTION__, func_get_args() );
425  }
426 
427  public function delete( $table, $conds, $fname = __METHOD__ ) {
428  return $this->__call( __FUNCTION__, func_get_args() );
429  }
430 
431  public function insertSelect(
432  $destTable, $srcTable, $varMap, $conds,
433  $fname = __METHOD__, $insertOptions = [], $selectOptions = [], $selectJoinConds = []
434  ) {
435  return $this->__call( __FUNCTION__, func_get_args() );
436  }
437 
438  public function unionSupportsOrderAndLimit() {
439  return $this->__call( __FUNCTION__, func_get_args() );
440  }
441 
442  public function unionQueries( $sqls, $all ) {
443  return $this->__call( __FUNCTION__, func_get_args() );
444  }
445 
446  public function unionConditionPermutations(
447  $table, $vars, array $permute_conds, $extra_conds = '', $fname = __METHOD__,
448  $options = [], $join_conds = []
449  ) {
450  return $this->__call( __FUNCTION__, func_get_args() );
451  }
452 
453  public function conditional( $cond, $trueVal, $falseVal ) {
454  return $this->__call( __FUNCTION__, func_get_args() );
455  }
456 
457  public function strreplace( $orig, $old, $new ) {
458  return $this->__call( __FUNCTION__, func_get_args() );
459  }
460 
461  public function getServerUptime() {
462  return $this->__call( __FUNCTION__, func_get_args() );
463  }
464 
465  public function wasDeadlock() {
466  return $this->__call( __FUNCTION__, func_get_args() );
467  }
468 
469  public function wasLockTimeout() {
470  return $this->__call( __FUNCTION__, func_get_args() );
471  }
472 
473  public function wasConnectionLoss() {
474  return $this->__call( __FUNCTION__, func_get_args() );
475  }
476 
477  public function wasReadOnlyError() {
478  return $this->__call( __FUNCTION__, func_get_args() );
479  }
480 
481  public function wasErrorReissuable() {
482  return $this->__call( __FUNCTION__, func_get_args() );
483  }
484 
485  public function masterPosWait( DBMasterPos $pos, $timeout ) {
486  return $this->__call( __FUNCTION__, func_get_args() );
487  }
488 
489  public function getReplicaPos() {
490  return $this->__call( __FUNCTION__, func_get_args() );
491  }
492 
493  public function getMasterPos() {
494  return $this->__call( __FUNCTION__, func_get_args() );
495  }
496 
497  public function serverIsReadOnly() {
498  return $this->__call( __FUNCTION__, func_get_args() );
499  }
500 
501  public function onTransactionResolution( callable $callback, $fname = __METHOD__ ) {
502  return $this->__call( __FUNCTION__, func_get_args() );
503  }
504 
505  public function onTransactionCommitOrIdle( callable $callback, $fname = __METHOD__ ) {
506  return $this->__call( __FUNCTION__, func_get_args() );
507  }
508 
509  public function onTransactionIdle( callable $callback, $fname = __METHOD__ ) {
510  return $this->__call( __FUNCTION__, func_get_args() );
511  }
512 
513  public function onTransactionPreCommitOrIdle( callable $callback, $fname = __METHOD__ ) {
514  return $this->__call( __FUNCTION__, func_get_args() );
515  }
516 
517  public function setTransactionListener( $name, callable $callback = null ) {
518  return $this->__call( __FUNCTION__, func_get_args() );
519  }
520 
521  public function startAtomic(
522  $fname = __METHOD__, $cancelable = IDatabase::ATOMIC_NOT_CANCELABLE
523  ) {
524  return $this->__call( __FUNCTION__, func_get_args() );
525  }
526 
527  public function endAtomic( $fname = __METHOD__ ) {
528  return $this->__call( __FUNCTION__, func_get_args() );
529  }
530 
531  public function cancelAtomic( $fname = __METHOD__, AtomicSectionIdentifier $sectionId = null ) {
532  return $this->__call( __FUNCTION__, func_get_args() );
533  }
534 
535  public function doAtomicSection(
536  $fname, callable $callback, $cancelable = self::ATOMIC_NOT_CANCELABLE
537  ) {
538  return $this->__call( __FUNCTION__, func_get_args() );
539  }
540 
541  public function begin( $fname = __METHOD__, $mode = IDatabase::TRANSACTION_EXPLICIT ) {
542  return $this->__call( __FUNCTION__, func_get_args() );
543  }
544 
545  public function commit( $fname = __METHOD__, $flush = '' ) {
546  return $this->__call( __FUNCTION__, func_get_args() );
547  }
548 
549  public function rollback( $fname = __METHOD__, $flush = '' ) {
550  return $this->__call( __FUNCTION__, func_get_args() );
551  }
552 
553  public function flushSnapshot( $fname = __METHOD__ ) {
554  return $this->__call( __FUNCTION__, func_get_args() );
555  }
556 
557  public function timestamp( $ts = 0 ) {
558  return $this->__call( __FUNCTION__, func_get_args() );
559  }
560 
561  public function timestampOrNull( $ts = null ) {
562  return $this->__call( __FUNCTION__, func_get_args() );
563  }
564 
565  public function ping( &$rtt = null ) {
566  return func_num_args()
567  ? $this->__call( __FUNCTION__, [ &$rtt ] )
568  : $this->__call( __FUNCTION__, [] ); // method cares about null vs missing
569  }
570 
571  public function getLag() {
572  return $this->__call( __FUNCTION__, func_get_args() );
573  }
574 
575  public function getSessionLagStatus() {
576  return $this->__call( __FUNCTION__, func_get_args() );
577  }
578 
579  public function maxListLen() {
580  return $this->__call( __FUNCTION__, func_get_args() );
581  }
582 
583  public function encodeBlob( $b ) {
584  return $this->__call( __FUNCTION__, func_get_args() );
585  }
586 
587  public function decodeBlob( $b ) {
588  return $this->__call( __FUNCTION__, func_get_args() );
589  }
590 
591  public function setSessionOptions( array $options ) {
592  return $this->__call( __FUNCTION__, func_get_args() );
593  }
594 
595  public function setSchemaVars( $vars ) {
596  return $this->__call( __FUNCTION__, func_get_args() );
597  }
598 
599  public function lockIsFree( $lockName, $method ) {
600  return $this->__call( __FUNCTION__, func_get_args() );
601  }
602 
603  public function lock( $lockName, $method, $timeout = 5 ) {
604  return $this->__call( __FUNCTION__, func_get_args() );
605  }
606 
607  public function unlock( $lockName, $method ) {
608  return $this->__call( __FUNCTION__, func_get_args() );
609  }
610 
611  public function getScopedLockAndFlush( $lockKey, $fname, $timeout ) {
612  return $this->__call( __FUNCTION__, func_get_args() );
613  }
614 
615  public function namedLocksEnqueue() {
616  return $this->__call( __FUNCTION__, func_get_args() );
617  }
618 
619  public function getInfinity() {
620  return $this->__call( __FUNCTION__, func_get_args() );
621  }
622 
623  public function encodeExpiry( $expiry ) {
624  return $this->__call( __FUNCTION__, func_get_args() );
625  }
626 
627  public function decodeExpiry( $expiry, $format = TS_MW ) {
628  return $this->__call( __FUNCTION__, func_get_args() );
629  }
630 
631  public function setBigSelects( $value = true ) {
632  return $this->__call( __FUNCTION__, func_get_args() );
633  }
634 
635  public function isReadOnly() {
636  return $this->__call( __FUNCTION__, func_get_args() );
637  }
638 
639  public function setTableAliases( array $aliases ) {
640  return $this->__call( __FUNCTION__, func_get_args() );
641  }
642 
643  public function setIndexAliases( array $aliases ) {
644  return $this->__call( __FUNCTION__, func_get_args() );
645  }
646 
650  function __destruct() {
651  if ( $this->conn ) {
652  $this->lb->reuseConnection( $this->conn );
653  }
654  }
655 }
656 
661 class_alias( DBConnRef::class, 'DBConnRef' );
Wikimedia\Rdbms\DBConnRef\isOpen
isOpen()
Is a connection to the database open?
Definition: DBConnRef.php:140
Wikimedia\Rdbms\DBConnRef\explicitTrxActive
explicitTrxActive()
Definition: DBConnRef.php:68
Wikimedia\Rdbms\DBConnRef\affectedRows
affectedRows()
Get the number of rows affected by the last write query.
Definition: DBConnRef.php:221
Wikimedia\Rdbms\Database
Relational database abstraction object.
Definition: Database.php:48
Wikimedia\Rdbms\DBConnRef\strreplace
strreplace( $orig, $old, $new)
Returns a command for str_replace function in SQL query.
Definition: DBConnRef.php:457
Wikimedia\Rdbms\DBConnRef\FLD_FLAGS
const FLD_FLAGS
Definition: DBConnRef.php:26
Wikimedia\Rdbms\DBConnRef\getType
getType()
Get the type of the DBMS, as it appears in $wgDBtype.
Definition: DBConnRef.php:181
Wikimedia\Rdbms\DatabaseDomain\getId
getId()
Definition: DatabaseDomain.php:179
Wikimedia\Rdbms\DBConnRef\buildGroupConcatField
buildGroupConcatField( $delim, $table, $field, $conds='', $join_conds=[])
Build a GROUP_CONCAT or equivalent statement for a query.
Definition: DBConnRef.php:344
Wikimedia\Rdbms\DBConnRef\nextSequenceValue
nextSequenceValue( $seqName)
Deprecated method, calls should be removed.
Definition: DBConnRef.php:407
Wikimedia\Rdbms\DBConnRef\assertNoOpenTransactions
assertNoOpenTransactions()
Assert that all explicit transactions or atomic sections have been closed.
Definition: DBConnRef.php:72
Wikimedia\Rdbms\DBConnRef\decodeExpiry
decodeExpiry( $expiry, $format=TS_MW)
Decode an expiry time into a DBMS independent format.
Definition: DBConnRef.php:627
captcha-old.count
count
Definition: captcha-old.py:249
Wikimedia\Rdbms\DBConnRef\buildLike
buildLike()
LIKE statement wrapper, receives a variable-length argument list with parts of pattern to match conta...
Definition: DBConnRef.php:395
Wikimedia\Rdbms\DBConnRef\setSessionOptions
setSessionOptions(array $options)
Override database's default behavior.
Definition: DBConnRef.php:591
Wikimedia\Rdbms\DBConnRef\selectDomain
selectDomain( $domain)
Set the current domain (database, schema, and table prefix)
Definition: DBConnRef.php:378
Wikimedia\Rdbms\DBConnRef\makeList
makeList( $a, $mode=self::LIST_COMMA)
Makes an encoded list of strings from an array.
Definition: DBConnRef.php:316
Wikimedia\Rdbms\DBConnRef\serverIsReadOnly
serverIsReadOnly()
Definition: DBConnRef.php:497
Wikimedia\Rdbms\DBConnRef\tableExists
tableExists( $table, $fname=__METHOD__)
Query whether a given table exists.
Definition: DBConnRef.php:304
Wikimedia\Rdbms\DBConnRef\anyString
anyString()
Returns a token for buildLike() that denotes a '' to be used in a LIKE query.
Definition: DBConnRef.php:403
Wikimedia\Rdbms\DBConnRef\selectRowCount
selectRowCount( $tables, $vars=' *', $conds='', $fname=__METHOD__, $options=[], $join_conds=[])
Get the number of rows in dataset.
Definition: DBConnRef.php:284
Wikimedia\Rdbms\DBConnRef\conditional
conditional( $cond, $trueVal, $falseVal)
Returns an SQL expression for a simple conditional.
Definition: DBConnRef.php:453
$tables
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
Definition: hooks.txt:1018
Wikimedia\Rdbms\DBConnRef\timestampOrNull
timestampOrNull( $ts=null)
Convert a timestamp in one of the formats accepted by wfTimestamp() to the format used for inserting ...
Definition: DBConnRef.php:561
Wikimedia\Rdbms\DBConnRef\dataSeek
dataSeek( $res, $row)
Change the position of the cursor in a result object.
Definition: DBConnRef.php:209
Wikimedia\Rdbms\DBConnRef\getDomainID
getDomainID()
Return the currently selected domain ID.
Definition: DBConnRef.php:164
Wikimedia\Rdbms\DBConnRef\$lb
ILoadBalancer $lb
Definition: DBConnRef.php:17
Wikimedia\Rdbms
Definition: ChronologyProtector.php:24
Wikimedia\Rdbms\DBConnRef\$params
array null $params
N-tuple of (server index, group, DatabaseDomain|string)
Definition: DBConnRef.php:21
Wikimedia\Rdbms\DBConnRef\unionSupportsOrderAndLimit
unionSupportsOrderAndLimit()
Returns true if current database backend supports ORDER BY or LIMIT for separate subqueries within th...
Definition: DBConnRef.php:438
Wikimedia\Rdbms\DBMasterPos
An object representing a master or replica DB position in a replicated setup.
Definition: DBMasterPos.php:12
Wikimedia\Rdbms\DBConnRef\buildStringCast
buildStringCast( $field)
Definition: DBConnRef.php:354
Wikimedia\Rdbms\DBConnRef\getLag
getLag()
Get the amount of replication lag for this database server.
Definition: DBConnRef.php:571
Wikimedia\Rdbms\DBConnRef\bufferResults
bufferResults( $buffer=null)
Turns buffering of SQL result sets on (true) or off (false).
Definition: DBConnRef.php:56
Wikimedia\Rdbms\DBConnRef\pendingWriteCallers
pendingWriteCallers()
Get the list of method names that did write queries for this transaction.
Definition: DBConnRef.php:132
Wikimedia\Rdbms\DBConnRef\buildSelectSubquery
buildSelectSubquery( $table, $vars, $conds='', $fname=__METHOD__, $options=[], $join_conds=[])
Equivalent to IDatabase::selectSQLText() except wraps the result in Subqyery.
Definition: DBConnRef.php:362
$s
$s
Definition: mergeMessageFileList.php:187
Wikimedia\Rdbms\DBConnRef\setFlag
setFlag( $flag, $remember=self::REMEMBER_NOTHING)
Set a flag for this connection.
Definition: DBConnRef.php:144
$res
$res
Definition: database.txt:21
Wikimedia\Rdbms\DBConnRef\maxListLen
maxListLen()
Return the maximum number of items allowed in a list, or 0 for unlimited.
Definition: DBConnRef.php:579
Wikimedia\Rdbms\DBConnRef\insert
insert( $table, $a, $fname=__METHOD__, $options=[])
INSERT wrapper, inserts an array into a table.
Definition: DBConnRef.php:308
Wikimedia\Rdbms\DBConnRef\getSessionLagStatus
getSessionLagStatus()
Get the replica DB lag when the current transaction started or a general lag estimate if not transact...
Definition: DBConnRef.php:575
Wikimedia\Rdbms\DBConnRef\implicitOrderby
implicitOrderby()
Returns true if this database does an implicit order by when the column has an index For example: SEL...
Definition: DBConnRef.php:100
Wikimedia\Rdbms\DBConnRef\lastError
lastError()
Get a description of the last error.
Definition: DBConnRef.php:217
Wikimedia\Rdbms\DBConnRef\getFlag
getFlag( $flag)
Returns a boolean whether the flag $flag is set for this connection.
Definition: DBConnRef.php:156
Wikimedia\Rdbms\DBConnRef\wasLockTimeout
wasLockTimeout()
Determines if the last failure was due to a lock timeout.
Definition: DBConnRef.php:469
Wikimedia\Rdbms\DBConnRef\rollback
rollback( $fname=__METHOD__, $flush='')
Rollback a transaction previously started using begin().
Definition: DBConnRef.php:549
Wikimedia\Rdbms\DBConnRef\doAtomicSection
doAtomicSection( $fname, callable $callback, $cancelable=self::ATOMIC_NOT_CANCELABLE)
Perform an atomic section of reversable SQL statements from a callback.
Definition: DBConnRef.php:535
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
Wikimedia\Rdbms\IDatabase
Basic database interface for live and lazy-loaded relation database handles.
Definition: IDatabase.php:38
Wikimedia\Rdbms\DBConnRef\getLBInfo
getLBInfo( $name=null)
Get properties passed down from the server info array of the load balancer.
Definition: DBConnRef.php:84
Wikimedia\Rdbms\DBConnRef\replace
replace( $table, $uniqueIndexes, $rows, $fname=__METHOD__)
REPLACE query wrapper.
Definition: DBConnRef.php:411
Wikimedia\Rdbms\DBConnRef\setTableAliases
setTableAliases(array $aliases)
Make certain table names use their own database, schema, and table prefix when passed into SQL querie...
Definition: DBConnRef.php:639
Wikimedia\Rdbms\DBConnRef\getProperty
getProperty( $name)
Definition: DBConnRef.php:160
Wikimedia\Rdbms\DBConnRef\preCommitCallbacksPending
preCommitCallbacksPending()
Definition: DBConnRef.php:120
Wikimedia\Rdbms\DBConnRef\implicitGroupby
implicitGroupby()
Returns true if this database does an implicit sort when doing GROUP BY.
Definition: DBConnRef.php:96
Wikimedia\Rdbms\DBConnRef\getInfinity
getInfinity()
Find out when 'infinity' is.
Definition: DBConnRef.php:619
Wikimedia\Rdbms\DBConnRef\pendingWriteQueryDuration
pendingWriteQueryDuration( $type=self::ESTIMATE_TOTAL)
Get the time spend running write queries for this transaction.
Definition: DBConnRef.php:128
Wikimedia\Rdbms\DBConnRef\select
select( $table, $vars, $conds='', $fname=__METHOD__, $options=[], $join_conds=[])
Execute a SELECT query constructed using the various parameters provided.
Definition: DBConnRef.php:257
Wikimedia\Rdbms\DBConnRef\insertSelect
insertSelect( $destTable, $srcTable, $varMap, $conds, $fname=__METHOD__, $insertOptions=[], $selectOptions=[], $selectJoinConds=[])
INSERT SELECT wrapper.
Definition: DBConnRef.php:431
Wikimedia\Rdbms\DBConnRef\buildIntegerCast
buildIntegerCast( $field)
Definition: DBConnRef.php:358
Wikimedia\Rdbms\DBConnRef\$conn
Database null $conn
Live connection handle.
Definition: DBConnRef.php:19
Wikimedia\Rdbms\DBConnRef\upsert
upsert( $table, array $rows, array $uniqueIndexes, array $set, $fname=__METHOD__)
INSERT ON DUPLICATE KEY UPDATE wrapper, upserts an array into a table.
Definition: DBConnRef.php:415
Wikimedia\Rdbms\DBConnRef\selectRow
selectRow( $table, $vars, $conds, $fname=__METHOD__, $options=[], $join_conds=[])
Single row SELECT wrapper.
Definition: DBConnRef.php:271
Wikimedia\Rdbms\DBConnRef\getScopedLockAndFlush
getScopedLockAndFlush( $lockKey, $fname, $timeout)
Acquire a named lock, flush any transaction, and return an RAII style unlocker object.
Definition: DBConnRef.php:611
Wikimedia\Rdbms\DBConnRef\getServerInfo
getServerInfo()
A string describing the current software version, and possibly other details in a user-friendly way.
Definition: DBConnRef.php:52
Wikimedia\Rdbms\DBConnRef\indexExists
indexExists( $table, $index, $fname=__METHOD__)
Determines whether an index exists Usually throws a DBQueryError on failure If errors are explicitly ...
Definition: DBConnRef.php:300
Wikimedia\Rdbms\DBConnRef\encodeExpiry
encodeExpiry( $expiry)
Encode an expiry time into the DBMS dependent format.
Definition: DBConnRef.php:623
Wikimedia\Rdbms\DBConnRef\wasDeadlock
wasDeadlock()
Determines if the last failure was due to a deadlock.
Definition: DBConnRef.php:465
Wikimedia\Rdbms\DBConnRef\selectSQLText
selectSQLText( $table, $vars, $conds='', $fname=__METHOD__, $options=[], $join_conds=[])
The equivalent of IDatabase::select() except that the constructed SQL is returned,...
Definition: DBConnRef.php:264
Wikimedia\Rdbms\DBConnRef\writesOrCallbacksPending
writesOrCallbacksPending()
Whether there is a transaction open with either possible write queries or unresolved pre-commit/commi...
Definition: DBConnRef.php:124
Wikimedia\Rdbms\DBConnRef\__destruct
__destruct()
Clean up the connection when out of scope.
Definition: DBConnRef.php:650
Wikimedia\Rdbms\DBConnRef\fetchObject
fetchObject( $res)
Fetch the next row from the given result object, in object form.
Definition: DBConnRef.php:185
Wikimedia\Rdbms\DBConnRef\selectFieldValues
selectFieldValues( $table, $var, $cond='', $fname=__METHOD__, $options=[], $join_conds=[])
A SELECT wrapper which returns a list of single field values from result rows.
Definition: DBConnRef.php:251
Wikimedia\Rdbms\DBConnRef\anyChar
anyChar()
Returns a token for buildLike() that denotes a '_' to be used in a LIKE query.
Definition: DBConnRef.php:399
$input
if(is_array( $mode)) switch( $mode) $input
Definition: postprocess-phan.php:141
Wikimedia\Rdbms\DBConnRef\startAtomic
startAtomic( $fname=__METHOD__, $cancelable=IDatabase::ATOMIC_NOT_CANCELABLE)
Begin an atomic section of SQL statements.
Definition: DBConnRef.php:521
Wikimedia\Rdbms\DBConnRef\endAtomic
endAtomic( $fname=__METHOD__)
Ends an atomic section of SQL statements.
Definition: DBConnRef.php:527
Wikimedia\Rdbms\DBConnRef\unlock
unlock( $lockName, $method)
Release a lock.
Definition: DBConnRef.php:607
Wikimedia\Rdbms\DBConnRef\setSchemaVars
setSchemaVars( $vars)
Set variables to be used in sourceFile/sourceStream, in preference to the ones in $GLOBALS.
Definition: DBConnRef.php:595
Wikimedia\Rdbms\DBConnRef\tablePrefix
tablePrefix( $prefix=null)
Get/set the table prefix.
Definition: DBConnRef.php:76
Wikimedia\Rdbms\DBConnRef\buildSubstring
buildSubstring( $input, $startPosition, $length=null)
Definition: DBConnRef.php:350
Wikimedia\Rdbms\DBConnRef\writesPending
writesPending()
Definition: DBConnRef.php:116
Wikimedia\Rdbms\DBConnRef\getServer
getServer()
Get the server hostname or IP address.
Definition: DBConnRef.php:387
use
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
Definition: MIT-LICENSE.txt:10
Wikimedia\Rdbms\DBConnRef\lock
lock( $lockName, $method, $timeout=5)
Acquire a named lock.
Definition: DBConnRef.php:603
Wikimedia\Rdbms\DBConnRef\estimateRowCount
estimateRowCount( $table, $vars=' *', $conds='', $fname=__METHOD__, $options=[], $join_conds=[])
Estimate the number of rows in dataset.
Definition: DBConnRef.php:278
$vars
static configuration should be added through ResourceLoaderGetConfigVars instead & $vars
Definition: hooks.txt:2270
array
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))
Wikimedia\Rdbms\DBConnRef\getWikiID
getWikiID()
Alias for getDomainID()
Definition: DBConnRef.php:177
Wikimedia\Rdbms\DBConnRef\fieldExists
fieldExists( $table, $field, $fname=__METHOD__)
Determines whether a field exists in a table.
Definition: DBConnRef.php:296
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
Wikimedia\Rdbms\DBConnRef\selectDB
selectDB( $db)
Change the current database.
Definition: DBConnRef.php:373
Wikimedia\Rdbms\DBConnRef\setLazyMasterHandle
setLazyMasterHandle(IDatabase $conn)
Set a lazy-connecting DB handle to the master DB (for replication status purposes)
Definition: DBConnRef.php:92
Wikimedia\Rdbms\DBConnRef\fieldName
fieldName( $res, $n)
Get a field name in a result object.
Definition: DBConnRef.php:201
Wikimedia\Rdbms\DBConnRef\bitNot
bitNot( $field)
Definition: DBConnRef.php:328
LIST_COMMA
const LIST_COMMA
Definition: Defines.php:42
$fname
if(defined( 'MW_SETUP_CALLBACK')) $fname
Customization point after all loading (constants, functions, classes, DefaultSettings,...
Definition: Setup.php:121
Wikimedia\Rdbms\DBConnRef\onTransactionCommitOrIdle
onTransactionCommitOrIdle(callable $callback, $fname=__METHOD__)
Run a callback as soon as there is no transaction pending.
Definition: DBConnRef.php:505
$name
Allows to change the fields on the form that will be generated $name
Definition: hooks.txt:302
Wikimedia\Rdbms\DBConnRef\restoreFlags
restoreFlags( $state=self::RESTORE_PRIOR)
Restore the flags to their prior state before the last setFlag/clearFlag call.
Definition: DBConnRef.php:152
Wikimedia\Rdbms\DBConnRef\lastQuery
lastQuery()
Return the last query that went through IDatabase::query()
Definition: DBConnRef.php:104
Wikimedia\Rdbms\DBConnRef\getServerUptime
getServerUptime()
Determines how long the server has been up.
Definition: DBConnRef.php:461
Wikimedia\Rdbms\DBConnRef\getDBname
getDBname()
Get the current DB name.
Definition: DBConnRef.php:383
Wikimedia\Rdbms\DBConnRef\pendingWriteRowsAffected
pendingWriteRowsAffected()
Get the number of affected rows from pending write queries.
Definition: DBConnRef.php:136
Wikimedia\Rdbms\DBConnRef\decodeBlob
decodeBlob( $b)
Some DBMSs return a special placeholder object representing blob fields in result objects.
Definition: DBConnRef.php:587
Wikimedia\Rdbms\DBConnRef\lastDoneWrites
lastDoneWrites()
Returns the last time the connection may have been used for write queries.
Definition: DBConnRef.php:112
Wikimedia\Rdbms\DBConnRef\FLD_GROUP
const FLD_GROUP
Definition: DBConnRef.php:24
$value
$value
Definition: styleTest.css.php:49
Wikimedia\Rdbms\DBConnRef\trxTimestamp
trxTimestamp()
Get the UNIX timestamp of the time that the transaction was established.
Definition: DBConnRef.php:64
Wikimedia\Rdbms\DBConnRef\unionConditionPermutations
unionConditionPermutations( $table, $vars, array $permute_conds, $extra_conds='', $fname=__METHOD__, $options=[], $join_conds=[])
Construct a UNION query for permutations of conditions.
Definition: DBConnRef.php:446
Wikimedia\Rdbms\DBConnRef\trxLevel
trxLevel()
Gets the current transaction level.
Definition: DBConnRef.php:60
Wikimedia\Rdbms\DBConnRef\getSoftwareLink
getSoftwareLink()
Returns a wikitext link to the DB's website, e.g., return "[https://www.mysql.com/ MySQL]"; Should at...
Definition: DBConnRef.php:225
Wikimedia\Rdbms\DBConnRef\FLD_INDEX
const FLD_INDEX
Definition: DBConnRef.php:23
Wikimedia\Rdbms\DBConnRef\addQuotes
addQuotes( $s)
Adds quotes and backslashes.
Definition: DBConnRef.php:391
Wikimedia\Rdbms\AtomicSectionIdentifier
Class used for token representing identifiers for atomic sections from IDatabase instances.
Definition: AtomicSectionIdentifier.php:26
Wikimedia\Rdbms\DBConnRef\timestamp
timestamp( $ts=0)
Convert a timestamp in one of the formats accepted by wfTimestamp() to the format used for inserting ...
Definition: DBConnRef.php:557
Wikimedia\Rdbms\DBConnRef\wasReadOnlyError
wasReadOnlyError()
Determines if the last failure was due to the database being read-only.
Definition: DBConnRef.php:477
Wikimedia\Rdbms\DBConnRef\encodeBlob
encodeBlob( $b)
Some DBMSs have a special format for inserting into blob fields, they don't allow simple quoted strin...
Definition: DBConnRef.php:583
Wikimedia\Rdbms\DBConnRef\onTransactionResolution
onTransactionResolution(callable $callback, $fname=__METHOD__)
Run a callback as soon as the current transaction commits or rolls back.
Definition: DBConnRef.php:501
Wikimedia\Rdbms\DBConnRef\freeResult
freeResult( $res)
Free a result object returned by query() or select().
Definition: DBConnRef.php:241
Wikimedia\Rdbms\DBConnRef\buildConcat
buildConcat( $stringList)
Build a concatenation list to feed into a SQL query.
Definition: DBConnRef.php:340
Wikimedia\Rdbms\DBConnRef\selectField
selectField( $table, $var, $cond='', $fname=__METHOD__, $options=[], $join_conds=[])
A SELECT wrapper which returns a single field from a single result row.
Definition: DBConnRef.php:245
Wikimedia\Rdbms\DBConnRef\makeWhereFrom2d
makeWhereFrom2d( $data, $baseKey, $subKey)
Build a partial where clause from a 2-d array such as used for LinkBatch.
Definition: DBConnRef.php:320
Wikimedia\Rdbms\DBConnRef\close
close()
Close the database connection.
Definition: DBConnRef.php:233
Wikimedia\Rdbms\DBConnRef\setTransactionListener
setTransactionListener( $name, callable $callback=null)
Run a callback after each time any transaction commits or rolls back.
Definition: DBConnRef.php:517
Wikimedia\Rdbms\DBConnRef\lockForUpdate
lockForUpdate( $table, $conds='', $fname=__METHOD__, $options=[], $join_conds=[])
Lock all rows meeting the given conditions/options FOR UPDATE.
Definition: DBConnRef.php:290
Wikimedia\Rdbms\DBConnRef\bitOr
bitOr( $fieldLeft, $fieldRight)
Definition: DBConnRef.php:336
Wikimedia\Rdbms\DBConnRef\setBigSelects
setBigSelects( $value=true)
Allow or deny "big selects" for this session only.
Definition: DBConnRef.php:631
Wikimedia\Rdbms\DBUnexpectedError
Definition: DBUnexpectedError.php:27
Wikimedia\Rdbms\DBConnRef\numRows
numRows( $res)
Get the number of rows in a query result.
Definition: DBConnRef.php:193
Wikimedia\Rdbms\DBConnRef\update
update( $table, $values, $conds, $fname=__METHOD__, $options=[])
UPDATE wrapper.
Definition: DBConnRef.php:312
Wikimedia\Rdbms\DBConnRef\dbSchema
dbSchema( $schema=null)
Get/set the db schema.
Definition: DBConnRef.php:80
Wikimedia\Rdbms\DBConnRef
Helper class to handle automatically marking connections as reusable (via RAII pattern) as well handl...
Definition: DBConnRef.php:15
Wikimedia\Rdbms\DBConnRef\getReplicaPos
getReplicaPos()
Get the replication position of this replica DB.
Definition: DBConnRef.php:489
Wikimedia\Rdbms\DBConnRef\setIndexAliases
setIndexAliases(array $aliases)
Convert certain index names to alternative names before querying the DB.
Definition: DBConnRef.php:643
$rows
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
Definition: hooks.txt:2675
$options
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
Definition: hooks.txt:2036
Wikimedia\Rdbms\DBConnRef\query
query( $sql, $fname=__METHOD__, $tempIgnore=false)
Run an SQL query and return the result.
Definition: DBConnRef.php:237
Wikimedia\Rdbms\DBConnRef\ping
ping(&$rtt=null)
Ping the server and try to reconnect if it there is no connection.
Definition: DBConnRef.php:565
Wikimedia\Rdbms\DBConnRef\masterPosWait
masterPosWait(DBMasterPos $pos, $timeout)
Wait for the replica DB to catch up to a given master position.
Definition: DBConnRef.php:485
Wikimedia\Rdbms\DBConnRef\deleteJoin
deleteJoin( $delTable, $joinTable, $delVar, $joinVar, $conds, $fname=__METHOD__)
DELETE where the condition is a join.
Definition: DBConnRef.php:421
Wikimedia\Rdbms\DBConnRef\unionQueries
unionQueries( $sqls, $all)
Construct a UNION query This is used for providing overload point for other DB abstractions not compa...
Definition: DBConnRef.php:442
Wikimedia\Rdbms\DBConnRef\setLBInfo
setLBInfo( $name, $value=null)
Set the LB info array, or a member of it.
Definition: DBConnRef.php:88
Wikimedia\Rdbms\DBConnRef\onTransactionPreCommitOrIdle
onTransactionPreCommitOrIdle(callable $callback, $fname=__METHOD__)
Run a callback before the current transaction commits or now if there is none.
Definition: DBConnRef.php:513
Wikimedia\Rdbms\DBConnRef\insertId
insertId()
Get the inserted value of an auto-increment row.
Definition: DBConnRef.php:205
Wikimedia\Rdbms\DBConnRef\doneWrites
doneWrites()
Returns true if the connection may have been used for write queries.
Definition: DBConnRef.php:108
Wikimedia\Rdbms\DBConnRef\isReadOnly
isReadOnly()
Definition: DBConnRef.php:635
Wikimedia\Rdbms\DBConnRef\getMasterPos
getMasterPos()
Get the position of this master.
Definition: DBConnRef.php:493
Wikimedia\Rdbms\DBConnRef\databasesAreIndependent
databasesAreIndependent()
Returns true if DBs are assumed to be on potentially different servers.
Definition: DBConnRef.php:369
Wikimedia\Rdbms\DBConnRef\wasConnectionLoss
wasConnectionLoss()
Determines if the last query error was due to a dropped connection.
Definition: DBConnRef.php:473
Wikimedia\Rdbms\DBConnRef\FLD_DOMAIN
const FLD_DOMAIN
Definition: DBConnRef.php:25
class
you have access to all of the normal MediaWiki so you can get a DB use the etc For full docs on the Maintenance class
Definition: maintenance.txt:52
Wikimedia\Rdbms\DBConnRef\numFields
numFields( $res)
Get the number of fields in a result object.
Definition: DBConnRef.php:197
Wikimedia\Rdbms\DBConnRef\flushSnapshot
flushSnapshot( $fname=__METHOD__)
Commit any transaction but error out if writes or callbacks are pending.
Definition: DBConnRef.php:553
Wikimedia\Rdbms\DatabaseDomain
Class to handle database/prefix specification for IDatabase domains.
Definition: DatabaseDomain.php:28
Wikimedia\Rdbms\DBConnRef\__construct
__construct(ILoadBalancer $lb, $conn)
Definition: DBConnRef.php:32
Wikimedia\Rdbms\DBConnRef\clearFlag
clearFlag( $flag, $remember=self::REMEMBER_NOTHING)
Clear a flag for this connection.
Definition: DBConnRef.php:148
Wikimedia\Rdbms\DBConnRef\commit
commit( $fname=__METHOD__, $flush='')
Commits a transaction previously started using begin().
Definition: DBConnRef.php:545
Wikimedia\Rdbms\DBConnRef\lockIsFree
lockIsFree( $lockName, $method)
Check to see if a named lock is not locked by any thread (non-blocking)
Definition: DBConnRef.php:599
Wikimedia\Rdbms\DBConnRef\onTransactionIdle
onTransactionIdle(callable $callback, $fname=__METHOD__)
Alias for onTransactionCommitOrIdle() for backwards-compatibility.
Definition: DBConnRef.php:509
Wikimedia\Rdbms\DBConnRef\fetchRow
fetchRow( $res)
Fetch the next row from the given result object, in associative array form.
Definition: DBConnRef.php:189
Wikimedia\Rdbms\DBConnRef\lastErrno
lastErrno()
Get the last error number.
Definition: DBConnRef.php:213
Wikimedia\Rdbms\DBConnRef\namedLocksEnqueue
namedLocksEnqueue()
Check to see if a named lock used by lock() use blocking queues.
Definition: DBConnRef.php:615
Wikimedia\Rdbms\DBConnRef\getServerVersion
getServerVersion()
A string describing the current software version, like from mysql_get_server_info().
Definition: DBConnRef.php:229
Wikimedia\Rdbms\DBConnRef\begin
begin( $fname=__METHOD__, $mode=IDatabase::TRANSACTION_EXPLICIT)
Begin a transaction.
Definition: DBConnRef.php:541
Wikimedia\Rdbms\DBConnRef\wasErrorReissuable
wasErrorReissuable()
Determines if the last query error was due to something outside of the query itself.
Definition: DBConnRef.php:481
Wikimedia\Rdbms\ILoadBalancer
Database cluster connection, tracking, load balancing, and transaction manager interface.
Definition: ILoadBalancer.php:78
Wikimedia\Rdbms\DBConnRef\bitAnd
bitAnd( $fieldLeft, $fieldRight)
Definition: DBConnRef.php:332
Wikimedia\Rdbms\DBConnRef\__call
__call( $name, array $arguments)
Definition: DBConnRef.php:43
$buffer
$buffer
Definition: mwdoc-filter.php:49
Wikimedia\Rdbms\DBConnRef\aggregateValue
aggregateValue( $valuedata, $valuename='value')
Return aggregated value alias.
Definition: DBConnRef.php:324
$type
$type
Definition: testCompression.php:48
Wikimedia\Rdbms\DBConnRef\cancelAtomic
cancelAtomic( $fname=__METHOD__, AtomicSectionIdentifier $sectionId=null)
Cancel an atomic section of SQL statements.
Definition: DBConnRef.php:531