MediaWiki REL1_34
|
Public Member Functions | |
__construct ( $contentMode=self::WRITE_CONTENT, $schemaVersion=XML_DUMP_SCHEMA_VERSION_11) | |
XmlDumpWriter constructor. | |
caseSetting () | |
closePage () | |
Closes a "<page>" section on the output stream. | |
closeStream () | |
Closes the output stream with the closing root element. | |
dbname () | |
generator () | |
homelink () | |
namespaces () | |
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. | |
siteInfo () | |
sitename () | |
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=" ") | |
writeUpload ( $file, $dumpContents=false) | |
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. | |
const | WRITE_STUB_DELETED = 2 |
Only output subs for revision content, indicating that the content has been deleted/suppressed. | |
Static Public Attributes | |
static string[] | $supportedSchemas |
the schema versions supported for output @final | |
Private Member Functions | |
getBlobStore () | |
getRevisionStore () | |
invokeLenient ( $obj, $method, $args=[], $warning) | |
Invokes the given method on the given object, catching and logging any storage related exceptions. | |
writeSlot (SlotRecord $slot, $contentMode) | |
writeText (Content $content, $textAttributes, $indent) | |
Private Attributes | |
int | $contentMode |
Whether to output revision content or just stubs. | |
Title null | $currentTitle = null |
Title of the currently processed page. | |
string | $schemaVersion |
which schema version the generated XML should comply to. | |
Definition at line 36 of file XmlDumpWriter.php.
XmlDumpWriter::__construct | ( | $contentMode = self::WRITE_CONTENT, | |
$schemaVersion = XML_DUMP_SCHEMA_VERSION_11 ) |
XmlDumpWriter constructor.
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 86 of file XmlDumpWriter.php.
References $contentMode, and $schemaVersion.
|
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 709 of file XmlDumpWriter.php.
References $title.
Referenced by openPage().
XmlDumpWriter::caseSetting | ( | ) |
Definition at line 191 of file XmlDumpWriter.php.
References $wgCapitalLinks.
Referenced by siteInfo().
XmlDumpWriter::closePage | ( | ) |
Closes a "<page>" section on the output stream.
Definition at line 270 of file XmlDumpWriter.php.
XmlDumpWriter::closeStream | ( | ) |
Closes the output stream with the closing root element.
Call when finished dumping things.
Definition at line 226 of file XmlDumpWriter.php.
XmlDumpWriter::dbname | ( | ) |
Definition at line 168 of file XmlDumpWriter.php.
References $wgDBname.
Referenced by siteInfo().
XmlDumpWriter::generator | ( | ) |
Definition at line 176 of file XmlDumpWriter.php.
References $wgVersion.
Referenced by siteInfo().
|
private |
|
private |
Definition at line 283 of file XmlDumpWriter.php.
Referenced by writeRevision().
XmlDumpWriter::homelink | ( | ) |
|
private |
Invokes the given method on the given object, catching and logging any storage related exceptions.
object | $obj | |
string | $method | |
array | $args | |
string | $warning | The warning to output in case of a storage related exception. |
Exception |
Definition at line 307 of file XmlDumpWriter.php.
References $args.
Referenced by writeRevision(), and writeSlot().
XmlDumpWriter::namespaces | ( | ) |
Definition at line 201 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 237 of file XmlDumpWriter.php.
References canonicalTitle(), 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 117 of file XmlDumpWriter.php.
References $schemaVersion, and siteInfo().
XmlDumpWriter::siteInfo | ( | ) |
Definition at line 144 of file XmlDumpWriter.php.
References caseSetting(), dbname(), generator(), homelink(), namespaces(), and sitename().
Referenced by openStream().
XmlDumpWriter::sitename | ( | ) |
Definition at line 160 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 620 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 565 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 335 of file XmlDumpWriter.php.
References $content, $contentMode, getRevisionStore(), invokeLenient(), WRITE_STUB_DELETED, writeContributor(), writeSlot(), and writeTimestamp().
|
private |
SlotRecord | $slot | |
int | $contentMode | see the WRITE_XXX constants |
Definition at line 422 of file XmlDumpWriter.php.
References $content, $contentMode, MediaWiki\Revision\SlotRecord\getAddress(), getBlobStore(), MediaWiki\Revision\SlotRecord\getModel(), MediaWiki\Revision\SlotRecord\getOrigin(), MediaWiki\Revision\SlotRecord\getRevision(), MediaWiki\Revision\SlotRecord\getRole(), invokeLenient(), writeText(), and XML_DUMP_SCHEMA_VERSION_11.
Referenced by writeRevision().
|
private |
Content | $content | |
string[] | $textAttributes | |
string | $indent |
Definition at line 536 of file XmlDumpWriter.php.
References $content.
Referenced by writeSlot().
XmlDumpWriter::writeTimestamp | ( | $timestamp, | |
$indent = " " ) |
string | $timestamp | |
string | $indent | Default to six spaces |
Definition at line 609 of file XmlDumpWriter.php.
References wfTimestamp().
Referenced by writeLogItem(), writeRevision(), and writeUpload().
XmlDumpWriter::writeUpload | ( | $file, | |
$dumpContents = false ) |
File | $file | |
bool | $dumpContents |
Definition at line 659 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 638 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 76 of file XmlDumpWriter.php.
Referenced by __construct(), writeRevision(), and writeSlot().
|
private |
Title of the currently processed page.
Definition at line 71 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 64 of file XmlDumpWriter.php.
Referenced by __construct(), and openStream().
|
static |
the schema versions supported for output @final
Definition at line 54 of file XmlDumpWriter.php.
Referenced by ApiQuery\getAllowedParams(), and BackupDumper\processOptions().
const XmlDumpWriter::WRITE_CONTENT = 0 |
Output serialized revision content.
Definition at line 39 of file XmlDumpWriter.php.
Referenced by TextPassDumper\dump().
const XmlDumpWriter::WRITE_STUB = 1 |
Only output subs for revision content.
Definition at line 42 of file XmlDumpWriter.php.
const XmlDumpWriter::WRITE_STUB_DELETED = 2 |
Only output subs for revision content, indicating that the content has been deleted/suppressed.
For internal use only.
Definition at line 48 of file XmlDumpWriter.php.
Referenced by writeRevision().