MediaWiki  1.28.0
XmlDumpWriter Class Reference

Public Member Functions

 caseSetting ()
 
 closePage ()
 Closes a "<page>" section on the output stream. More...
 
 closeStream ()
 Closes the output stream with the closing root element. More...
 
 dbname ()
 
 generator ()
 
 homelink ()
 
 namespaces ()
 
 openPage ($row)
 Opens a "<page>" section on the output stream, with data from the given database row. More...
 
 openStream ()
 Opens the XML output stream's root "<mediawiki>" element. More...
 
 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. More...
 
 writeRevision ($row)
 Dumps a "<revision>" section on the output stream, with data filled in from the given database row. More...
 
 writeTimestamp ($timestamp, $indent=" ")
 
 writeUpload ($file, $dumpContents=false)
 
 writeUploads ($row, $dumpContents=false)
 Warning! This data is potentially inconsistent. More...
 

Static Public Member Functions

static canonicalTitle (Title $title)
 Return prefixed text form of title, but using the content language's canonical namespace. More...
 

Detailed Description

Definition at line 29 of file XmlDumpWriter.php.

Member Function Documentation

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 426 of file XmlDumpWriter.php.

References $wgContLang, Title\getNamespace(), Title\getPrefixedText(), Title\getText(), global, and Title\isExternal().

XmlDumpWriter::caseSetting ( )
Returns
string

Definition at line 115 of file XmlDumpWriter.php.

References $wgCapitalLinks, Xml\element(), and global.

Referenced by siteInfo().

XmlDumpWriter::closePage ( )

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

Access:
private
Returns
string

Definition at line 189 of file XmlDumpWriter.php.

XmlDumpWriter::closeStream ( )

Closes the output stream with the closing root element.

Call when finished dumping things.

Returns
string

Definition at line 146 of file XmlDumpWriter.php.

XmlDumpWriter::dbname ( )
Returns
string

Definition at line 92 of file XmlDumpWriter.php.

References $wgDBname, Xml\element(), and global.

Referenced by siteInfo().

XmlDumpWriter::generator ( )
Returns
string

Definition at line 100 of file XmlDumpWriter.php.

References $wgVersion, Xml\element(), and global.

Referenced by siteInfo().

XmlDumpWriter::homelink ( )
Returns
string

Definition at line 108 of file XmlDumpWriter.php.

References Xml\element(), and Title\newMainPage().

Referenced by siteInfo().

XmlDumpWriter::namespaces ( )
Returns
string

Definition at line 125 of file XmlDumpWriter.php.

References $title, $wgContLang, as, Xml\element(), global, and MWNamespace\isCapitalized().

Referenced by siteInfo().

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 157 of file XmlDumpWriter.php.

References $out, $page, $title, Xml\element(), Xml\elementClean(), WikiPage\factory(), Title\makeTitle(), and Hooks\run().

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 40 of file XmlDumpWriter.php.

References $wgLanguageCode, Xml\element(), global, WikiExporter\schemaVersion(), and siteInfo().

XmlDumpWriter::siteInfo ( )
Returns
string

Definition at line 68 of file XmlDumpWriter.php.

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

Referenced by openStream().

XmlDumpWriter::sitename ( )
Returns
string

Definition at line 84 of file XmlDumpWriter.php.

References $wgSitename, Xml\element(), and global.

Referenced by siteInfo().

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

Definition at line 340 of file XmlDumpWriter.php.

References $out, Xml\element(), Xml\elementClean(), and IP\isValid().

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.

Parameters
object$row
Returns
string
Access:
private

Definition at line 287 of file XmlDumpWriter.php.

References $out, $title, LogPage\DELETED_ACTION, LogPage\DELETED_COMMENT, LogPage\DELETED_USER, Xml\element(), Xml\elementClean(), Title\makeTitle(), writeContributor(), and writeTimestamp().

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:
private

Definition at line 201 of file XmlDumpWriter.php.

References $out, $title, Revision\DELETED_COMMENT, Revision\DELETED_TEXT, Revision\DELETED_USER, Xml\element(), Xml\elementClean(), ContentHandler\getDefaultModelFor(), ContentHandler\getForModelID(), Revision\getRevisionText(), Title\makeTitle(), Hooks\run(), writeContributor(), and writeTimestamp().

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

Definition at line 329 of file XmlDumpWriter.php.

References $timestamp, Xml\element(), TS_ISO_8601, and wfTimestamp().

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

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

Definition at line 378 of file XmlDumpWriter.php.

References $comment, File\DELETED_COMMENT, Xml\element(), Xml\elementClean(), writeContributor(), and writeTimestamp().

Referenced by writeUploads().

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

Warning! This data is potentially inconsistent.

:(

Parameters
object$row
bool$dumpContents
Returns
string

Definition at line 358 of file XmlDumpWriter.php.

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


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