MediaWiki master
|
Public Member Functions | |
__construct ( $contentMode=self::WRITE_CONTENT, $schemaVersion=XML_DUMP_SCHEMA_VERSION_11, ?HookContainer $hookContainer=null, ?CommentStore $commentStore=null) | |
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 | |
Definition at line 48 of file XmlDumpWriter.php.
XmlDumpWriter::__construct | ( | $contentMode = self::WRITE_CONTENT, | |
$schemaVersion = XML_DUMP_SCHEMA_VERSION_11, | |||
?HookContainer | $hookContainer = null, | ||
?CommentStore | $commentStore = null ) |
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. |
HookContainer | null | $hookContainer | |
CommentStore | null | $commentStore |
Definition at line 104 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 743 of file XmlDumpWriter.php.
References MediaWiki\Title\Title\getNamespace(), MediaWiki\Title\Title\getPrefixedText(), MediaWiki\Title\Title\getText(), and MediaWiki\Linker\LinkTarget\isExternal().
XmlDumpWriter::closePage | ( | ) |
Closes a "<page>" section on the output stream.
Definition at line 297 of file XmlDumpWriter.php.
XmlDumpWriter::closeStream | ( | ) |
Closes the output stream with the closing root element.
Call when finished dumping things.
Definition at line 251 of file XmlDumpWriter.php.
XmlDumpWriter::openPage | ( | $row | ) |
Opens a "<page>" section on the output stream, with data from the given database row.
stdClass | $row |
Definition at line 262 of file XmlDumpWriter.php.
References MediaWiki\Title\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 141 of file XmlDumpWriter.php.
XmlDumpWriter::writeContributor | ( | $id, | |
$text, | |||
$indent = " " ) |
int | $id | |
string | $text | |
string | $indent | Default to six spaces |
Definition at line 647 of file XmlDumpWriter.php.
Referenced by writeLogItem(), and writeRevision().
XmlDumpWriter::writeLogItem | ( | $row | ) |
Dumps a "<logitem>" section on the output stream, with data filled in from the given database row.
stdClass | $row |
Definition at line 592 of file XmlDumpWriter.php.
References 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.
stdClass | $row | |
null | stdClass[] | $slotRows |
RevisionAccessException |
Definition at line 352 of file XmlDumpWriter.php.
References writeContributor(), and writeTimestamp().
XmlDumpWriter::writeTimestamp | ( | $timestamp, | |
$indent = " " ) |
string | $timestamp | |
string | $indent | Default to six spaces |
Definition at line 636 of file XmlDumpWriter.php.
References wfTimestamp().
Referenced by writeLogItem(), and writeRevision().
XmlDumpWriter::writeUploads | ( | $row, | |
$dumpContents = false ) |
Warning! This data is potentially inconsistent.
:(
stdClass | $row | |
bool | $dumpContents |
Definition at line 665 of file XmlDumpWriter.php.
References NS_FILE.
|
static |
the schema versions supported for output @final
Definition at line 66 of file XmlDumpWriter.php.
Referenced by MediaWiki\Api\ApiQuery\getAllowedParams().
const XmlDumpWriter::WRITE_CONTENT = 0 |
Output serialized revision content.
Definition at line 51 of file XmlDumpWriter.php.
const XmlDumpWriter::WRITE_STUB = 1 |
Only output subs for revision content.
Definition at line 54 of file XmlDumpWriter.php.