MediaWiki  1.33.0
DatabaseOracle.php
Go to the documentation of this file.
1 <?php
32 
36 class DatabaseOracle extends Database {
38  protected $mLastResult = null;
39 
41  protected $mAffectedRows;
42 
44  private $ignoreDupValOnIndex = false;
45 
47  private $sequenceData = null;
48 
50  private $defaultCharset = 'AL32UTF8';
51 
53  private $mFieldInfoCache = [];
54 
55  function __construct( array $p ) {
56  $p['tablePrefix'] = strtoupper( $p['tablePrefix'] );
57  parent::__construct( $p );
58  Hooks::run( 'DatabaseOraclePostInit', [ $this ] );
59  }
60 
61  function __destruct() {
62  if ( $this->opened ) {
63  Wikimedia\suppressWarnings();
64  $this->close();
65  Wikimedia\restoreWarnings();
66  }
67  }
68 
69  function getType() {
70  return 'oracle';
71  }
72 
73  function implicitGroupby() {
74  return false;
75  }
76 
77  function implicitOrderby() {
78  return false;
79  }
80 
81  protected function open( $server, $user, $password, $dbName, $schema, $tablePrefix ) {
82  global $wgDBOracleDRCP;
83 
84  if ( !function_exists( 'oci_connect' ) ) {
85  throw new DBConnectionError(
86  $this,
87  "Oracle functions missing, have you compiled PHP with the --with-oci8 option?\n " .
88  "(Note: if you recently installed PHP, you may need to restart your webserver\n " .
89  "and database)\n" );
90  }
91 
92  $this->close();
93  $this->user = $user;
94  $this->password = $password;
95  if ( !$server ) {
96  // Backward compatibility (server used to be null and TNS was supplied in dbname)
97  $this->server = $dbName;
98  $realDatabase = $user;
99  } else {
100  // $server now holds the TNS endpoint
101  $this->server = $server;
102  // $dbName is schema name if different from username
103  $realDatabase = $dbName ?: $user;
104  }
105 
106  if ( !strlen( $user ) ) { # e.g. the class is being loaded
107  return null;
108  }
109 
110  if ( $wgDBOracleDRCP ) {
111  $this->setFlag( DBO_PERSISTENT );
112  }
113 
114  $session_mode = ( $this->flags & DBO_SYSDBA ) ? OCI_SYSDBA : OCI_DEFAULT;
115 
116  Wikimedia\suppressWarnings();
117  if ( $this->flags & DBO_PERSISTENT ) {
118  $this->conn = oci_pconnect(
119  $this->user,
120  $this->password,
121  $this->server,
122  $this->defaultCharset,
123  $session_mode
124  );
125  } elseif ( $this->flags & DBO_DEFAULT ) {
126  $this->conn = oci_new_connect(
127  $this->user,
128  $this->password,
129  $this->server,
130  $this->defaultCharset,
131  $session_mode
132  );
133  } else {
134  $this->conn = oci_connect(
135  $this->user,
136  $this->password,
137  $this->server,
138  $this->defaultCharset,
139  $session_mode
140  );
141  }
142  Wikimedia\restoreWarnings();
143 
144  if ( $this->user != $realDatabase ) {
145  // change current schema in session
146  $this->selectDB( $realDatabase );
147  } else {
148  $this->currentDomain = new DatabaseDomain(
149  $realDatabase,
150  null,
151  $tablePrefix
152  );
153  }
154 
155  if ( !$this->conn ) {
156  throw new DBConnectionError( $this, $this->lastError() );
157  }
158 
159  $this->opened = true;
160 
161  # removed putenv calls because they interfere with the system globaly
162  $this->doQuery( 'ALTER SESSION SET NLS_TIMESTAMP_FORMAT=\'DD-MM-YYYY HH24:MI:SS.FF6\'' );
163  $this->doQuery( 'ALTER SESSION SET NLS_TIMESTAMP_TZ_FORMAT=\'DD-MM-YYYY HH24:MI:SS.FF6\'' );
164  $this->doQuery( 'ALTER SESSION SET NLS_NUMERIC_CHARACTERS=\'.,\'' );
165 
166  return (bool)$this->conn;
167  }
168 
174  protected function closeConnection() {
175  return oci_close( $this->conn );
176  }
177 
178  function execFlags() {
179  return $this->trxLevel ? OCI_NO_AUTO_COMMIT : OCI_COMMIT_ON_SUCCESS;
180  }
181 
186  protected function doQuery( $sql ) {
187  wfDebug( "SQL: [$sql]\n" );
188  if ( !StringUtils::isUtf8( $sql ) ) {
189  throw new InvalidArgumentException( "SQL encoding is invalid\n$sql" );
190  }
191 
192  // handle some oracle specifics
193  // remove AS column/table/subquery namings
194  if ( !$this->getFlag( DBO_DDLMODE ) ) {
195  $sql = preg_replace( '/ as /i', ' ', $sql );
196  }
197 
198  // Oracle has issues with UNION clause if the statement includes LOB fields
199  // So we do a UNION ALL and then filter the results array with array_unique
200  $union_unique = ( preg_match( '/\/\* UNION_UNIQUE \*\/ /', $sql ) != 0 );
201  // EXPLAIN syntax in Oracle is EXPLAIN PLAN FOR and it return nothing
202  // you have to select data from plan table after explain
203  $explain_id = MWTimestamp::getLocalInstance()->format( 'dmYHis' );
204 
205  $sql = preg_replace(
206  '/^EXPLAIN /',
207  'EXPLAIN PLAN SET STATEMENT_ID = \'' . $explain_id . '\' FOR',
208  $sql,
209  1,
210  $explain_count
211  );
212 
213  Wikimedia\suppressWarnings();
214 
215  $this->mLastResult = $stmt = oci_parse( $this->conn, $sql );
216  if ( $stmt === false ) {
217  $e = oci_error( $this->conn );
218  $this->reportQueryError( $e['message'], $e['code'], $sql, __METHOD__ );
219 
220  return false;
221  }
222 
223  if ( !oci_execute( $stmt, $this->execFlags() ) ) {
224  $e = oci_error( $stmt );
225  if ( !$this->ignoreDupValOnIndex || $e['code'] != '1' ) {
226  $this->reportQueryError( $e['message'], $e['code'], $sql, __METHOD__ );
227 
228  return false;
229  }
230  }
231 
232  Wikimedia\restoreWarnings();
233 
234  if ( $explain_count > 0 ) {
235  return $this->doQuery( 'SELECT id, cardinality "ROWS" FROM plan_table ' .
236  'WHERE statement_id = \'' . $explain_id . '\'' );
237  } elseif ( oci_statement_type( $stmt ) == 'SELECT' ) {
238  return new ORAResult( $this, $stmt, $union_unique );
239  } else {
240  $this->mAffectedRows = oci_num_rows( $stmt );
241 
242  return true;
243  }
244  }
245 
246  function queryIgnore( $sql, $fname = '' ) {
247  return $this->query( $sql, $fname, true );
248  }
249 
254  function freeResult( $res ) {
255  if ( $res instanceof ResultWrapper ) {
256  $res = $res->result;
257  }
258 
259  $res->free();
260  }
261 
266  function fetchObject( $res ) {
267  if ( $res instanceof ResultWrapper ) {
268  $res = $res->result;
269  }
270 
271  return $res->fetchObject();
272  }
273 
278  function fetchRow( $res ) {
279  if ( $res instanceof ResultWrapper ) {
280  $res = $res->result;
281  }
282 
283  return $res->fetchRow();
284  }
285 
290  function numRows( $res ) {
291  if ( $res instanceof ResultWrapper ) {
292  $res = $res->result;
293  }
294 
295  return $res->numRows();
296  }
297 
302  function numFields( $res ) {
303  if ( $res instanceof ResultWrapper ) {
304  $res = $res->result;
305  }
306 
307  return $res->numFields();
308  }
309 
310  function fieldName( $stmt, $n ) {
311  return oci_field_name( $stmt, $n );
312  }
313 
314  function insertId() {
315  $res = $this->query( "SELECT lastval_pkg.getLastval FROM dual" );
316  $row = $this->fetchRow( $res );
317  return is_null( $row[0] ) ? null : (int)$row[0];
318  }
319 
324  function dataSeek( $res, $row ) {
325  if ( $res instanceof ORAResult ) {
326  $res->seek( $row );
327  } else {
328  $res->result->seek( $row );
329  }
330  }
331 
332  function lastError() {
333  if ( $this->conn === false ) {
334  $e = oci_error();
335  } else {
336  $e = oci_error( $this->conn );
337  }
338 
339  return $e['message'];
340  }
341 
342  function lastErrno() {
343  if ( $this->conn === false ) {
344  $e = oci_error();
345  } else {
346  $e = oci_error( $this->conn );
347  }
348 
349  return $e['code'];
350  }
351 
352  protected function fetchAffectedRowCount() {
353  return $this->mAffectedRows;
354  }
355 
364  function indexInfo( $table, $index, $fname = __METHOD__ ) {
365  return false;
366  }
367 
368  function indexUnique( $table, $index, $fname = __METHOD__ ) {
369  return false;
370  }
371 
372  function insert( $table, $a, $fname = __METHOD__, $options = [] ) {
373  if ( !count( $a ) ) {
374  return true;
375  }
376 
377  if ( !is_array( $options ) ) {
378  $options = [ $options ];
379  }
380 
381  if ( in_array( 'IGNORE', $options ) ) {
382  $this->ignoreDupValOnIndex = true;
383  }
384 
385  if ( !is_array( reset( $a ) ) ) {
386  $a = [ $a ];
387  }
388 
389  foreach ( $a as &$row ) {
390  $this->insertOneRow( $table, $row, $fname );
391  }
392 
393  if ( in_array( 'IGNORE', $options ) ) {
394  $this->ignoreDupValOnIndex = false;
395  }
396 
397  return true;
398  }
399 
400  private function fieldBindStatement( $table, $col, &$val, $includeCol = false ) {
401  $col_info = $this->fieldInfoMulti( $table, $col );
402  $col_type = $col_info != false ? $col_info->type() : 'CONSTANT';
403 
404  $bind = '';
405  if ( is_numeric( $col ) ) {
406  $bind = $val;
407  $val = null;
408 
409  return $bind;
410  } elseif ( $includeCol ) {
411  $bind = "$col = ";
412  }
413 
414  if ( $val == '' && $val !== 0 && $col_type != 'BLOB' && $col_type != 'CLOB' ) {
415  $val = null;
416  }
417 
418  if ( $val === 'NULL' ) {
419  $val = null;
420  }
421 
422  if ( $val === null ) {
423  if ( $col_info != false && $col_info->isNullable() == 0 && $col_info->defaultValue() != null ) {
424  $bind .= 'DEFAULT';
425  } else {
426  $bind .= 'NULL';
427  }
428  } else {
429  $bind .= ':' . $col;
430  }
431 
432  return $bind;
433  }
434 
442  private function insertOneRow( $table, $row, $fname ) {
443  $table = $this->tableName( $table );
444  // "INSERT INTO tables (a, b, c)"
445  $sql = "INSERT INTO " . $table . " (" . implode( ',', array_keys( $row ) ) . ')';
446  $sql .= " VALUES (";
447 
448  // for each value, append ":key"
449  $first = true;
450  foreach ( $row as $col => &$val ) {
451  if ( !$first ) {
452  $sql .= ', ';
453  } else {
454  $first = false;
455  }
456  if ( $this->isQuotedIdentifier( $val ) ) {
457  $sql .= $this->removeIdentifierQuotes( $val );
458  unset( $row[$col] );
459  } else {
460  $sql .= $this->fieldBindStatement( $table, $col, $val );
461  }
462  }
463  $sql .= ')';
464 
465  $this->mLastResult = $stmt = oci_parse( $this->conn, $sql );
466  if ( $stmt === false ) {
467  $e = oci_error( $this->conn );
468  $this->reportQueryError( $e['message'], $e['code'], $sql, __METHOD__ );
469 
470  return false;
471  }
472  foreach ( $row as $col => &$val ) {
473  $col_info = $this->fieldInfoMulti( $table, $col );
474  $col_type = $col_info != false ? $col_info->type() : 'CONSTANT';
475 
476  if ( $val === null ) {
477  // do nothing ... null was inserted in statement creation
478  } elseif ( $col_type != 'BLOB' && $col_type != 'CLOB' ) {
479  if ( is_object( $val ) ) {
480  $val = $val->fetch();
481  }
482 
483  // backward compatibility
484  if ( preg_match( '/^timestamp.*/i', $col_type ) == 1 && strtolower( $val ) == 'infinity' ) {
485  $val = $this->getInfinity();
486  }
487 
488  $val = MediaWikiServices::getInstance()->getContentLanguage()->
489  checkTitleEncoding( $val );
490  if ( oci_bind_by_name( $stmt, ":$col", $val, -1, SQLT_CHR ) === false ) {
491  $e = oci_error( $stmt );
492  $this->reportQueryError( $e['message'], $e['code'], $sql, __METHOD__ );
493 
494  return false;
495  }
496  } else {
498  $lob[$col] = oci_new_descriptor( $this->conn, OCI_D_LOB );
499  if ( $lob[$col] === false ) {
500  $e = oci_error( $stmt );
501  throw new DBUnexpectedError( $this, "Cannot create LOB descriptor: " . $e['message'] );
502  }
503 
504  if ( is_object( $val ) ) {
505  $val = $val->fetch();
506  }
507 
508  if ( $col_type == 'BLOB' ) {
509  $lob[$col]->writeTemporary( $val, OCI_TEMP_BLOB );
510  oci_bind_by_name( $stmt, ":$col", $lob[$col], -1, OCI_B_BLOB );
511  } else {
512  $lob[$col]->writeTemporary( $val, OCI_TEMP_CLOB );
513  oci_bind_by_name( $stmt, ":$col", $lob[$col], -1, OCI_B_CLOB );
514  }
515  }
516  }
517 
518  Wikimedia\suppressWarnings();
519 
520  if ( oci_execute( $stmt, $this->execFlags() ) === false ) {
521  $e = oci_error( $stmt );
522  if ( !$this->ignoreDupValOnIndex || $e['code'] != '1' ) {
523  $this->reportQueryError( $e['message'], $e['code'], $sql, __METHOD__ );
524 
525  return false;
526  } else {
527  $this->mAffectedRows = oci_num_rows( $stmt );
528  }
529  } else {
530  $this->mAffectedRows = oci_num_rows( $stmt );
531  }
532 
533  Wikimedia\restoreWarnings();
534 
535  if ( isset( $lob ) ) {
536  foreach ( $lob as $lob_v ) {
537  $lob_v->free();
538  }
539  }
540 
541  if ( !$this->trxLevel ) {
542  oci_commit( $this->conn );
543  }
544 
545  return oci_free_statement( $stmt );
546  }
547 
548  function nativeInsertSelect( $destTable, $srcTable, $varMap, $conds, $fname = __METHOD__,
549  $insertOptions = [], $selectOptions = [], $selectJoinConds = []
550  ) {
551  $destTable = $this->tableName( $destTable );
552 
553  $sequenceData = $this->getSequenceData( $destTable );
554  if ( $sequenceData !== false &&
555  !isset( $varMap[$sequenceData['column']] )
556  ) {
557  $varMap[$sequenceData['column']] = 'GET_SEQUENCE_VALUE(\'' . $sequenceData['sequence'] . '\')';
558  }
559 
560  // count-alias subselect fields to avoid abigious definition errors
561  $i = 0;
562  foreach ( $varMap as &$val ) {
563  $val .= ' field' . $i;
564  $i++;
565  }
566 
567  $selectSql = $this->selectSQLText(
568  $srcTable,
569  array_values( $varMap ),
570  $conds,
571  $fname,
572  $selectOptions,
573  $selectJoinConds
574  );
575 
576  $sql = "INSERT INTO $destTable (" . implode( ',', array_keys( $varMap ) ) . ') ' . $selectSql;
577 
578  if ( in_array( 'IGNORE', $insertOptions ) ) {
579  $this->ignoreDupValOnIndex = true;
580  }
581 
582  $this->query( $sql, $fname );
583 
584  if ( in_array( 'IGNORE', $insertOptions ) ) {
585  $this->ignoreDupValOnIndex = false;
586  }
587  }
588 
589  public function upsert( $table, array $rows, $uniqueIndexes, array $set,
590  $fname = __METHOD__
591  ) {
592  if ( $rows === [] ) {
593  return true; // nothing to do
594  }
595 
596  if ( !is_array( reset( $rows ) ) ) {
597  $rows = [ $rows ];
598  }
599 
600  $sequenceData = $this->getSequenceData( $table );
601  if ( $sequenceData !== false ) {
602  // add sequence column to each list of columns, when not set
603  foreach ( $rows as &$row ) {
604  if ( !isset( $row[$sequenceData['column']] ) ) {
605  $row[$sequenceData['column']] =
606  $this->addIdentifierQuotes( 'GET_SEQUENCE_VALUE(\'' .
607  $sequenceData['sequence'] . '\')' );
608  }
609  }
610  }
611 
612  return parent::upsert( $table, $rows, $uniqueIndexes, $set, $fname );
613  }
614 
615  function tableName( $name, $format = 'quoted' ) {
616  /*
617  Replace reserved words with better ones
618  Using uppercase because that's the only way Oracle can handle
619  quoted tablenames
620  */
621  switch ( $name ) {
622  case 'user':
623  $name = 'MWUSER';
624  break;
625  case 'text':
626  $name = 'PAGECONTENT';
627  break;
628  }
629 
630  return strtoupper( parent::tableName( $name, $format ) );
631  }
632 
633  function tableNameInternal( $name ) {
634  $name = $this->tableName( $name );
635 
636  return preg_replace( '/.*\.(.*)/', '$1', $name );
637  }
638 
645  private function getSequenceData( $table ) {
646  if ( $this->sequenceData == null ) {
647  $result = $this->doQuery( "SELECT lower(asq.sequence_name),
648  lower(atc.table_name),
649  lower(atc.column_name)
650  FROM all_sequences asq, all_tab_columns atc
651  WHERE decode(
652  atc.table_name,
653  '{$this->tablePrefix}MWUSER',
654  '{$this->tablePrefix}USER',
655  atc.table_name
656  ) || '_' ||
657  atc.column_name || '_SEQ' = '{$this->tablePrefix}' || asq.sequence_name
658  AND asq.sequence_owner = upper('{$this->getDBname()}')
659  AND atc.owner = upper('{$this->getDBname()}')" );
660 
661  while ( ( $row = $result->fetchRow() ) !== false ) {
662  $this->sequenceData[$row[1]] = [
663  'sequence' => $row[0],
664  'column' => $row[2]
665  ];
666  }
667  }
668  $table = strtolower( $this->removeIdentifierQuotes( $this->tableName( $table ) ) );
669 
670  return $this->sequenceData[$table] ?? false;
671  }
672 
680  function textFieldSize( $table, $field ) {
681  $fieldInfoData = $this->fieldInfo( $table, $field );
682 
683  return $fieldInfoData->maxLength();
684  }
685 
686  function limitResult( $sql, $limit, $offset = false ) {
687  if ( $offset === false ) {
688  $offset = 0;
689  }
690 
691  return "SELECT * FROM ($sql) WHERE rownum >= (1 + $offset) AND rownum < (1 + $limit + $offset)";
692  }
693 
694  function encodeBlob( $b ) {
695  return new Blob( $b );
696  }
697 
698  function unionQueries( $sqls, $all ) {
699  $glue = ' UNION ALL ';
700 
701  return 'SELECT * ' . ( $all ? '' : '/* UNION_UNIQUE */ ' ) .
702  'FROM (' . implode( $glue, $sqls ) . ')';
703  }
704 
705  function wasDeadlock() {
706  return $this->lastErrno() == 'OCI-00060';
707  }
708 
709  function duplicateTableStructure( $oldName, $newName, $temporary = false,
710  $fname = __METHOD__
711  ) {
712  $temporary = $temporary ? 'TRUE' : 'FALSE';
713 
714  $newName = strtoupper( $newName );
715  $oldName = strtoupper( $oldName );
716 
717  $tabName = substr( $newName, strlen( $this->tablePrefix ) );
718  $oldPrefix = substr( $oldName, 0, strlen( $oldName ) - strlen( $tabName ) );
719  $newPrefix = strtoupper( $this->tablePrefix );
720 
721  return $this->doQuery( "BEGIN DUPLICATE_TABLE( '$tabName', " .
722  "'$oldPrefix', '$newPrefix', $temporary ); END;" );
723  }
724 
725  function listTables( $prefix = null, $fname = __METHOD__ ) {
726  $listWhere = '';
727  if ( !empty( $prefix ) ) {
728  $listWhere = ' AND table_name LIKE \'' . strtoupper( $prefix ) . '%\'';
729  }
730 
731  $owner = strtoupper( $this->getDBname() );
732  $result = $this->doQuery( "SELECT table_name FROM all_tables " .
733  "WHERE owner='$owner' AND table_name NOT LIKE '%!_IDX\$_' ESCAPE '!' $listWhere" );
734 
735  // dirty code ... i know
736  $endArray = [];
737  $endArray[] = strtoupper( $prefix . 'MWUSER' );
738  $endArray[] = strtoupper( $prefix . 'PAGE' );
739  $endArray[] = strtoupper( $prefix . 'IMAGE' );
740  $fixedOrderTabs = $endArray;
741  while ( ( $row = $result->fetchRow() ) !== false ) {
742  if ( !in_array( $row['table_name'], $fixedOrderTabs ) ) {
743  $endArray[] = $row['table_name'];
744  }
745  }
746 
747  return $endArray;
748  }
749 
750  public function dropTable( $tableName, $fName = __METHOD__ ) {
751  $tableName = $this->tableName( $tableName );
752  if ( !$this->tableExists( $tableName ) ) {
753  return false;
754  }
755 
756  return $this->doQuery( "DROP TABLE $tableName CASCADE CONSTRAINTS PURGE" );
757  }
758 
759  function timestamp( $ts = 0 ) {
760  return wfTimestamp( TS_ORACLE, $ts );
761  }
762 
770  public function aggregateValue( $valuedata, $valuename = 'value' ) {
771  return $valuedata;
772  }
773 
777  public function getSoftwareLink() {
778  return '[{{int:version-db-oracle-url}} Oracle]';
779  }
780 
784  function getServerVersion() {
785  // better version number, fallback on driver
786  $rset = $this->doQuery(
787  'SELECT version FROM product_component_version ' .
788  'WHERE UPPER(product) LIKE \'ORACLE DATABASE%\''
789  );
790  $row = $rset->fetchRow();
791  if ( !$row ) {
792  return oci_server_version( $this->conn );
793  }
794 
795  return $row['version'];
796  }
797 
805  function indexExists( $table, $index, $fname = __METHOD__ ) {
806  $table = $this->tableName( $table );
807  $table = strtoupper( $this->removeIdentifierQuotes( $table ) );
808  $index = strtoupper( $index );
809  $owner = strtoupper( $this->getDBname() );
810  $sql = "SELECT 1 FROM all_indexes WHERE owner='$owner' AND index_name='{$table}_{$index}'";
811  $res = $this->doQuery( $sql );
812  if ( $res ) {
813  $count = $res->numRows();
814  $res->free();
815  } else {
816  $count = 0;
817  }
818 
819  return $count != 0;
820  }
821 
828  function tableExists( $table, $fname = __METHOD__ ) {
829  $table = $this->tableName( $table );
830  $table = $this->addQuotes( strtoupper( $this->removeIdentifierQuotes( $table ) ) );
831  $owner = $this->addQuotes( strtoupper( $this->getDBname() ) );
832  $sql = "SELECT 1 FROM all_tables WHERE owner=$owner AND table_name=$table";
833  $res = $this->doQuery( $sql );
834  if ( $res && $res->numRows() > 0 ) {
835  $exists = true;
836  } else {
837  $exists = false;
838  }
839 
840  $res->free();
841 
842  return $exists;
843  }
844 
855  private function fieldInfoMulti( $table, $field ) {
856  $field = strtoupper( $field );
857  if ( is_array( $table ) ) {
858  $table = array_map( [ $this, 'tableNameInternal' ], $table );
859  $tableWhere = 'IN (';
860  foreach ( $table as &$singleTable ) {
861  $singleTable = $this->removeIdentifierQuotes( $singleTable );
862  if ( isset( $this->mFieldInfoCache["$singleTable.$field"] ) ) {
863  return $this->mFieldInfoCache["$singleTable.$field"];
864  }
865  $tableWhere .= '\'' . $singleTable . '\',';
866  }
867  $tableWhere = rtrim( $tableWhere, ',' ) . ')';
868  } else {
869  $table = $this->removeIdentifierQuotes( $this->tableNameInternal( $table ) );
870  if ( isset( $this->mFieldInfoCache["$table.$field"] ) ) {
871  return $this->mFieldInfoCache["$table.$field"];
872  }
873  $tableWhere = '= \'' . $table . '\'';
874  }
875 
876  $fieldInfoStmt = oci_parse(
877  $this->conn,
878  'SELECT * FROM wiki_field_info_full WHERE table_name ' .
879  $tableWhere . ' and column_name = \'' . $field . '\''
880  );
881  if ( oci_execute( $fieldInfoStmt, $this->execFlags() ) === false ) {
882  $e = oci_error( $fieldInfoStmt );
883  $this->reportQueryError( $e['message'], $e['code'], 'fieldInfo QUERY', __METHOD__ );
884 
885  return false;
886  }
887  $res = new ORAResult( $this, $fieldInfoStmt );
888  if ( $res->numRows() == 0 ) {
889  if ( is_array( $table ) ) {
890  foreach ( $table as &$singleTable ) {
891  $this->mFieldInfoCache["$singleTable.$field"] = false;
892  }
893  } else {
894  $this->mFieldInfoCache["$table.$field"] = false;
895  }
896  $fieldInfoTemp = null;
897  } else {
898  $fieldInfoTemp = new ORAField( $res->fetchRow() );
899  $table = $fieldInfoTemp->tableName();
900  $this->mFieldInfoCache["$table.$field"] = $fieldInfoTemp;
901  }
902  $res->free();
903 
904  return $fieldInfoTemp;
905  }
906 
913  function fieldInfo( $table, $field ) {
914  if ( is_array( $table ) ) {
915  throw new DBUnexpectedError( $this, 'DatabaseOracle::fieldInfo called with table array!' );
916  }
917 
918  return $this->fieldInfoMulti( $table, $field );
919  }
920 
921  protected function doBegin( $fname = __METHOD__ ) {
922  $this->trxLevel = 1;
923  $this->doQuery( 'SET CONSTRAINTS ALL DEFERRED' );
924  }
925 
926  protected function doCommit( $fname = __METHOD__ ) {
927  if ( $this->trxLevel ) {
928  $ret = oci_commit( $this->conn );
929  if ( !$ret ) {
930  throw new DBUnexpectedError( $this, $this->lastError() );
931  }
932  $this->trxLevel = 0;
933  $this->doQuery( 'SET CONSTRAINTS ALL IMMEDIATE' );
934  }
935  }
936 
937  protected function doRollback( $fname = __METHOD__ ) {
938  if ( $this->trxLevel ) {
939  oci_rollback( $this->conn );
940  $this->trxLevel = 0;
941  $this->doQuery( 'SET CONSTRAINTS ALL IMMEDIATE' );
942  }
943  }
944 
945  function sourceStream(
946  $fp,
947  callable $lineCallback = null,
948  callable $resultCallback = null,
949  $fname = __METHOD__, callable $inputCallback = null
950  ) {
951  $cmd = '';
952  $done = false;
953  $dollarquote = false;
954 
955  $replacements = [];
956  // Defines must comply with ^define\s*([^\s=]*)\s*=\s?'\{\$([^\}]*)\}';
957  while ( !feof( $fp ) ) {
958  if ( $lineCallback ) {
959  $lineCallback();
960  }
961  $line = trim( fgets( $fp, 1024 ) );
962  $sl = strlen( $line ) - 1;
963 
964  if ( $sl < 0 ) {
965  continue;
966  }
967  if ( $line[0] == '-' && $line[1] == '-' ) {
968  continue;
969  }
970 
971  // Allow dollar quoting for function declarations
972  if ( substr( $line, 0, 8 ) == '/*$mw$*/' ) {
973  if ( $dollarquote ) {
974  $dollarquote = false;
975  $line = str_replace( '/*$mw$*/', '', $line ); // remove dollarquotes
976  $done = true;
977  } else {
978  $dollarquote = true;
979  }
980  } elseif ( !$dollarquote ) {
981  if ( $line[$sl] == ';' && ( $sl < 2 || $line[$sl - 1] != ';' ) ) {
982  $done = true;
983  $line = substr( $line, 0, $sl );
984  }
985  }
986 
987  if ( $cmd != '' ) {
988  $cmd .= ' ';
989  }
990  $cmd .= "$line\n";
991 
992  if ( $done ) {
993  $cmd = str_replace( ';;', ";", $cmd );
994  if ( strtolower( substr( $cmd, 0, 6 ) ) == 'define' ) {
995  if ( preg_match( '/^define\s*([^\s=]*)\s*=\s*\'\{\$([^\}]*)\}\'/', $cmd, $defines ) ) {
996  $replacements[$defines[2]] = $defines[1];
997  }
998  } else {
999  foreach ( $replacements as $mwVar => $scVar ) {
1000  $cmd = str_replace( '&' . $scVar . '.', '`{$' . $mwVar . '}`', $cmd );
1001  }
1002 
1003  $cmd = $this->replaceVars( $cmd );
1004  if ( $inputCallback ) {
1005  $inputCallback( $cmd );
1006  }
1007  $res = $this->doQuery( $cmd );
1008  if ( $resultCallback ) {
1009  call_user_func( $resultCallback, $res, $this );
1010  }
1011 
1012  if ( $res === false ) {
1013  $err = $this->lastError();
1014 
1015  return "Query \"{$cmd}\" failed with error code \"$err\".\n";
1016  }
1017  }
1018 
1019  $cmd = '';
1020  $done = false;
1021  }
1022  }
1023 
1024  return true;
1025  }
1026 
1027  protected function doSelectDomain( DatabaseDomain $domain ) {
1028  if ( $domain->getSchema() !== null ) {
1029  // We use the *database* aspect of $domain for schema, not the domain schema
1030  throw new DBExpectedError( $this, __CLASS__ . ": domain schemas are not supported." );
1031  }
1032 
1033  $database = $domain->getDatabase();
1034  if ( $database === null || $database === $this->user ) {
1035  // Backward compatibility
1036  $this->currentDomain = $domain;
1037 
1038  return true;
1039  }
1040 
1041  // https://docs.oracle.com/javadb/10.8.3.0/ref/rrefsqlj32268.html
1042  $encDatabase = $this->addIdentifierQuotes( strtoupper( $database ) );
1043  $sql = "ALTER SESSION SET CURRENT_SCHEMA=$encDatabase";
1044  $stmt = oci_parse( $this->conn, $sql );
1045  Wikimedia\suppressWarnings();
1046  $success = oci_execute( $stmt );
1047  Wikimedia\restoreWarnings();
1048  if ( $success ) {
1049  // Update that domain fields on success (no exception thrown)
1050  $this->currentDomain = $domain;
1051  } else {
1052  $e = oci_error( $stmt );
1053  $this->reportQueryError( $e['message'], $e['code'], $sql, __METHOD__ );
1054  }
1055 
1056  return true;
1057  }
1058 
1059  function strencode( $s ) {
1060  return str_replace( "'", "''", $s );
1061  }
1062 
1063  function addQuotes( $s ) {
1064  $contLang = MediaWikiServices::getInstance()->getContentLanguage();
1065  if ( isset( $contLang->mLoaded ) && $contLang->mLoaded ) {
1066  $s = $contLang->checkTitleEncoding( $s );
1067  }
1068 
1069  return "'" . $this->strencode( $s ) . "'";
1070  }
1071 
1072  public function addIdentifierQuotes( $s ) {
1073  if ( !$this->getFlag( DBO_DDLMODE ) ) {
1074  $s = '/*Q*/' . $s;
1075  }
1076 
1077  return $s;
1078  }
1079 
1080  public function removeIdentifierQuotes( $s ) {
1081  return strpos( $s, '/*Q*/' ) === false ? $s : substr( $s, 5 );
1082  }
1083 
1084  public function isQuotedIdentifier( $s ) {
1085  return strpos( $s, '/*Q*/' ) !== false;
1086  }
1087 
1088  private function wrapFieldForWhere( $table, &$col, &$val ) {
1089  $col_info = $this->fieldInfoMulti( $table, $col );
1090  $col_type = $col_info != false ? $col_info->type() : 'CONSTANT';
1091  if ( $col_type == 'CLOB' ) {
1092  $col = 'TO_CHAR(' . $col . ')';
1093  $val =
1094  MediaWikiServices::getInstance()->getContentLanguage()->checkTitleEncoding( $val );
1095  } elseif ( $col_type == 'VARCHAR2' ) {
1096  $val =
1097  MediaWikiServices::getInstance()->getContentLanguage()->checkTitleEncoding( $val );
1098  }
1099  }
1100 
1101  private function wrapConditionsForWhere( $table, $conds, $parentCol = null ) {
1102  $conds2 = [];
1103  foreach ( $conds as $col => $val ) {
1104  if ( is_array( $val ) ) {
1105  $conds2[$col] = $this->wrapConditionsForWhere( $table, $val, $col );
1106  } else {
1107  if ( is_numeric( $col ) && $parentCol != null ) {
1108  $this->wrapFieldForWhere( $table, $parentCol, $val );
1109  } else {
1110  $this->wrapFieldForWhere( $table, $col, $val );
1111  }
1112  $conds2[$col] = $val;
1113  }
1114  }
1115 
1116  return $conds2;
1117  }
1118 
1119  function selectRow( $table, $vars, $conds, $fname = __METHOD__,
1120  $options = [], $join_conds = []
1121  ) {
1122  if ( is_array( $conds ) ) {
1123  $conds = $this->wrapConditionsForWhere( $table, $conds );
1124  }
1125 
1126  return parent::selectRow( $table, $vars, $conds, $fname, $options, $join_conds );
1127  }
1128 
1138  $preLimitTail = $postLimitTail = '';
1139  $startOpts = '';
1140 
1141  $noKeyOptions = [];
1142  foreach ( $options as $key => $option ) {
1143  if ( is_numeric( $key ) ) {
1144  $noKeyOptions[$option] = true;
1145  }
1146  }
1147 
1148  $preLimitTail .= $this->makeGroupByWithHaving( $options );
1149 
1150  $preLimitTail .= $this->makeOrderBy( $options );
1151 
1152  if ( isset( $noKeyOptions['FOR UPDATE'] ) ) {
1153  $postLimitTail .= ' FOR UPDATE';
1154  }
1155 
1156  if ( isset( $noKeyOptions['DISTINCT'] ) || isset( $noKeyOptions['DISTINCTROW'] ) ) {
1157  $startOpts .= 'DISTINCT';
1158  }
1159 
1160  if ( isset( $options['USE INDEX'] ) && !is_array( $options['USE INDEX'] ) ) {
1161  $useIndex = $this->useIndexClause( $options['USE INDEX'] );
1162  } else {
1163  $useIndex = '';
1164  }
1165 
1166  if ( isset( $options['IGNORE INDEX'] ) && !is_array( $options['IGNORE INDEX'] ) ) {
1167  $ignoreIndex = $this->ignoreIndexClause( $options['IGNORE INDEX'] );
1168  } else {
1169  $ignoreIndex = '';
1170  }
1171 
1172  return [ $startOpts, $useIndex, $preLimitTail, $postLimitTail, $ignoreIndex ];
1173  }
1174 
1175  public function delete( $table, $conds, $fname = __METHOD__ ) {
1177 
1178  if ( is_array( $conds ) ) {
1179  $conds = $this->wrapConditionsForWhere( $table, $conds );
1180  }
1181  // a hack for deleting pages, users and images (which have non-nullable FKs)
1182  // all deletions on these tables have transactions so final failure rollbacks these updates
1183  // @todo: Normalize the schema to match MySQL, no special FKs and such
1184  $table = $this->tableName( $table );
1185  if ( $table == $this->tableName( 'user' ) &&
1186  ( $wgActorTableSchemaMigrationStage & SCHEMA_COMPAT_WRITE_OLD )
1187  ) {
1188  $this->update( 'archive', [ 'ar_user' => 0 ],
1189  [ 'ar_user' => $conds['user_id'] ], $fname );
1190  $this->update( 'ipblocks', [ 'ipb_user' => 0 ],
1191  [ 'ipb_user' => $conds['user_id'] ], $fname );
1192  $this->update( 'image', [ 'img_user' => 0 ],
1193  [ 'img_user' => $conds['user_id'] ], $fname );
1194  $this->update( 'oldimage', [ 'oi_user' => 0 ],
1195  [ 'oi_user' => $conds['user_id'] ], $fname );
1196  $this->update( 'filearchive', [ 'fa_deleted_user' => 0 ],
1197  [ 'fa_deleted_user' => $conds['user_id'] ], $fname );
1198  $this->update( 'filearchive', [ 'fa_user' => 0 ],
1199  [ 'fa_user' => $conds['user_id'] ], $fname );
1200  $this->update( 'uploadstash', [ 'us_user' => 0 ],
1201  [ 'us_user' => $conds['user_id'] ], $fname );
1202  $this->update( 'recentchanges', [ 'rc_user' => 0 ],
1203  [ 'rc_user' => $conds['user_id'] ], $fname );
1204  $this->update( 'logging', [ 'log_user' => 0 ],
1205  [ 'log_user' => $conds['user_id'] ], $fname );
1206  } elseif ( $table == $this->tableName( 'image' ) ) {
1207  $this->update( 'oldimage', [ 'oi_name' => 0 ],
1208  [ 'oi_name' => $conds['img_name'] ], $fname );
1209  }
1210 
1211  return parent::delete( $table, $conds, $fname );
1212  }
1213 
1223  function update( $table, $values, $conds, $fname = __METHOD__, $options = [] ) {
1224  $table = $this->tableName( $table );
1225  $opts = $this->makeUpdateOptions( $options );
1226  $sql = "UPDATE $opts $table SET ";
1227 
1228  $first = true;
1229  foreach ( $values as $col => &$val ) {
1230  $sqlSet = $this->fieldBindStatement( $table, $col, $val, true );
1231 
1232  if ( !$first ) {
1233  $sqlSet = ', ' . $sqlSet;
1234  } else {
1235  $first = false;
1236  }
1237  $sql .= $sqlSet;
1238  }
1239 
1240  if ( $conds !== [] && $conds !== '*' ) {
1241  $conds = $this->wrapConditionsForWhere( $table, $conds );
1242  $sql .= ' WHERE ' . $this->makeList( $conds, LIST_AND );
1243  }
1244 
1245  $this->mLastResult = $stmt = oci_parse( $this->conn, $sql );
1246  if ( $stmt === false ) {
1247  $e = oci_error( $this->conn );
1248  $this->reportQueryError( $e['message'], $e['code'], $sql, __METHOD__ );
1249 
1250  return false;
1251  }
1252  foreach ( $values as $col => &$val ) {
1253  $col_info = $this->fieldInfoMulti( $table, $col );
1254  $col_type = $col_info != false ? $col_info->type() : 'CONSTANT';
1255 
1256  if ( $val === null ) {
1257  // do nothing ... null was inserted in statement creation
1258  } elseif ( $col_type != 'BLOB' && $col_type != 'CLOB' ) {
1259  if ( is_object( $val ) ) {
1260  $val = $val->getData();
1261  }
1262 
1263  if ( preg_match( '/^timestamp.*/i', $col_type ) == 1 && strtolower( $val ) == 'infinity' ) {
1264  $val = '31-12-2030 12:00:00.000000';
1265  }
1266 
1267  $val = MediaWikiServices::getInstance()->getContentLanguage()->
1268  checkTitleEncoding( $val );
1269  if ( oci_bind_by_name( $stmt, ":$col", $val ) === false ) {
1270  $e = oci_error( $stmt );
1271  $this->reportQueryError( $e['message'], $e['code'], $sql, __METHOD__ );
1272 
1273  return false;
1274  }
1275  } else {
1277  $lob[$col] = oci_new_descriptor( $this->conn, OCI_D_LOB );
1278  if ( $lob[$col] === false ) {
1279  $e = oci_error( $stmt );
1280  throw new DBUnexpectedError( $this, "Cannot create LOB descriptor: " . $e['message'] );
1281  }
1282 
1283  if ( is_object( $val ) ) {
1284  $val = $val->getData();
1285  }
1286 
1287  if ( $col_type == 'BLOB' ) {
1288  $lob[$col]->writeTemporary( $val );
1289  oci_bind_by_name( $stmt, ":$col", $lob[$col], -1, SQLT_BLOB );
1290  } else {
1291  $lob[$col]->writeTemporary( $val );
1292  oci_bind_by_name( $stmt, ":$col", $lob[$col], -1, OCI_B_CLOB );
1293  }
1294  }
1295  }
1296 
1297  Wikimedia\suppressWarnings();
1298 
1299  if ( oci_execute( $stmt, $this->execFlags() ) === false ) {
1300  $e = oci_error( $stmt );
1301  if ( !$this->ignoreDupValOnIndex || $e['code'] != '1' ) {
1302  $this->reportQueryError( $e['message'], $e['code'], $sql, __METHOD__ );
1303 
1304  return false;
1305  } else {
1306  $this->mAffectedRows = oci_num_rows( $stmt );
1307  }
1308  } else {
1309  $this->mAffectedRows = oci_num_rows( $stmt );
1310  }
1311 
1312  Wikimedia\restoreWarnings();
1313 
1314  if ( isset( $lob ) ) {
1315  foreach ( $lob as $lob_v ) {
1316  $lob_v->free();
1317  }
1318  }
1319 
1320  if ( !$this->trxLevel ) {
1321  oci_commit( $this->conn );
1322  }
1323 
1324  return oci_free_statement( $stmt );
1325  }
1326 
1327  function bitNot( $field ) {
1328  // expecting bit-fields smaller than 4bytes
1329  return 'BITNOT(' . $field . ')';
1330  }
1331 
1332  function bitAnd( $fieldLeft, $fieldRight ) {
1333  return 'BITAND(' . $fieldLeft . ', ' . $fieldRight . ')';
1334  }
1335 
1336  function bitOr( $fieldLeft, $fieldRight ) {
1337  return 'BITOR(' . $fieldLeft . ', ' . $fieldRight . ')';
1338  }
1339 
1340  public function buildGroupConcatField(
1341  $delim, $table, $field, $conds = '', $join_conds = []
1342  ) {
1343  $fld = "LISTAGG($field," . $this->addQuotes( $delim ) . ") WITHIN GROUP (ORDER BY $field)";
1344 
1345  return '(' . $this->selectSQLText( $table, $fld, $conds, null, [], $join_conds ) . ')';
1346  }
1347 
1348  public function buildSubstring( $input, $startPosition, $length = null ) {
1349  $this->assertBuildSubstringParams( $startPosition, $length );
1350  $params = [ $input, $startPosition ];
1351  if ( $length !== null ) {
1352  $params[] = $length;
1353  }
1354  return 'SUBSTR(' . implode( ',', $params ) . ')';
1355  }
1356 
1362  public function buildStringCast( $field ) {
1363  return 'CAST ( ' . $field . ' AS VARCHAR2 )';
1364  }
1365 
1366  public function getInfinity() {
1367  return '31-12-2030 12:00:00.000000';
1368  }
1369 }
DBO_PERSISTENT
const DBO_PERSISTENT
Definition: defines.php:14
DatabaseOracle\insert
insert( $table, $a, $fname=__METHOD__, $options=[])
INSERT wrapper, inserts an array into a table.
Definition: DatabaseOracle.php:372
DatabaseOracle\numFields
numFields( $res)
Definition: DatabaseOracle.php:302
Wikimedia\Rdbms\Database
Relational database abstraction object.
Definition: Database.php:48
DatabaseOracle\encodeBlob
encodeBlob( $b)
Some DBMSs have a special format for inserting into blob fields, they don't allow simple quoted strin...
Definition: DatabaseOracle.php:694
DatabaseOracle\__construct
__construct(array $p)
Definition: DatabaseOracle.php:55
StringUtils\isUtf8
static isUtf8( $value)
Test whether a string is valid UTF-8.
Definition: StringUtils.php:41
query
For a write query
Definition: database.txt:26
DatabaseOracle\$mAffectedRows
int $mAffectedRows
The number of rows affected as an integer.
Definition: DatabaseOracle.php:41
DatabaseOracle\lastErrno
lastErrno()
Get the last error number.
Definition: DatabaseOracle.php:342
DatabaseOracle\dropTable
dropTable( $tableName, $fName=__METHOD__)
Delete a table.
Definition: DatabaseOracle.php:750
DatabaseOracle\bitOr
bitOr( $fieldLeft, $fieldRight)
Definition: DatabaseOracle.php:1336
DatabaseOracle\doSelectDomain
doSelectDomain(DatabaseDomain $domain)
Definition: DatabaseOracle.php:1027
captcha-old.count
count
Definition: captcha-old.py:249
Wikimedia\Rdbms\Database\$password
string $password
Password used to establish the current connection.
Definition: Database.php:85
DatabaseOracle\doCommit
doCommit( $fname=__METHOD__)
Issues the COMMIT command to the database server.
Definition: DatabaseOracle.php:926
DatabaseOracle\nativeInsertSelect
nativeInsertSelect( $destTable, $srcTable, $varMap, $conds, $fname=__METHOD__, $insertOptions=[], $selectOptions=[], $selectJoinConds=[])
Native server-side implementation of insertSelect() for situations where we don't want to select ever...
Definition: DatabaseOracle.php:548
$result
The index of the header message $result[1]=The index of the body text message $result[2 through n]=Parameters passed to body text message. Please note the header message cannot receive/use parameters. 'ImportHandleLogItemXMLTag':When parsing a XML tag in a log item. Return false to stop further processing of the tag $reader:XMLReader object $logInfo:Array of information 'ImportHandlePageXMLTag':When parsing a XML tag in a page. Return false to stop further processing of the tag $reader:XMLReader object & $pageInfo:Array of information 'ImportHandleRevisionXMLTag':When parsing a XML tag in a page revision. Return false to stop further processing of the tag $reader:XMLReader object $pageInfo:Array of page information $revisionInfo:Array of revision information 'ImportHandleToplevelXMLTag':When parsing a top level XML tag. Return false to stop further processing of the tag $reader:XMLReader object 'ImportHandleUnknownUser':When a user doesn 't exist locally, this hook is called to give extensions an opportunity to auto-create it. If the auto-creation is successful, return false. $name:User name 'ImportHandleUploadXMLTag':When parsing a XML tag in a file upload. Return false to stop further processing of the tag $reader:XMLReader object $revisionInfo:Array of information 'ImportLogInterwikiLink':Hook to change the interwiki link used in log entries and edit summaries for transwiki imports. & $fullInterwikiPrefix:Interwiki prefix, may contain colons. & $pageTitle:String that contains page title. 'ImportSources':Called when reading from the $wgImportSources configuration variable. Can be used to lazy-load the import sources list. & $importSources:The value of $wgImportSources. Modify as necessary. See the comment in DefaultSettings.php for the detail of how to structure this array. 'InfoAction':When building information to display on the action=info page. $context:IContextSource object & $pageInfo:Array of information 'InitializeArticleMaybeRedirect':MediaWiki check to see if title is a redirect. & $title:Title object for the current page & $request:WebRequest & $ignoreRedirect:boolean to skip redirect check & $target:Title/string of redirect target & $article:Article object 'InternalParseBeforeLinks':during Parser 's internalParse method before links but after nowiki/noinclude/includeonly/onlyinclude and other processings. & $parser:Parser object & $text:string containing partially parsed text & $stripState:Parser 's internal StripState object 'InternalParseBeforeSanitize':during Parser 's internalParse method just before the parser removes unwanted/dangerous HTML tags and after nowiki/noinclude/includeonly/onlyinclude and other processings. Ideal for syntax-extensions after template/parser function execution which respect nowiki and HTML-comments. & $parser:Parser object & $text:string containing partially parsed text & $stripState:Parser 's internal StripState object 'InterwikiLoadPrefix':When resolving if a given prefix is an interwiki or not. Return true without providing an interwiki to continue interwiki search. $prefix:interwiki prefix we are looking for. & $iwData:output array describing the interwiki with keys iw_url, iw_local, iw_trans and optionally iw_api and iw_wikiid. 'InvalidateEmailComplete':Called after a user 's email has been invalidated successfully. $user:user(object) whose email is being invalidated 'IRCLineURL':When constructing the URL to use in an IRC notification. Callee may modify $url and $query, URL will be constructed as $url . $query & $url:URL to index.php & $query:Query string $rc:RecentChange object that triggered url generation 'IsFileCacheable':Override the result of Article::isFileCacheable()(if true) & $article:article(object) being checked 'IsTrustedProxy':Override the result of IP::isTrustedProxy() & $ip:IP being check & $result:Change this value to override the result of IP::isTrustedProxy() 'IsUploadAllowedFromUrl':Override the result of UploadFromUrl::isAllowedUrl() $url:URL used to upload from & $allowed:Boolean indicating if uploading is allowed for given URL 'isValidEmailAddr':Override the result of Sanitizer::validateEmail(), for instance to return false if the domain name doesn 't match your organization. $addr:The e-mail address entered by the user & $result:Set this and return false to override the internal checks 'isValidPassword':Override the result of User::isValidPassword() $password:The password entered by the user & $result:Set this and return false to override the internal checks $user:User the password is being validated for 'Language::getMessagesFileName':$code:The language code or the language we 're looking for a messages file for & $file:The messages file path, you can override this to change the location. 'LanguageGetNamespaces':Provide custom ordering for namespaces or remove namespaces. Do not use this hook to add namespaces. Use CanonicalNamespaces for that. & $namespaces:Array of namespaces indexed by their numbers 'LanguageGetTranslatedLanguageNames':Provide translated language names. & $names:array of language code=> language name $code:language of the preferred translations 'LanguageLinks':Manipulate a page 's language links. This is called in various places to allow extensions to define the effective language links for a page. $title:The page 's Title. & $links:Array with elements of the form "language:title" in the order that they will be output. & $linkFlags:Associative array mapping prefixed links to arrays of flags. Currently unused, but planned to provide support for marking individual language links in the UI, e.g. for featured articles. 'LanguageSelector':Hook to change the language selector available on a page. $out:The output page. $cssClassName:CSS class name of the language selector. 'LinkBegin':DEPRECATED since 1.28! Use HtmlPageLinkRendererBegin instead. Used when generating internal and interwiki links in Linker::link(), before processing starts. Return false to skip default processing and return $ret. See documentation for Linker::link() for details on the expected meanings of parameters. $skin:the Skin object $target:the Title that the link is pointing to & $html:the contents that the< a > tag should have(raw HTML) $result
Definition: hooks.txt:1983
wfTimestamp
wfTimestamp( $outputtype=TS_UNIX, $ts=0)
Get a timestamp string in one of various formats.
Definition: GlobalFunctions.php:1912
DatabaseOracle\strencode
strencode( $s)
Wrapper for addslashes()
Definition: DatabaseOracle.php:1059
DatabaseOracle\textFieldSize
textFieldSize( $table, $field)
Returns the size of a text field, or -1 for "unlimited".
Definition: DatabaseOracle.php:680
DatabaseOracle\wrapFieldForWhere
wrapFieldForWhere( $table, &$col, &$val)
Definition: DatabaseOracle.php:1088
DatabaseOracle\tableNameInternal
tableNameInternal( $name)
Definition: DatabaseOracle.php:633
DatabaseOracle\buildGroupConcatField
buildGroupConcatField( $delim, $table, $field, $conds='', $join_conds=[])
Build a GROUP_CONCAT or equivalent statement for a query.
Definition: DatabaseOracle.php:1340
DatabaseOracle\fieldInfoMulti
fieldInfoMulti( $table, $field)
Function translates mysql_fetch_field() functionality on ORACLE.
Definition: DatabaseOracle.php:855
$params
$params
Definition: styleTest.css.php:44
DatabaseOracle\fetchAffectedRowCount
fetchAffectedRowCount()
Definition: DatabaseOracle.php:352
$s
$s
Definition: mergeMessageFileList.php:186
DatabaseOracle\addIdentifierQuotes
addIdentifierQuotes( $s)
Quotes an identifier, in order to make user controlled input safe.
Definition: DatabaseOracle.php:1072
Wikimedia\Rdbms\DatabaseDomain\getDatabase
getDatabase()
Definition: DatabaseDomain.php:162
$res
$res
Definition: database.txt:21
Wikimedia\Rdbms\ResultWrapper
Result wrapper for grabbing data queried from an IDatabase object.
Definition: ResultWrapper.php:24
DatabaseOracle\limitResult
limitResult( $sql, $limit, $offset=false)
Construct a LIMIT query with optional offset.
Definition: DatabaseOracle.php:686
$success
$success
Definition: NoLocalSettings.php:42
DatabaseOracle\doRollback
doRollback( $fname=__METHOD__)
Issues the ROLLBACK command to the database server.
Definition: DatabaseOracle.php:937
DatabaseOracle\duplicateTableStructure
duplicateTableStructure( $oldName, $newName, $temporary=false, $fname=__METHOD__)
Creates a new table with structure copied from existing table.
Definition: DatabaseOracle.php:709
$wgDBOracleDRCP
$wgDBOracleDRCP
Set true to enable Oracle DCRP (supported from 11gR1 onward)
Definition: DefaultSettings.php:2144
ORAField
Definition: ORAField.php:5
DatabaseOracle\timestamp
timestamp( $ts=0)
Convert a timestamp in one of the formats accepted by wfTimestamp() to the format used for inserting ...
Definition: DatabaseOracle.php:759
Wikimedia\Rdbms\Database\getFlag
getFlag( $flag)
Returns a boolean whether the flag $flag is set for this connection.
Definition: Database.php:835
is
This document provides an overview of the usage of PageUpdater and that is
Definition: pageupdater.txt:3
DatabaseOracle\aggregateValue
aggregateValue( $valuedata, $valuename='value')
Return aggregated value function call.
Definition: DatabaseOracle.php:770
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
LIST_AND
const LIST_AND
Definition: Defines.php:43
DatabaseOracle\listTables
listTables( $prefix=null, $fname=__METHOD__)
List all tables on the database.
Definition: DatabaseOracle.php:725
DatabaseOracle\execFlags
execFlags()
Definition: DatabaseOracle.php:178
DatabaseOracle\$defaultCharset
string $defaultCharset
Character set for Oracle database.
Definition: DatabaseOracle.php:50
DatabaseOracle\fieldName
fieldName( $stmt, $n)
Get a field name in a result object.
Definition: DatabaseOracle.php:310
DatabaseOracle\freeResult
freeResult( $res)
Frees resources associated with the LOB descriptor.
Definition: DatabaseOracle.php:254
FROM
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 and or sell copies of the and to permit persons to whom the Software is furnished to do subject to the following WITHOUT WARRANTY OF ANY EXPRESS OR INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY DAMAGES OR OTHER WHETHER IN AN ACTION OF TORT OR ARISING FROM
Definition: MIT-LICENSE.txt:10
DatabaseOracle\tableExists
tableExists( $table, $fname=__METHOD__)
Query whether a given table exists (in the given schema, or the default mw one if not given)
Definition: DatabaseOracle.php:828
DatabaseOracle\lastError
lastError()
Get a description of the last error.
Definition: DatabaseOracle.php:332
DatabaseOracle\removeIdentifierQuotes
removeIdentifierQuotes( $s)
Definition: DatabaseOracle.php:1080
user
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 and we might be restricted by PHP settings such as safe mode or open_basedir We cannot assume that the software even has read access anywhere useful Many shared hosts run all users web applications under the same user
Definition: distributors.txt:9
tableName
We use the convention $dbr for read and $dbw for write to help you keep track of whether the database object is a the world will explode Or to be a subsequent write query which succeeded on the master may fail when replicated to the slave due to a unique key collision Replication on the slave will stop and it may take hours to repair the database and get it back online Setting read_only in my cnf on the slave will avoid this but given the dire we prefer to have as many checks as possible We provide a but the wrapper functions like please read the documentation for tableName() and addQuotes(). You will need both of them. ------------------------------------------------------------------------ Basic query optimisation ------------------------------------------------------------------------ MediaWiki developers who need to write DB queries should have some understanding of databases and the performance issues associated with them. Patches containing unacceptably slow features will not be accepted. Unindexed queries are generally not welcome in MediaWiki
Wikimedia\Rdbms\Database\trxLevel
trxLevel()
Gets the current transaction level.
Definition: Database.php:588
$input
if(is_array( $mode)) switch( $mode) $input
Definition: postprocess-phan.php:141
DatabaseOracle\numRows
numRows( $res)
Definition: DatabaseOracle.php:290
Wikimedia\Rdbms\Database\setFlag
setFlag( $flag, $remember=self::REMEMBER_NOTHING)
Set a flag for this connection.
Definition: Database.php:800
DatabaseOracle\getServerVersion
getServerVersion()
Definition: DatabaseOracle.php:784
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
DatabaseOracle\update
update( $table, $values, $conds, $fname=__METHOD__, $options=[])
Definition: DatabaseOracle.php:1223
DatabaseOracle\$ignoreDupValOnIndex
bool $ignoreDupValOnIndex
Definition: DatabaseOracle.php:44
Wikimedia\Rdbms\Database\$user
string $user
User that this instance is currently connected under the name of.
Definition: Database.php:83
DatabaseOracle
Definition: DatabaseOracle.php:36
Wikimedia\Rdbms\Database\selectDB
selectDB( $db)
Change the current database.
Definition: Database.php:2384
DatabaseOracle\fetchRow
fetchRow( $res)
Definition: DatabaseOracle.php:278
DatabaseOracle\doBegin
doBegin( $fname=__METHOD__)
Issues the BEGIN command to the database server.
Definition: DatabaseOracle.php:921
$vars
static configuration should be added through ResourceLoaderGetConfigVars instead & $vars
Definition: hooks.txt:2220
DatabaseOracle\doQuery
doQuery( $sql)
Definition: DatabaseOracle.php:186
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))
wfDebug
wfDebug( $text, $dest='all', array $context=[])
Sends a line to the debug log if enabled or, optionally, to a comment in output.
Definition: GlobalFunctions.php:949
DatabaseOracle\getSequenceData
getSequenceData( $table)
Return sequence_name if table has a sequence.
Definition: DatabaseOracle.php:645
DatabaseOracle\wasDeadlock
wasDeadlock()
Determines if the last failure was due to a deadlock.
Definition: DatabaseOracle.php:705
DatabaseOracle\addQuotes
addQuotes( $s)
Adds quotes and backslashes.
Definition: DatabaseOracle.php:1063
way
and give any other recipients of the Program a copy of this License along with the Program You may charge a fee for the physical act of transferring a and you may at your option offer warranty protection in exchange for a fee You may modify your copy or copies of the Program or any portion of thus forming a work based on the and copy and distribute such modifications or work under the terms of Section provided that you also meet all of these that in whole or in part contains or is derived from the Program or any part to be licensed as a whole at no charge to all third parties under the terms of this License c If the modified program normally reads commands interactively when you must cause when started running for such interactive use in the most ordinary way
Definition: COPYING.txt:87
null
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
Definition: hooks.txt:780
$fname
if(defined( 'MW_SETUP_CALLBACK')) $fname
Customization point after all loading (constants, functions, classes, DefaultSettings,...
Definition: Setup.php:123
DatabaseOracle\open
open( $server, $user, $password, $dbName, $schema, $tablePrefix)
Open a new connection to the database (closing any existing one)
Definition: DatabaseOracle.php:81
$name
Allows to change the fields on the form that will be generated $name
Definition: hooks.txt:271
DatabaseOracle\fetchObject
fetchObject( $res)
Definition: DatabaseOracle.php:266
$line
$line
Definition: cdb.php:59
DatabaseOracle\$sequenceData
bool array $sequenceData
Definition: DatabaseOracle.php:47
code
and how to run hooks for an and one after Each event has a preferably in CamelCase For ArticleDelete hook A clump of code and data that should be run when an event happens This can be either a function and a chunk of or an object and a method hook function The function part of a third party developers and administrators to define code that will be run at certain points in the mainline code
Definition: hooks.txt:23
DatabaseOracle\buildStringCast
buildStringCast( $field)
Definition: DatabaseOracle.php:1362
$e
div flags Integer display flags(NO_ACTION_LINK, NO_EXTRA_USER_LINKS) 'LogException' returning false will NOT prevent logging $e
Definition: hooks.txt:2162
e
in this case you re responsible for computing and outputting the entire conflict i e
Definition: hooks.txt:1423
DBO_DDLMODE
const DBO_DDLMODE
Definition: defines.php:16
DatabaseOracle\unionQueries
unionQueries( $sqls, $all)
Construct a UNION query This is used for providing overload point for other DB abstractions not compa...
Definition: DatabaseOracle.php:698
SCHEMA_COMPAT_WRITE_OLD
const SCHEMA_COMPAT_WRITE_OLD
Definition: Defines.php:284
DatabaseOracle\indexInfo
indexInfo( $table, $index, $fname=__METHOD__)
Returns information about an index If errors are explicitly ignored, returns NULL on failure.
Definition: DatabaseOracle.php:364
DatabaseOracle\wrapConditionsForWhere
wrapConditionsForWhere( $table, $conds, $parentCol=null)
Definition: DatabaseOracle.php:1101
DBO_SYSDBA
const DBO_SYSDBA
Definition: defines.php:15
$ret
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 & $ret
Definition: hooks.txt:1985
DatabaseOracle\__destruct
__destruct()
Run a few simple sanity checks and close dangling connections.
Definition: DatabaseOracle.php:61
DatabaseOracle\makeSelectOptions
makeSelectOptions( $options)
Returns an optional USE INDEX clause to go after the table, and a string to go at the end of the quer...
Definition: DatabaseOracle.php:1137
DatabaseOracle\indexExists
indexExists( $table, $index, $fname=__METHOD__)
Query whether a given index exists.
Definition: DatabaseOracle.php:805
DatabaseOracle\dataSeek
dataSeek( $res, $row)
Definition: DatabaseOracle.php:324
Wikimedia\Rdbms\DBUnexpectedError
Definition: DBUnexpectedError.php:27
message
either a unescaped string or a HtmlArmor object after in associative array form externallinks including delete and has completed for all link tables whether this was an auto creation use $formDescriptor instead default is conds Array Extra conditions for the No matching items in log is displayed if loglist is empty msgKey Array If you want a nice box with a message
Definition: hooks.txt:2154
DatabaseOracle\getSoftwareLink
getSoftwareLink()
Definition: DatabaseOracle.php:777
ORAResult
The oci8 extension is fairly weak and doesn't support oci_num_rows, among other things.
Definition: ORAResult.php:11
DatabaseOracle\queryIgnore
queryIgnore( $sql, $fname='')
Definition: DatabaseOracle.php:246
DatabaseOracle\getInfinity
getInfinity()
Find out when 'infinity' is.
Definition: DatabaseOracle.php:1366
Wikimedia\Rdbms\Database\close
close()
Close the database connection.
Definition: Database.php:938
DatabaseOracle\$mLastResult
resource $mLastResult
Definition: DatabaseOracle.php:38
$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:1985
Wikimedia\Rdbms\DBExpectedError
Base class for the more common types of database errors.
Definition: DBExpectedError.php:32
DatabaseOracle\isQuotedIdentifier
isQuotedIdentifier( $s)
Returns if the given identifier looks quoted or not according to the database convention for quoting ...
Definition: DatabaseOracle.php:1084
DatabaseOracle\sourceStream
sourceStream( $fp, callable $lineCallback=null, callable $resultCallback=null, $fname=__METHOD__, callable $inputCallback=null)
Read and execute commands from an open file handle.
Definition: DatabaseOracle.php:945
DatabaseOracle\insertId
insertId()
Get the inserted value of an auto-increment row.
Definition: DatabaseOracle.php:314
DatabaseOracle\buildSubstring
buildSubstring( $input, $startPosition, $length=null)
Definition: DatabaseOracle.php:1348
Wikimedia\Rdbms\DatabaseDomain\getSchema
getSchema()
Definition: DatabaseDomain.php:169
as
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
Definition: distributors.txt:9
DatabaseOracle\fieldInfo
fieldInfo( $table, $field)
Definition: DatabaseOracle.php:913
Wikimedia\Rdbms\DBConnectionError
Definition: DBConnectionError.php:26
Wikimedia\Rdbms\Database\$server
string $server
Server that this instance is currently connected to.
Definition: Database.php:81
DatabaseOracle\closeConnection
closeConnection()
Closes a database connection, if it is open Returns success, true if already closed.
Definition: DatabaseOracle.php:174
DatabaseOracle\bitNot
bitNot( $field)
Definition: DatabaseOracle.php:1327
DatabaseOracle\getType
getType()
Get the type of the DBMS, as it appears in $wgDBtype.
Definition: DatabaseOracle.php:69
DatabaseOracle\indexUnique
indexUnique( $table, $index, $fname=__METHOD__)
Definition: DatabaseOracle.php:368
MediaWikiServices
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 MediaWikiServices
Definition: injection.txt:23
DatabaseOracle\implicitGroupby
implicitGroupby()
Returns true if this database does an implicit sort when doing GROUP BY.
Definition: DatabaseOracle.php:73
Wikimedia\Rdbms\DatabaseDomain
Class to handle database/prefix specification for IDatabase domains.
Definition: DatabaseDomain.php:28
DatabaseOracle\$mFieldInfoCache
array $mFieldInfoCache
Definition: DatabaseOracle.php:53
DBO_DEFAULT
const DBO_DEFAULT
Definition: defines.php:13
Hooks\run
static run( $event, array $args=[], $deprecatedVersion=null)
Call hook functions defined in Hooks::register and $wgHooks.
Definition: Hooks.php:200
DatabaseOracle\implicitOrderby
implicitOrderby()
Returns true if this database does an implicit order by when the column has an index For example: SEL...
Definition: DatabaseOracle.php:77
server
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 and we might be restricted by PHP settings such as safe mode or open_basedir We cannot assume that the software even has read access anywhere useful Many shared hosts run all users web applications under the same so they can t rely on Unix and must forbid reads to even standard directories like tmp lest users read each others files We cannot assume that the user has the ability to install or run any programs not written as web accessible PHP scripts Since anything that works on cheap shared hosting will work if you have shell or root access MediaWiki s design is based around catering to the lowest common denominator Although we support higher end setups as the way many things work by default is tailored toward shared hosting These defaults are unconventional from the point of view of and they certainly aren t ideal for someone who s installing MediaWiki as MediaWiki does not conform to normal Unix filesystem layout Hopefully we ll offer direct support for standard layouts in the but for now *any change to the location of files is unsupported *Moving things and leaving symlinks will *probably *not break but it is *strongly *advised not to try any more intrusive changes to get MediaWiki to conform more closely to your filesystem hierarchy Any such attempt will almost certainly result in unnecessary bugs The standard recommended location to install relative to the web is it should be possible to enable the appropriate rewrite rules by if you can reconfigure the web server
Definition: distributors.txt:53
MWTimestamp\getLocalInstance
static getLocalInstance( $ts=false)
Get a timestamp instance in the server local timezone ($wgLocaltimezone)
Definition: MWTimestamp.php:204
DatabaseOracle\bitAnd
bitAnd( $fieldLeft, $fieldRight)
Definition: DatabaseOracle.php:1332
DatabaseOracle\fieldBindStatement
fieldBindStatement( $table, $col, &$val, $includeCol=false)
Definition: DatabaseOracle.php:400
return
return[ 'abap'=> true, 'abl'=> true, 'abnf'=> true, 'aconf'=> true, 'actionscript'=> true, 'actionscript3'=> true, 'ada'=> true, 'ada2005'=> true, 'ada95'=> true, 'adl'=> true, 'agda'=> true, 'aheui'=> true, 'ahk'=> true, 'alloy'=> true, 'ambienttalk'=> true, 'ambienttalk/2'=> true, 'ampl'=> true, 'antlr'=> true, 'antlr-actionscript'=> true, 'antlr-as'=> true, 'antlr-c#'=> true, 'antlr-cpp'=> true, 'antlr-csharp'=> true, 'antlr-java'=> true, 'antlr-objc'=> true, 'antlr-perl'=> true, 'antlr-python'=> true, 'antlr-rb'=> true, 'antlr-ruby'=> true, 'apache'=> true, 'apacheconf'=> true, 'apl'=> true, 'applescript'=> true, 'arduino'=> true, 'arexx'=> true, 'as'=> true, 'as3'=> true, 'asm'=> true, 'aspectj'=> true, 'aspx-cs'=> true, 'aspx-vb'=> true, 'asy'=> true, 'asymptote'=> true, 'at'=> true, 'autohotkey'=> true, 'autoit'=> true, 'awk'=> true, 'b3d'=> true, 'basemake'=> true, 'bash'=> true, 'basic'=> true, 'bat'=> true, 'batch'=> true, 'bbcode'=> true, 'bc'=> true, 'befunge'=> true, 'bf'=> true, 'bib'=> true, 'bibtex'=> true, 'blitzbasic'=> true, 'blitzmax'=> true, 'bmax'=> true, 'bnf'=> true, 'boo'=> true, 'boogie'=> true, 'bplus'=> true, 'brainfuck'=> true, 'bro'=> true, 'bsdmake'=> true, 'bst'=> true, 'bst-pybtex'=> true, 'bugs'=> true, 'c'=> true, 'c#'=> true, 'c++'=> true, 'c++-objdumb'=> true, 'c-objdump'=> true, 'ca65'=> true, 'cadl'=> true, 'camkes'=> true, 'capdl'=> true, 'capnp'=> true, 'cbmbas'=> true, 'ceylon'=> true, 'cf3'=> true, 'cfc'=> true, 'cfengine3'=> true, 'cfg'=> true, 'cfm'=> true, 'cfs'=> true, 'chai'=> true, 'chaiscript'=> true, 'chapel'=> true, 'cheetah'=> true, 'chpl'=> true, 'cirru'=> true, 'cl'=> true, 'clay'=> true, 'clean'=> true, 'clipper'=> true, 'clj'=> true, 'cljs'=> true, 'clojure'=> true, 'clojurescript'=> true, 'cmake'=> true, 'cobol'=> true, 'cobolfree'=> true, 'coffee'=> true, 'coffee-script'=> true, 'coffeescript'=> true, 'common-lisp'=> true, 'componentpascal'=> true, 'console'=> true, 'control'=> true, 'coq'=> true, 'cp'=> true, 'cpp'=> true, 'cpp-objdump'=> true, 'cpsa'=> true, 'cr'=> true, 'crmsh'=> true, 'croc'=> true, 'cry'=> true, 'cryptol'=> true, 'crystal'=> true, 'csh'=> true, 'csharp'=> true, 'csound'=> true, 'csound-csd'=> true, 'csound-document'=> true, 'csound-orc'=> true, 'csound-sco'=> true, 'csound-score'=> true, 'css'=> true, 'css+django'=> true, 'css+erb'=> true, 'css+genshi'=> true, 'css+genshitext'=> true, 'css+jinja'=> true, 'css+lasso'=> true, 'css+mako'=> true, 'css+mozpreproc'=> true, 'css+myghty'=> true, 'css+php'=> true, 'css+ruby'=> true, 'css+smarty'=> true, 'cu'=> true, 'cucumber'=> true, 'cuda'=> true, 'cxx-objdump'=> true, 'cypher'=> true, 'cython'=> true, 'd'=> true, 'd-objdump'=> true, 'dart'=> true, 'debcontrol'=> true, 'debsources'=> true, 'delphi'=> true, 'dg'=> true, 'diff'=> true, 'django'=> true, 'do'=> true, 'docker'=> true, 'dockerfile'=> true, 'dosbatch'=> true, 'doscon'=> true, 'dosini'=> true, 'dpatch'=> true, 'dtd'=> true, 'duby'=> true, 'duel'=> true, 'dylan'=> true, 'dylan-console'=> true, 'dylan-lid'=> true, 'dylan-repl'=> true, 'earl-grey'=> true, 'earlgrey'=> true, 'easytrieve'=> true, 'ebnf'=> true, 'ec'=> true, 'ecl'=> true, 'eg'=> true, 'eiffel'=> true, 'elisp'=> true, 'elixir'=> true, 'elm'=> true, 'emacs'=> true, 'emacs-lisp'=> true, 'erb'=> true, 'erl'=> true, 'erlang'=> true, 'evoque'=> true, 'ex'=> true, 'exs'=> true, 'extempore'=> true, 'ezhil'=> true, 'factor'=> true, 'fan'=> true, 'fancy'=> true, 'felix'=> true, 'fish'=> true, 'fishshell'=> true, 'flatline'=> true, 'flx'=> true, 'forth'=> true, 'fortran'=> true, 'fortranfixed'=> true, 'foxpro'=> true, 'fsharp'=> true, 'fy'=> true, 'gap'=> true, 'gas'=> true, 'gawk'=> true, 'genshi'=> true, 'genshitext'=> true, 'gherkin'=> true, 'glsl'=> true, 'gnuplot'=> true, 'go'=> true, 'golo'=> true, 'gooddata-cl'=> true, 'gosu'=> true, 'groff'=> true, 'groovy'=> true, 'gst'=> true, 'haml'=> true, 'handlebars'=> true, 'haskell'=> true, 'haxe'=> true, 'haxeml'=> true, 'hexdump'=> true, 'hs'=> true, 'hsa'=> true, 'hsail'=> true, 'html'=> true, 'html+cheetah'=> true, 'html+django'=> true, 'html+erb'=> true, 'html+evoque'=> true, 'html+genshi'=> true, 'html+handlebars'=> true, 'html+jinja'=> true, 'html+kid'=> true, 'html+lasso'=> true, 'html+mako'=> true, 'html+myghty'=> true, 'html+ng2'=> true, 'html+php'=> true, 'html+ruby'=> true, 'html+smarty'=> true, 'html+spitfire'=> true, 'html+twig'=> true, 'html+velocity'=> true, 'htmlcheetah'=> true, 'htmldjango'=> true, 'http'=> true, 'hx'=> true, 'hxml'=> true, 'hxsl'=> true, 'hy'=> true, 'hybris'=> true, 'hylang'=> true, 'i6'=> true, 'i6t'=> true, 'i7'=> true, 'idl'=> true, 'idl4'=> true, 'idr'=> true, 'idris'=> true, 'iex'=> true, 'igor'=> true, 'igorpro'=> true, 'ik'=> true, 'inform6'=> true, 'inform7'=> true, 'ini'=> true, 'io'=> true, 'ioke'=> true, 'irb'=> true, 'irc'=> true, 'isabelle'=> true, 'j'=> true, 'jade'=> true, 'jags'=> true, 'jasmin'=> true, 'jasminxt'=> true, 'java'=> true, 'javascript'=> true, 'javascript+cheetah'=> true, 'javascript+django'=> true, 'javascript+erb'=> true, 'javascript+genshi'=> true, 'javascript+genshitext'=> true, 'javascript+jinja'=> true, 'javascript+lasso'=> true, 'javascript+mako'=> true, 'javascript+mozpreproc'=> true, 'javascript+myghty'=> true, 'javascript+php'=> true, 'javascript+ruby'=> true, 'javascript+smarty'=> true, 'javascript+spitfire'=> true, 'jbst'=> true, 'jcl'=> true, 'jinja'=> true, 'jl'=> true, 'jlcon'=> true, 'jproperties'=> true, 'js'=> true, 'js+cheetah'=> true, 'js+django'=> true, 'js+erb'=> true, 'js+genshi'=> true, 'js+genshitext'=> true, 'js+jinja'=> true, 'js+lasso'=> true, 'js+mako'=> true, 'js+myghty'=> true, 'js+php'=> true, 'js+ruby'=> true, 'js+smarty'=> true, 'js+spitfire'=> true, 'jsgf'=> true, 'json'=> true, 'json-ld'=> true, 'json-object'=> true, 'jsonld'=> true, 'jsonml+bst'=> true, 'jsp'=> true, 'julia'=> true, 'juttle'=> true, 'kal'=> true, 'kconfig'=> true, 'kernel-config'=> true, 'kid'=> true, 'koka'=> true, 'kotlin'=> true, 'ksh'=> true, 'lagda'=> true, 'lasso'=> true, 'lassoscript'=> true, 'latex'=> true, 'lcry'=> true, 'lcryptol'=> true, 'lean'=> true, 'less'=> true, 'lhaskell'=> true, 'lhs'=> true, 'lid'=> true, 'lidr'=> true, 'lidris'=> true, 'lighttpd'=> true, 'lighty'=> true, 'limbo'=> true, 'linux-config'=> true, 'liquid'=> true, 'lisp'=> true, 'literate-agda'=> true, 'literate-cryptol'=> true, 'literate-haskell'=> true, 'literate-idris'=> true, 'live-script'=> true, 'livescript'=> true, 'llvm'=> true, 'logos'=> true, 'logtalk'=> true, 'lsl'=> true, 'lua'=> true, 'm2'=> true, 'make'=> true, 'makefile'=> true, 'mako'=> true, 'man'=> true, 'maql'=> true, 'mask'=> true, 'mason'=> true, 'mathematica'=> true, 'matlab'=> true, 'matlabsession'=> true, 'mawk'=> true, 'md'=> true, 'menuconfig'=> true, 'mf'=> true, 'minid'=> true, 'mma'=> true, 'modelica'=> true, 'modula2'=> true, 'moin'=> true, 'monkey'=> true, 'monte'=> true, 'moo'=> true, 'moocode'=> true, 'moon'=> true, 'moonscript'=> true, 'mozhashpreproc'=> true, 'mozpercentpreproc'=> true, 'mq4'=> true, 'mq5'=> true, 'mql'=> true, 'mql4'=> true, 'mql5'=> true, 'msc'=> true, 'mscgen'=> true, 'mupad'=> true, 'mxml'=> true, 'myghty'=> true, 'mysql'=> true, 'nasm'=> true, 'nawk'=> true, 'nb'=> true, 'ncl'=> true, 'nemerle'=> true, 'nesc'=> true, 'newlisp'=> true, 'newspeak'=> true, 'ng2'=> true, 'nginx'=> true, 'nim'=> true, 'nimrod'=> true, 'nit'=> true, 'nix'=> true, 'nixos'=> true, 'nroff'=> true, 'nsh'=> true, 'nsi'=> true, 'nsis'=> true, 'numpy'=> true, 'nusmv'=> true, 'obj-c'=> true, 'obj-c++'=> true, 'obj-j'=> true, 'objc'=> true, 'objc++'=> true, 'objdump'=> true, 'objdump-nasm'=> true, 'objective-c'=> true, 'objective-c++'=> true, 'objective-j'=> true, 'objectivec'=> true, 'objectivec++'=> true, 'objectivej'=> true, 'objectpascal'=> true, 'objj'=> true, 'ocaml'=> true, 'octave'=> true, 'odin'=> true, 'ooc'=> true, 'opa'=> true, 'openbugs'=> true, 'openedge'=> true, 'pacmanconf'=> true, 'pan'=> true, 'parasail'=> true, 'pas'=> true, 'pascal'=> true, 'pawn'=> true, 'pcmk'=> true, 'perl'=> true, 'perl6'=> true, 'php'=> true, 'php3'=> true, 'php4'=> true, 'php5'=> true, 'pig'=> true, 'pike'=> true, 'pkgconfig'=> true, 'pl'=> true, 'pl6'=> true, 'plpgsql'=> true, 'po'=> true, 'posh'=> true, 'postgres'=> true, 'postgres-console'=> true, 'postgresql'=> true, 'postgresql-console'=> true, 'postscr'=> true, 'postscript'=> true, 'pot'=> true, 'pov'=> true, 'powershell'=> true, 'praat'=> true, 'progress'=> true, 'prolog'=> true, 'properties'=> true, 'proto'=> true, 'protobuf'=> true, 'ps1'=> true, 'ps1con'=> true, 'psm1'=> true, 'psql'=> true, 'pug'=> true, 'puppet'=> true, 'py'=> true, 'py3'=> true, 'py3tb'=> true, 'pycon'=> true, 'pypy'=> true, 'pypylog'=> true, 'pyrex'=> true, 'pytb'=> true, 'python'=> true, 'python3'=> true, 'pyx'=> true, 'qbasic'=> true, 'qbs'=> true, 'qml'=> true, 'qvt'=> true, 'qvto'=> true, 'r'=> true, 'racket'=> true, 'ragel'=> true, 'ragel-c'=> true, 'ragel-cpp'=> true, 'ragel-d'=> true, 'ragel-em'=> true, 'ragel-java'=> true, 'ragel-objc'=> true, 'ragel-rb'=> true, 'ragel-ruby'=> true, 'raw'=> true, 'rb'=> true, 'rbcon'=> true, 'rconsole'=> true, 'rd'=> true, 'rebol'=> true, 'red'=> true, 'red/system'=> true, 'redcode'=> true, 'registry'=> true, 'resource'=> true, 'resourcebundle'=> true, 'rest'=> true, 'restructuredtext'=> true, 'rexx'=> true, 'rhtml'=> true, 'rkt'=> true, 'rnc'=> true, 'rng-compact'=> true, 'roboconf-graph'=> true, 'roboconf-instances'=> true, 'robotframework'=> true, 'rout'=> true, 'rql'=> true, 'rsl'=> true, 'rst'=> true, 'rts'=> true, 'ruby'=> true, 'rust'=> true, 's'=> true, 'sage'=> true, 'salt'=> true, 'sas'=> true, 'sass'=> true, 'sc'=> true, 'scala'=> true, 'scaml'=> true, 'scheme'=> true, 'scilab'=> true, 'scm'=> true, 'scss'=> true, 'sh'=> true, 'shell'=> true, 'shell-session'=> true, 'shen'=> true, 'silver'=> true, 'slim'=> true, 'sls'=> true, 'smali'=> true, 'smalltalk'=> true, 'smarty'=> true, 'sml'=> true, 'snobol'=> true, 'snowball'=> true, 'sources.list'=> true, 'sourceslist'=> true, 'sp'=> true, 'sparql'=> true, 'spec'=> true, 'spitfire'=> true, 'splus'=> true, 'sql'=> true, 'sqlite3'=> true, 'squeak'=> true, 'squid'=> true, 'squid.conf'=> true, 'squidconf'=> true, 'ssp'=> true, 'st'=> true, 'stan'=> true, 'stata'=> true, 'supercollider'=> true, 'sv'=> true, 'swift'=> true, 'swig'=> true, 'systemverilog'=> true, 't-sql'=> true, 'tads3'=> true, 'tap'=> true, 'tasm'=> true, 'tcl'=> true, 'tcsh'=> true, 'tcshcon'=> true, 'tea'=> true, 'termcap'=> true, 'terminfo'=> true, 'terraform'=> true, 'tex'=> true, 'text'=> true, 'tf'=> true, 'thrift'=> true, 'todotxt'=> true, 'trac-wiki'=> true, 'trafficscript'=> true, 'treetop'=> true, 'ts'=> true, 'tsql'=> true, 'turtle'=> true, 'twig'=> true, 'typescript'=> true, 'typoscript'=> true, 'typoscriptcssdata'=> true, 'typoscripthtmldata'=> true, 'udiff'=> true, 'urbiscript'=> true, 'v'=> true, 'vala'=> true, 'vapi'=> true, 'vb.net'=> true, 'vbnet'=> true, 'vcl'=> true, 'vclsnippet'=> true, 'vclsnippets'=> true, 'vctreestatus'=> true, 'velocity'=> true, 'verilog'=> true, 'vfp'=> true, 'vgl'=> true, 'vhdl'=> true, 'vim'=> true, 'wdiff'=> true, 'whiley'=> true, 'winbatch'=> true, 'winbugs'=> true, 'x10'=> true, 'xbase'=> true, 'xml'=> true, 'xml+cheetah'=> true, 'xml+django'=> true, 'xml+erb'=> true, 'xml+evoque'=> true, 'xml+genshi'=> true, 'xml+jinja'=> true, 'xml+kid'=> true, 'xml+lasso'=> true, 'xml+mako'=> true, 'xml+myghty'=> true, 'xml+php'=> true, 'xml+ruby'=> true, 'xml+smarty'=> true, 'xml+spitfire'=> true, 'xml+velocity'=> true, 'xq'=> true, 'xql'=> true, 'xqm'=> true, 'xquery'=> true, 'xqy'=> true, 'xslt'=> true, 'xten'=> true, 'xtend'=> true, 'xul+mozpreproc'=> true, 'yaml'=> true, 'yaml+jinja'=> true, 'zephir'=> true, 'zsh'=> true,]
Definition: SyntaxHighlight.lexers.php:678
DatabaseOracle\selectRow
selectRow( $table, $vars, $conds, $fname=__METHOD__, $options=[], $join_conds=[])
Single row SELECT wrapper.
Definition: DatabaseOracle.php:1119
Wikimedia\Rdbms\Database\$conn
object resource null $conn
Database connection.
Definition: Database.php:108
ORAField\tableName
tableName()
Name of table this field belongs to.
Definition: ORAField.php:26
Wikimedia\Rdbms\Blob
Definition: Blob.php:5
DatabaseOracle\insertOneRow
insertOneRow( $table, $row, $fname)
Definition: DatabaseOracle.php:442
$wgActorTableSchemaMigrationStage
int $wgActorTableSchemaMigrationStage
Actor table schema migration stage.
Definition: DefaultSettings.php:8979