|
MediaWiki REL1_35
|

Public Member Functions | |
| __construct ( $contentMode=self::WRITE_CONTENT, $schemaVersion=XML_DUMP_SCHEMA_VERSION_11) | |
| closePage () | |
| Closes a "<page>" section on the output stream. | |
| closeStream () | |
| Closes the output stream with the closing root element. | |
| openPage ( $row) | |
| Opens a "<page>" section on the output stream, with data from the given database row. | |
| openStream () | |
| Opens the XML output stream's root "<mediawiki>" element. | |
| writeContributor ( $id, $text, $indent=" ") | |
| writeLogItem ( $row) | |
| Dumps a "<logitem>" section on the output stream, with data filled in from the given database row. | |
| writeRevision ( $row, $slotRows=null) | |
| Dumps a "<revision>" section on the output stream, with data filled in from the given database row. | |
| writeTimestamp ( $timestamp, $indent=" ") | |
| writeUploads ( $row, $dumpContents=false) | |
| Warning! This data is potentially inconsistent. | |
Static Public Member Functions | |
| static | canonicalTitle (Title $title) |
| Return prefixed text form of title, but using the content language's canonical namespace. | |
Public Attributes | |
| const | WRITE_CONTENT = 0 |
| Output serialized revision content. | |
| const | WRITE_STUB = 1 |
| Only output subs for revision content. | |
Static Public Attributes | |
| static string[] | $supportedSchemas |
| the schema versions supported for output @final | |
Private Member Functions | |
| caseSetting () | |
| dbname () | |
| generator () | |
| getBlobStore () | |
| getRevisionStore () | |
| homelink () | |
| invokeLenient ( $callback, $warning) | |
| Invokes the given callback, catching and logging any storage related exceptions. | |
| namespaces () | |
| siteInfo () | |
| sitename () | |
| writeSlot (SlotRecord $slot, $contentMode) | |
| writeText (Content $content, $textAttributes, $indent) | |
| writeUpload ( $file, $dumpContents=false) | |
Private Attributes | |
| int | $contentMode |
| Whether to output revision content or just stubs. | |
| Title null | $currentTitle = null |
| Title of the currently processed page. | |
| HookRunner | $hookRunner |
| string | $schemaVersion |
| which schema version the generated XML should comply to. | |
| const | WRITE_STUB_DELETED = 2 |
| Only output subs for revision content, indicating that the content has been deleted/suppressed. | |
Definition at line 39 of file XmlDumpWriter.php.
| XmlDumpWriter::__construct | ( | $contentMode = self::WRITE_CONTENT, |
|
$schemaVersion = XML_DUMP_SCHEMA_VERSION_11 |
|||
| ) |
| int | $contentMode | WRITE_CONTENT or WRITE_STUB. |
| 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 90 of file XmlDumpWriter.php.
|
static |
Return prefixed text form of title, but using the content language's canonical namespace.
This skips any special-casing such as gendered user namespaces – which while useful, are not yet listed in the XML "<siteinfo>" data so are unsafe in export.
| Title | $title |
Definition at line 727 of file XmlDumpWriter.php.
References $title.
|
private |
Definition at line 195 of file XmlDumpWriter.php.
References $wgCapitalLinks.
Referenced by siteInfo().
| XmlDumpWriter::closePage | ( | ) |
Closes a "<page>" section on the output stream.
Definition at line 279 of file XmlDumpWriter.php.
| XmlDumpWriter::closeStream | ( | ) |
Closes the output stream with the closing root element.
Call when finished dumping things.
Definition at line 230 of file XmlDumpWriter.php.
|
private |
Definition at line 173 of file XmlDumpWriter.php.
References $wgDBname.
Referenced by siteInfo().
|
private |
Definition at line 181 of file XmlDumpWriter.php.
References MW_VERSION.
Referenced by siteInfo().
|
private |
|
private |
Definition at line 292 of file XmlDumpWriter.php.
Referenced by writeRevision().
|
private |
|
private |
Invokes the given callback, catching and logging any storage related exceptions.
| callable | $callback | |
| string | $warning | The warning to output in case of a storage related exception. |
| Exception |
Definition at line 314 of file XmlDumpWriter.php.
Referenced by openPage(), writeRevision(), and writeSlot().
|
private |
Definition at line 205 of file XmlDumpWriter.php.
References $title.
Referenced by siteInfo().
| XmlDumpWriter::openPage | ( | $row | ) |
Opens a "<page>" section on the output stream, with data from the given database row.
| object | $row |
Definition at line 241 of file XmlDumpWriter.php.
References invokeLenient(), and Title\isValidRedirectTarget().
| XmlDumpWriter::openStream | ( | ) |
Opens the XML output stream's root "<mediawiki>" element.
This does not include an xml directive, so is safe to include as a subelement in a larger XML stream. Namespace and XML Schema references are included.
Output will be encoded in UTF-8.
Definition at line 122 of file XmlDumpWriter.php.
References siteInfo().
|
private |
Definition at line 149 of file XmlDumpWriter.php.
References caseSetting(), dbname(), generator(), homelink(), namespaces(), and sitename().
Referenced by openStream().
|
private |
Definition at line 165 of file XmlDumpWriter.php.
References $wgSitename.
Referenced by siteInfo().
| XmlDumpWriter::writeContributor | ( | $id, | |
| $text, | |||
$indent = " " |
|||
| ) |
| int | $id | |
| string | $text | |
| string | $indent | Default to six spaces |
Definition at line 638 of file XmlDumpWriter.php.
Referenced by writeLogItem(), writeRevision(), and writeUpload().
| XmlDumpWriter::writeLogItem | ( | $row | ) |
Dumps a "<logitem>" section on the output stream, with data filled in from the given database row.
| object | $row |
Definition at line 583 of file XmlDumpWriter.php.
References $title, LogPage\DELETED_ACTION, LogPage\DELETED_COMMENT, LogPage\DELETED_USER, writeContributor(), and writeTimestamp().
| XmlDumpWriter::writeRevision | ( | $row, | |
$slotRows = null |
|||
| ) |
Dumps a "<revision>" section on the output stream, with data filled in from the given database row.
| object | $row | |
| null | object[] | $slotRows |
| FatalError | |
| MWException |
Definition at line 341 of file XmlDumpWriter.php.
References $content, getRevisionStore(), invokeLenient(), writeContributor(), writeSlot(), and writeTimestamp().
|
private |
| SlotRecord | $slot | |
| int | $contentMode | see the WRITE_XXX constants |
Definition at line 437 of file XmlDumpWriter.php.
References $content, MediaWiki\Revision\SlotRecord\getAddress(), getBlobStore(), MediaWiki\Revision\SlotRecord\getContent(), MediaWiki\Revision\SlotRecord\getModel(), MediaWiki\Revision\SlotRecord\getOrigin(), MediaWiki\Revision\SlotRecord\getRevision(), MediaWiki\Revision\SlotRecord\getRole(), MediaWiki\Revision\SlotRecord\getSha1(), MediaWiki\Revision\SlotRecord\getSize(), invokeLenient(), writeText(), and XML_DUMP_SCHEMA_VERSION_11.
Referenced by writeRevision().
|
private |
| Content | $content | |
| string[] | $textAttributes | |
| string | $indent |
Definition at line 554 of file XmlDumpWriter.php.
References $content.
Referenced by writeSlot().
| XmlDumpWriter::writeTimestamp | ( | $timestamp, | |
$indent = " " |
|||
| ) |
| string | $timestamp | |
| string | $indent | Default to six spaces |
Definition at line 627 of file XmlDumpWriter.php.
References wfTimestamp().
Referenced by writeLogItem(), writeRevision(), and writeUpload().
|
private |
| File | $file | |
| bool | $dumpContents |
Definition at line 677 of file XmlDumpWriter.php.
References $file, writeContributor(), and writeTimestamp().
Referenced by writeUploads().
| XmlDumpWriter::writeUploads | ( | $row, | |
$dumpContents = false |
|||
| ) |
Warning! This data is potentially inconsistent.
:(
| object | $row | |
| bool | $dumpContents |
Definition at line 656 of file XmlDumpWriter.php.
References NS_FILE, and writeUpload().
|
private |
Whether to output revision content or just stubs.
WRITE_CONTENT or WRITE_STUB.
Definition at line 79 of file XmlDumpWriter.php.
|
private |
Title of the currently processed page.
Definition at line 74 of file XmlDumpWriter.php.
|
private |
Definition at line 82 of file XmlDumpWriter.php.
|
private |
which schema version the generated XML should comply to.
One of the values from self::$supportedSchemas, using the SCHEMA_VERSION_XX constants.
Definition at line 67 of file XmlDumpWriter.php.
|
static |
the schema versions supported for output @final
Definition at line 57 of file XmlDumpWriter.php.
| const XmlDumpWriter::WRITE_CONTENT = 0 |
Output serialized revision content.
Definition at line 42 of file XmlDumpWriter.php.
| const XmlDumpWriter::WRITE_STUB = 1 |
Only output subs for revision content.
Definition at line 45 of file XmlDumpWriter.php.
|
private |
Only output subs for revision content, indicating that the content has been deleted/suppressed.
Definition at line 51 of file XmlDumpWriter.php.