MediaWiki  master
WikiExporter.php
Go to the documentation of this file.
1 <?php
33 
37 class WikiExporter {
39  public $list_authors = false;
40 
42  public $dumpUploads = false;
43 
45  public $dumpUploadFileContents = false;
46 
48  public $author_list = "";
49 
50  const FULL = 1;
51  const CURRENT = 2;
52  const STABLE = 4; // extension defined
53  const LOGS = 8;
54  const RANGE = 16;
55 
58 
59  const BATCH_SIZE = 50000;
60 
62  public $text;
63 
65  public $sink;
66 
68  private $writer;
69 
71  protected $db;
72 
74  protected $history;
75 
77  protected $limitNamespaces;
78 
83  public static function schemaVersion() {
86  }
87 
99  function __construct(
100  $db,
101  $history = self::CURRENT,
102  $text = self::TEXT,
104  ) {
105  $this->db = $db;
106  $this->history = $history;
107  $this->writer = new XmlDumpWriter( $text, self::schemaVersion() );
108  $this->sink = new DumpOutput();
109  $this->text = $text;
110  $this->limitNamespaces = $limitNamespaces;
111  }
112 
118  public function setSchemaVersion( $schemaVersion ) {
119  $this->writer = new XmlDumpWriter( $this->text, $schemaVersion );
120  }
121 
129  public function setOutputSink( &$sink ) {
130  $this->sink =& $sink;
131  }
132 
133  public function openStream() {
134  $output = $this->writer->openStream();
135  $this->sink->writeOpenStream( $output );
136  }
137 
138  public function closeStream() {
139  $output = $this->writer->closeStream();
140  $this->sink->writeCloseStream( $output );
141  }
142 
148  public function allPages() {
149  $this->dumpFrom( '' );
150  }
151 
160  public function pagesByRange( $start, $end, $orderRevs ) {
161  if ( $orderRevs ) {
162  $condition = 'rev_page >= ' . intval( $start );
163  if ( $end ) {
164  $condition .= ' AND rev_page < ' . intval( $end );
165  }
166  } else {
167  $condition = 'page_id >= ' . intval( $start );
168  if ( $end ) {
169  $condition .= ' AND page_id < ' . intval( $end );
170  }
171  }
172  $this->dumpFrom( $condition, $orderRevs );
173  }
174 
182  public function revsByRange( $start, $end ) {
183  $condition = 'rev_id >= ' . intval( $start );
184  if ( $end ) {
185  $condition .= ' AND rev_id < ' . intval( $end );
186  }
187  $this->dumpFrom( $condition );
188  }
189 
193  public function pageByTitle( $title ) {
194  $this->dumpFrom(
195  'page_namespace=' . $title->getNamespace() .
196  ' AND page_title=' . $this->db->addQuotes( $title->getDBkey() ) );
197  }
198 
203  public function pageByName( $name ) {
205  if ( is_null( $title ) ) {
206  throw new MWException( "Can't export invalid title" );
207  } else {
208  $this->pageByTitle( $title );
209  }
210  }
211 
215  public function pagesByName( $names ) {
216  foreach ( $names as $name ) {
217  $this->pageByName( $name );
218  }
219  }
220 
221  public function allLogs() {
222  $this->dumpFrom( '' );
223  }
224 
229  public function logsByRange( $start, $end ) {
230  $condition = 'log_id >= ' . intval( $start );
231  if ( $end ) {
232  $condition .= ' AND log_id < ' . intval( $end );
233  }
234  $this->dumpFrom( $condition );
235  }
236 
244  protected function do_list_authors( $cond ) {
245  $this->author_list = "<contributors>";
246  // rev_deleted
247 
248  $revQuery = Revision::getQueryInfo( [ 'page' ] );
249  $res = $this->db->select(
250  $revQuery['tables'],
251  [
252  'rev_user_text' => $revQuery['fields']['rev_user_text'],
253  'rev_user' => $revQuery['fields']['rev_user'],
254  ],
255  [
256  $this->db->bitAnd( 'rev_deleted', Revision::DELETED_USER ) . ' = 0',
257  $cond,
258  ],
259  __METHOD__,
260  [ 'DISTINCT' ],
261  $revQuery['joins']
262  );
263 
264  foreach ( $res as $row ) {
265  $this->author_list .= "<contributor>" .
266  "<username>" .
267  htmlspecialchars( $row->rev_user_text ) .
268  "</username>" .
269  "<id>" .
270  ( (int)$row->rev_user ) .
271  "</id>" .
272  "</contributor>";
273  }
274  $this->author_list .= "</contributors>";
275  }
276 
283  protected function dumpFrom( $cond = '', $orderRevs = false ) {
284  if ( $this->history & self::LOGS ) {
285  $this->dumpLogs( $cond );
286  } else {
287  $this->dumpPages( $cond, $orderRevs );
288  }
289  }
290 
295  protected function dumpLogs( $cond ) {
296  $where = [];
297  # Hide private logs
298  $hideLogs = LogEventsList::getExcludeClause( $this->db );
299  if ( $hideLogs ) {
300  $where[] = $hideLogs;
301  }
302  # Add on any caller specified conditions
303  if ( $cond ) {
304  $where[] = $cond;
305  }
306  # Get logging table name for logging.* clause
307  $logging = $this->db->tableName( 'logging' );
308 
309  $result = null; // Assuring $result is not undefined, if exception occurs early
310 
311  $commentQuery = CommentStore::getStore()->getJoin( 'log_comment' );
312  $actorQuery = ActorMigration::newMigration()->getJoin( 'log_user' );
313 
314  $lastLogId = 0;
315  while ( true ) {
316  $result = $this->db->select(
317  array_merge( [ 'logging' ], $commentQuery['tables'], $actorQuery['tables'], [ 'user' ] ),
318  [ "{$logging}.*", 'user_name' ] + $commentQuery['fields'] + $actorQuery['fields'],
319  array_merge( $where, [ 'log_id > ' . intval( $lastLogId ) ] ),
320  __METHOD__,
321  [
322  'ORDER BY' => 'log_id',
323  'USE INDEX' => [ 'logging' => 'PRIMARY' ],
324  'LIMIT' => self::BATCH_SIZE,
325  ],
326  [
327  'user' => [ 'JOIN', 'user_id = ' . $actorQuery['fields']['log_user'] ]
328  ] + $commentQuery['joins'] + $actorQuery['joins']
329  );
330 
331  if ( !$result->numRows() ) {
332  break;
333  }
334 
335  $lastLogId = $this->outputLogStream( $result );
336  }
337  }
338 
345  protected function dumpPages( $cond, $orderRevs ) {
347  if ( !( $wgMultiContentRevisionSchemaMigrationStage & SCHEMA_COMPAT_WRITE_OLD ) ) {
348  // TODO: Make XmlDumpWriter use a RevisionStore! (see T198706 and T174031)
349  throw new MWException(
350  'Cannot use WikiExporter with SCHEMA_COMPAT_WRITE_OLD mode disabled!'
351  . ' Support for dumping from the new schema is not implemented yet!'
352  );
353  }
354 
355  $revQuery = MediaWikiServicesAlias::getInstance()->getRevisionStore()->getQueryInfo(
356  [ 'page' ]
357  );
358  $slotQuery = MediaWikiServicesAlias::getInstance()->getRevisionStore()->getSlotsQueryInfo(
359  [ 'content' ]
360  );
361 
362  // We want page primary rather than revision.
363  // We also want to join in the slots and content tables.
364  // NOTE: This means we may get multiple rows per revision, and more rows
365  // than the batch size! Should be ok, since the max number of slots is
366  // fixed and low (dozens at worst).
367  $tables = array_merge( [ 'page' ], array_diff( $revQuery['tables'], [ 'page' ] ) );
368  $tables = array_merge( $tables, array_diff( $slotQuery['tables'], $tables ) );
369  $join = $revQuery['joins'] + [
370  'revision' => $revQuery['joins']['page'],
371  'slots' => [ 'JOIN', [ 'slot_revision_id = rev_id' ] ],
372  'content' => [ 'JOIN', [ 'content_id = slot_content_id' ] ],
373  ];
374  unset( $join['page'] );
375 
376  $fields = array_merge( $revQuery['fields'], $slotQuery['fields'] );
377  $fields[] = 'page_restrictions';
378 
379  if ( $this->text != self::STUB ) {
380  $fields['_load_content'] = '1';
381  }
382 
383  $conds = [];
384  if ( $cond !== '' ) {
385  $conds[] = $cond;
386  }
387  $opts = [ 'ORDER BY' => [ 'rev_page ASC', 'rev_id ASC' ] ];
388  $opts['USE INDEX'] = [];
389 
390  $op = '>';
391  if ( is_array( $this->history ) ) {
392  # Time offset/limit for all pages/history...
393  # Set time order
394  if ( $this->history['dir'] == 'asc' ) {
395  $opts['ORDER BY'] = 'rev_timestamp ASC';
396  } else {
397  $op = '<';
398  $opts['ORDER BY'] = 'rev_timestamp DESC';
399  }
400  # Set offset
401  if ( !empty( $this->history['offset'] ) ) {
402  $conds[] = "rev_timestamp $op " .
403  $this->db->addQuotes( $this->db->timestamp( $this->history['offset'] ) );
404  }
405  # Set query limit
406  if ( !empty( $this->history['limit'] ) ) {
407  $maxRowCount = intval( $this->history['limit'] );
408  }
409  } elseif ( $this->history & self::FULL ) {
410  # Full history dumps...
411  # query optimization for history stub dumps
412  if ( $this->text == self::STUB ) {
413  $opts[] = 'STRAIGHT_JOIN';
414  $opts['USE INDEX']['revision'] = 'rev_page_id';
415  unset( $join['revision'] );
416  $join['page'] = [ 'JOIN', 'rev_page=page_id' ];
417  }
418  } elseif ( $this->history & self::CURRENT ) {
419  # Latest revision dumps...
420  if ( $this->list_authors && $cond != '' ) { // List authors, if so desired
421  $this->do_list_authors( $cond );
422  }
423  $join['revision'] = [ 'JOIN', 'page_id=rev_page AND page_latest=rev_id' ];
424  $opts[ 'ORDER BY' ] = [ 'page_id ASC' ];
425  } elseif ( $this->history & self::STABLE ) {
426  # "Stable" revision dumps...
427  # Default JOIN, to be overridden...
428  $join['revision'] = [ 'JOIN', 'page_id=rev_page AND page_latest=rev_id' ];
429  # One, and only one hook should set this, and return false
430  if ( Hooks::run( 'WikiExporter::dumpStableQuery', [ &$tables, &$opts, &$join ] ) ) {
431  throw new MWException( __METHOD__ . " given invalid history dump type." );
432  }
433  } elseif ( $this->history & self::RANGE ) {
434  # Dump of revisions within a specified range. Condition already set in revsByRange().
435  } else {
436  # Unknown history specification parameter?
437  throw new MWException( __METHOD__ . " given invalid history dump type." );
438  }
439 
440  $result = null; // Assuring $result is not undefined, if exception occurs early
441  $done = false;
442  $lastRow = null;
443  $revPage = 0;
444  $revId = 0;
445  $rowCount = 0;
446 
447  $opts['LIMIT'] = self::BATCH_SIZE;
448 
449  Hooks::run( 'ModifyExportQuery',
450  [ $this->db, &$tables, &$cond, &$opts, &$join ] );
451 
452  while ( !$done ) {
453  // If necessary, impose the overall maximum and stop looping after this iteration.
454  if ( !empty( $maxRowCount ) && $rowCount + self::BATCH_SIZE > $maxRowCount ) {
455  $opts['LIMIT'] = $maxRowCount - $rowCount;
456  $done = true;
457  }
458 
459  $queryConds = $conds;
460  $queryConds[] = 'rev_page>' . intval( $revPage ) . ' OR (rev_page=' .
461  intval( $revPage ) . ' AND rev_id' . $op . intval( $revId ) . ')';
462 
463  # Do the query and process any results, remembering max ids for the next iteration.
464  $result = $this->db->select(
465  $tables,
466  $fields,
467  $queryConds,
468  __METHOD__,
469  $opts,
470  $join
471  );
472  if ( $result->numRows() > 0 ) {
473  $lastRow = $this->outputPageStreamBatch( $result, $lastRow );
474  $rowCount += $result->numRows();
475  $revPage = $lastRow->rev_page;
476  $revId = $lastRow->rev_id;
477  } else {
478  $done = true;
479  }
480 
481  // If we are finished, close off final page element (if any).
482  if ( $done && $lastRow ) {
483  $this->finishPageStreamOutput( $lastRow );
484  }
485  }
486  }
487 
497  protected function outputPageStreamBatch( $results, $lastRow ) {
498  $rowCarry = null;
499  while ( true ) {
500  $slotRows = $this->getSlotRowBatch( $results, $rowCarry );
501 
502  if ( !$slotRows ) {
503  break;
504  }
505 
506  // All revision info is present in all slot rows.
507  // Use the first slot row as the revision row.
508  $revRow = $slotRows[0];
509 
510  if ( $this->limitNamespaces &&
511  !in_array( $revRow->page_namespace, $this->limitNamespaces ) ) {
512  $lastRow = $revRow;
513  continue;
514  }
515 
516  if ( $lastRow === null ||
517  $lastRow->page_namespace !== $revRow->page_namespace ||
518  $lastRow->page_title !== $revRow->page_title ) {
519  if ( $lastRow !== null ) {
520  $output = '';
521  if ( $this->dumpUploads ) {
522  $output .= $this->writer->writeUploads( $lastRow, $this->dumpUploadFileContents );
523  }
524  $output .= $this->writer->closePage();
525  $this->sink->writeClosePage( $output );
526  }
527  $output = $this->writer->openPage( $revRow );
528  $this->sink->writeOpenPage( $revRow, $output );
529  }
530  $output = $this->writer->writeRevision( $revRow, $slotRows );
531  $this->sink->writeRevision( $revRow, $output );
532  $lastRow = $revRow;
533  }
534 
535  if ( $rowCarry ) {
536  throw new LogicException( 'Error while processing a stream of slot rows' );
537  }
538 
539  return $lastRow;
540  }
541 
551  protected function getSlotRowBatch( $results, &$carry = null ) {
552  $slotRows = [];
553  $prev = null;
554 
555  if ( $carry ) {
556  $slotRows[] = $carry;
557  $prev = $carry;
558  $carry = null;
559  }
560 
561  while ( $row = $results->fetchObject() ) {
562  if ( $prev && $prev->rev_id !== $row->rev_id ) {
563  $carry = $row;
564  break;
565  }
566  $slotRows[] = $row;
567  $prev = $row;
568  }
569 
570  return $slotRows;
571  }
572 
578  protected function finishPageStreamOutput( $lastRow ) {
579  $output = '';
580  if ( $this->dumpUploads ) {
581  $output .= $this->writer->writeUploads( $lastRow, $this->dumpUploadFileContents );
582  }
584  $output .= $this->writer->closePage();
585  $this->sink->writeClosePage( $output );
586  }
587 
592  protected function outputLogStream( $resultset ) {
593  foreach ( $resultset as $row ) {
594  $output = $this->writer->writeLogItem( $row );
595  $this->sink->writeLogItem( $row, $output );
596  }
597  return isset( $row ) ? $row->log_id : null;
598  }
599 }
const SCHEMA_COMPAT_WRITE_OLD
Definition: Defines.php:264
array null $limitNamespaces
DumpOutput $sink
bool $list_authors
Return distinct author list (when not returning full history)
int $wgMultiContentRevisionSchemaMigrationStage
RevisionStore table schema migration stage (content, slots, content_models & slot_roles tables)...
const WRITE_CONTENT
Output serialized revision content.
IDatabase $db
Apache License January AND DISTRIBUTION Definitions License shall mean the terms and conditions for use
setOutputSink(&$sink)
Set the DumpOutput or DumpFilter object which will receive various row objects and XML output for fil...
const WRITE_STUB
Only output subs for revision content.
logsByRange( $start, $end)
XmlDumpWriter $writer
allPages()
Dumps a series of page and revision records for all pages in the database, either including complete ...
string $author_list
This list may contain false positives That usually means there is additional text with links below the first Each row contains links to the first and second as well as the first line of the second redirect text
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:960
setSchemaVersion( $schemaVersion)
dumpPages( $cond, $orderRevs)
dumpLogs( $cond)
static configuration should be added through ResourceLoaderGetConfigVars instead can be used to get the real title e g db for database replication lag or jobqueue for job queue size converted to pseudo seconds It is possible to add more fields and they will be returned to the user in the API response after the basic globals have been set but before ordinary actions take place $output
Definition: hooks.txt:2204
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. 'ImgAuthModifyHeaders':Executed just before a file is streamed to a user via img_auth.php, allowing headers to be modified beforehand. $title:LinkTarget object & $headers:HTTP headers(name=> value, names are case insensitive). Two headers get special handling:If-Modified-Since(value must be a valid HTTP date) and Range(must be of the form "bytes=(\*-\*)") will be honored when streaming the file. '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:1969
finishPageStreamOutput( $lastRow)
Final page stream output, after all batches are complete.
const BATCH_SIZE
static newMigration()
Static constructor.
outputPageStreamBatch( $results, $lastRow)
Runs through a query result set dumping page, revision, and slot records.
$res
Definition: database.txt:21
$wgXmlDumpSchemaVersion
The schema to use per default when generating XML dumps.
array int $history
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:767
do_list_authors( $cond)
Generates the distinct list of authors of an article Not called by default (depends on $this->list_au...
namespace and then decline to actually register it file or subcat img or subcat $title
Definition: hooks.txt:912
static getQueryInfo( $options=[])
Return the tables, fields, and join conditions to be selected to create a new revision object...
Definition: Revision.php:511
pageByTitle( $title)
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
pageByName( $name)
revsByRange( $start, $end)
Dumps a series of page and revision records for those pages in the database with revisions falling wi...
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
getSlotRowBatch( $results, &$carry=null)
Returns all slot rows for a revision.
presenting them properly to the user as errors is done by the caller return true use this to change the list i e etc next in line in page history
Definition: hooks.txt:1747
const DELETED_USER
Definition: Revision.php:48
static getStore()
bool $dumpUploadFileContents
static getExcludeClause( $db, $audience='public', User $user=null)
SQL clause to skip forbidden log types for this user.
An extension writer
Definition: hooks.txt:51
static schemaVersion()
Returns the default export schema version, as defined by $wgXmlDumpSchemaVersion. ...
$revQuery
dumpFrom( $cond='', $orderRevs=false)
__construct( $db, $history=self::CURRENT, $text=self::TEXT, $limitNamespaces=null)
Allows to change the fields on the form that will be generated $name
Definition: hooks.txt:271
outputLogStream( $resultset)
pagesByName( $names)
pagesByRange( $start, $end, $orderRevs)
Dumps a series of page and revision records for those pages in the database falling within the page_i...
static run( $event, array $args=[], $deprecatedVersion=null)
Call hook functions defined in Hooks::register and $wgHooks.
Definition: Hooks.php:200
static newFromText( $text, $defaultNamespace=NS_MAIN)
Create a new Title from text, such as what one would find in a link.
Definition: Title.php:320