MediaWiki
1.33.0
|
Public Member Functions | |
__construct ( $db, $history=self::CURRENT, $text=self::TEXT) | |
allLogs () | |
allPages () | |
Dumps a series of page and revision records for all pages in the database, either including complete history or only the most recent version. More... | |
closeStream () | |
logsByRange ( $start, $end) | |
openStream () | |
pageByName ( $name) | |
pageByTitle ( $title) | |
pagesByName ( $names) | |
pagesByRange ( $start, $end, $orderRevs) | |
Dumps a series of page and revision records for those pages in the database falling within the page_id range given. More... | |
revsByRange ( $start, $end) | |
Dumps a series of page and revision records for those pages in the database with revisions falling within the rev_id range given. More... | |
setOutputSink (&$sink) | |
Set the DumpOutput or DumpFilter object which will receive various row objects and XML output for filtering. More... | |
setSchemaVersion ( $schemaVersion) | |
Static Public Member Functions | |
static | schemaVersion () |
Returns the default export schema version, as defined by $wgXmlDumpSchemaVersion. More... | |
Public Attributes | |
string | $author_list = "" |
bool | $dumpUploadFileContents = false |
bool | $dumpUploads = false |
bool | $list_authors = false |
Return distinct author list (when not returning full history) More... | |
DumpOutput | $sink |
int | $text |
const | BATCH_SIZE = 50000 |
const | CURRENT = 2 |
const | FULL = 1 |
const | LOGS = 8 |
const | RANGE = 16 |
const | STABLE = 4 |
const | STUB = 1 |
const | TEXT = 0 |
Protected Member Functions | |
do_list_authors ( $cond) | |
Generates the distinct list of authors of an article Not called by default (depends on $this->list_authors) Can be set by Special:Export when not exporting whole history. More... | |
dumpFrom ( $cond='', $orderRevs=false) | |
dumpLogs ( $cond) | |
dumpPages ( $cond, $orderRevs) | |
finishPageStreamOutput ( $lastRow) | |
Final page stream output, after all batches are complete. More... | |
outputLogStream ( $resultset) | |
outputPageStreamBatch ( $results, $lastRow) | |
Runs through a query result set dumping page and revision records. More... | |
Private Attributes | |
XmlDumpWriter | $writer |
Definition at line 36 of file WikiExporter.php.
WikiExporter::__construct | ( | $db, | |
$history = self::CURRENT , |
|||
$text = self::TEXT |
|||
) |
IDatabase | $db | |
int | array | $history | One of WikiExporter::FULL, WikiExporter::CURRENT, WikiExporter::RANGE or WikiExporter::STABLE, or an associative array:
|
int | $text | One of WikiExporter::TEXT or WikiExporter::STUB |
Definition at line 87 of file WikiExporter.php.
WikiExporter::allLogs | ( | ) |
Definition at line 203 of file WikiExporter.php.
References dumpFrom().
WikiExporter::allPages | ( | ) |
Dumps a series of page and revision records for all pages in the database, either including complete history or only the most recent version.
Definition at line 130 of file WikiExporter.php.
References dumpFrom().
WikiExporter::closeStream | ( | ) |
Definition at line 120 of file WikiExporter.php.
|
protected |
Generates the distinct list of authors of an article Not called by default (depends on $this->list_authors) Can be set by Special:Export when not exporting whole history.
array | $cond |
Definition at line 226 of file WikiExporter.php.
References $res, $revQuery, as, Revision\DELETED_USER, and Revision\getQueryInfo().
Referenced by dumpPages().
|
protected |
string | $cond | |
bool | $orderRevs |
MWException | |
Exception |
Definition at line 265 of file WikiExporter.php.
References dumpLogs(), dumpPages(), and history.
Referenced by allLogs(), allPages(), logsByRange(), pageByTitle(), pagesByRange(), and revsByRange().
|
protected |
string | $cond |
Exception |
Definition at line 277 of file WikiExporter.php.
References LogEventsList\getExcludeClause(), CommentStore\getStore(), ActorMigration\newMigration(), and outputLogStream().
Referenced by dumpFrom().
|
protected |
string | $cond | |
bool | $orderRevs |
MWException | |
Exception |
Definition at line 327 of file WikiExporter.php.
References $revQuery, $tables, $wgMultiContentRevisionSchemaMigrationStage, BATCH_SIZE, do_list_authors(), finishPageStreamOutput(), Revision\getQueryInfo(), history, outputPageStreamBatch(), Hooks\run(), SCHEMA_COMPAT_WRITE_OLD, and text.
Referenced by dumpFrom().
|
protected |
Final page stream output, after all batches are complete.
object | $lastRow | the last row output from the last batch (or null if none) |
Definition at line 498 of file WikiExporter.php.
References $author_list, $output, and writer.
Referenced by dumpPages().
WikiExporter::logsByRange | ( | $start, | |
$end | |||
) |
int | $start | |
int | $end |
Definition at line 211 of file WikiExporter.php.
References dumpFrom().
WikiExporter::openStream | ( | ) |
Definition at line 115 of file WikiExporter.php.
|
protected |
ResultWrapper | $resultset |
Definition at line 512 of file WikiExporter.php.
References $output, as, and writer.
Referenced by dumpLogs().
|
protected |
Runs through a query result set dumping page and revision records.
The result set should be sorted/grouped by page to avoid duplicate page records in the output.
ResultWrapper | $results | |
object | $lastRow | the last row output from the previous call (or null if none) |
Definition at line 469 of file WikiExporter.php.
References $output, as, and writer.
Referenced by dumpPages().
WikiExporter::pageByName | ( | $name | ) |
string | $name |
MWException |
Definition at line 185 of file WikiExporter.php.
References $name, $title, Title\newFromText(), and pageByTitle().
Referenced by pagesByName().
WikiExporter::pageByTitle | ( | $title | ) |
Title | $title |
Definition at line 175 of file WikiExporter.php.
References $title, and dumpFrom().
Referenced by pageByName().
WikiExporter::pagesByName | ( | $names | ) |
array | $names |
Definition at line 197 of file WikiExporter.php.
References $name, as, and pageByName().
WikiExporter::pagesByRange | ( | $start, | |
$end, | |||
$orderRevs | |||
) |
Dumps a series of page and revision records for those pages in the database falling within the page_id range given.
int | $start | Inclusive lower limit (this id is included) |
int | $end | Exclusive upper limit (this id is not included) If 0, no upper limit. |
bool | $orderRevs | order revisions within pages in ascending order |
Definition at line 142 of file WikiExporter.php.
References dumpFrom().
WikiExporter::revsByRange | ( | $start, | |
$end | |||
) |
Dumps a series of page and revision records for those pages in the database with revisions falling within the rev_id range given.
int | $start | Inclusive lower limit (this id is included) |
int | $end | Exclusive upper limit (this id is not included) If 0, no upper limit. |
Definition at line 164 of file WikiExporter.php.
References dumpFrom().
|
static |
Returns the default export schema version, as defined by $wgXmlDumpSchemaVersion.
Definition at line 73 of file WikiExporter.php.
References $wgXmlDumpSchemaVersion.
Referenced by BackupDumper\__construct(), MediaWiki\Tests\Maintenance\DumpTestCase\getDumpAsserter(), XmlDumpWriter\openStream(), BackupDumper\processOptions(), and ExportDemoTest\testExportDemo().
WikiExporter::setOutputSink | ( | & | $sink | ) |
Set the DumpOutput or DumpFilter object which will receive various row objects and XML output for filtering.
Filters can be chained or used as callbacks.
DumpOutput | &$sink |
Definition at line 111 of file WikiExporter.php.
References $sink.
WikiExporter::setSchemaVersion | ( | $schemaVersion | ) |
string | $schemaVersion | which schema version the generated XML should comply to. One of the values from self::$supportedSchemas, using the XML_DUMP_SCHEMA_VERSION_XX constants. |
Definition at line 100 of file WikiExporter.php.
string WikiExporter::$author_list = "" |
Definition at line 47 of file WikiExporter.php.
Referenced by finishPageStreamOutput().
bool WikiExporter::$dumpUploadFileContents = false |
Definition at line 44 of file WikiExporter.php.
bool WikiExporter::$dumpUploads = false |
Definition at line 41 of file WikiExporter.php.
bool WikiExporter::$list_authors = false |
Return distinct author list (when not returning full history)
Definition at line 38 of file WikiExporter.php.
DumpOutput WikiExporter::$sink |
Definition at line 64 of file WikiExporter.php.
Referenced by setOutputSink().
int WikiExporter::$text |
Definition at line 61 of file WikiExporter.php.
Referenced by __construct().
|
private |
Definition at line 67 of file WikiExporter.php.
const WikiExporter::BATCH_SIZE = 50000 |
Definition at line 58 of file WikiExporter.php.
Referenced by dumpPages().
const WikiExporter::CURRENT = 2 |
Definition at line 50 of file WikiExporter.php.
Referenced by SpecialExport\execute(), DumpBackup\execute(), BackupDumper\initProgress(), TextPassDumper\processOptions(), MediaWiki\Tests\Maintenance\BackupDumperPageTest\testCurrentStubGzip(), and MediaWiki\Tests\Maintenance\BackupDumperPageTest\testCurrentStubPlain().
const WikiExporter::FULL = 1 |
Definition at line 49 of file WikiExporter.php.
Referenced by SpecialExport\doExport(), SpecialExport\execute(), DumpBackup\execute(), TextPassDumper\processOptions(), ExportTest\testPageByTitle(), MediaWiki\Tests\Maintenance\TextPassDumperDatabaseTest\testPlain(), MediaWiki\Tests\Maintenance\TextPassDumperDatabaseTest\testPrefetchPlain(), and MediaWiki\Tests\Maintenance\BackupDumperPageTest\testXmlDumpsBackupUseCase().
const WikiExporter::LOGS = 8 |
Definition at line 52 of file WikiExporter.php.
Referenced by BackupDumper\dump(), DumpBackup\execute(), and MediaWiki\Tests\Maintenance\BackupDumperLoggerTest\testPlain().
const WikiExporter::RANGE = 16 |
Definition at line 53 of file WikiExporter.php.
Referenced by DumpBackup\execute().
const WikiExporter::STABLE = 4 |
Definition at line 51 of file WikiExporter.php.
Referenced by DumpBackup\execute().
const WikiExporter::STUB = 1 |
Definition at line 56 of file WikiExporter.php.
Referenced by DumpBackup\execute(), MediaWiki\Tests\Maintenance\BackupDumperPageTest\testCurrentStubGzip(), MediaWiki\Tests\Maintenance\BackupDumperPageTest\testCurrentStubPlain(), and MediaWiki\Tests\Maintenance\BackupDumperPageTest\testXmlDumpsBackupUseCase().
const WikiExporter::TEXT = 0 |