MediaWiki REL1_32
XmlDumpWriter Class Reference

Public Member Functions

 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)
 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.
 

Detailed Description

Definition at line 31 of file XmlDumpWriter.php.

Member Function Documentation

◆ canonicalTitle()

static XmlDumpWriter::canonicalTitle ( Title $title)
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.

Parameters
Title$title
Returns
string
Since
1.18

Definition at line 435 of file XmlDumpWriter.php.

◆ caseSetting()

XmlDumpWriter::caseSetting ( )
Returns
string

Definition at line 116 of file XmlDumpWriter.php.

References $wgCapitalLinks.

Referenced by siteInfo().

◆ closePage()

XmlDumpWriter::closePage ( )

Closes a "<page>" section on the output stream.

Access:\n private
Returns
string

Definition at line 192 of file XmlDumpWriter.php.

◆ closeStream()

XmlDumpWriter::closeStream ( )

Closes the output stream with the closing root element.

Call when finished dumping things.

Returns
string

Definition at line 149 of file XmlDumpWriter.php.

◆ dbname()

XmlDumpWriter::dbname ( )
Returns
string

Definition at line 93 of file XmlDumpWriter.php.

References $wgDBname.

Referenced by siteInfo().

◆ generator()

XmlDumpWriter::generator ( )
Returns
string

Definition at line 101 of file XmlDumpWriter.php.

References $wgVersion.

Referenced by siteInfo().

◆ homelink()

XmlDumpWriter::homelink ( )
Returns
string

Definition at line 109 of file XmlDumpWriter.php.

Referenced by siteInfo().

◆ namespaces()

XmlDumpWriter::namespaces ( )
Returns
string

Definition at line 126 of file XmlDumpWriter.php.

References $title.

Referenced by siteInfo().

◆ openPage()

XmlDumpWriter::openPage ( $row)

Opens a "<page>" section on the output stream, with data from the given database row.

Parameters
object$row
Returns
string

Definition at line 160 of file XmlDumpWriter.php.

References $out, and Title\isValidRedirectTarget().

◆ openStream()

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.

Returns
string

Definition at line 42 of file XmlDumpWriter.php.

References siteInfo().

◆ siteInfo()

XmlDumpWriter::siteInfo ( )
Returns
string

Definition at line 69 of file XmlDumpWriter.php.

References caseSetting(), dbname(), generator(), homelink(), namespaces(), and sitename().

Referenced by openStream().

◆ sitename()

XmlDumpWriter::sitename ( )
Returns
string

Definition at line 85 of file XmlDumpWriter.php.

References $wgSitename.

Referenced by siteInfo().

◆ writeContributor()

XmlDumpWriter::writeContributor ( $id,
$text,
$indent = "      " )
Parameters
int$id
string$text
string$indentDefault to six spaces
Returns
string

Definition at line 349 of file XmlDumpWriter.php.

References $out.

Referenced by writeLogItem(), writeRevision(), and writeUpload().

◆ writeLogItem()

XmlDumpWriter::writeLogItem ( $row)

Dumps a "<logitem>" section on the output stream, with data filled in from the given database row.

Parameters
object$row
Returns
string
Access:\n private

Definition at line 294 of file XmlDumpWriter.php.

References $out, LogPage\DELETED_ACTION, LogPage\DELETED_COMMENT, LogPage\DELETED_USER, writeContributor(), and writeTimestamp().

◆ writeRevision()

XmlDumpWriter::writeRevision ( $row)

Dumps a "<revision>" section on the output stream, with data filled in from the given database row.

Parameters
object$row
Returns
string
Access:\n private

Definition at line 204 of file XmlDumpWriter.php.

References $out, Revision\DELETED_COMMENT, Revision\DELETED_TEXT, Revision\DELETED_USER, Revision\getRevisionText(), writeContributor(), and writeTimestamp().

◆ writeTimestamp()

XmlDumpWriter::writeTimestamp ( $timestamp,
$indent = "      " )
Parameters
string$timestamp
string$indentDefault to six spaces
Returns
string

Definition at line 338 of file XmlDumpWriter.php.

References wfTimestamp().

Referenced by writeLogItem(), writeRevision(), and writeUpload().

◆ writeUpload()

XmlDumpWriter::writeUpload ( $file,
$dumpContents = false )
Parameters
File$file
bool$dumpContents
Returns
string

Definition at line 387 of file XmlDumpWriter.php.

References File\DELETED_COMMENT, writeContributor(), and writeTimestamp().

Referenced by writeUploads().

◆ writeUploads()

XmlDumpWriter::writeUploads ( $row,
$dumpContents = false )

Warning! This data is potentially inconsistent.

:(

Parameters
object$row
bool$dumpContents
Returns
string

Definition at line 367 of file XmlDumpWriter.php.

References $out, NS_FILE, wfLocalFile(), and writeUpload().


The documentation for this class was generated from the following file: