MediaWiki  1.23.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...
 
 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...
 
 schemaVersion ()
 Returns the export schema version. 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 476 of file Export.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 870 of file Export.php.

References $title, $wgContLang, and global.

◆ caseSetting()

XmlDumpWriter::caseSetting ( )
Returns
string

Definition at line 554 of file Export.php.

References array(), Xml\element(), and global.

Referenced by siteInfo().

◆ closePage()

XmlDumpWriter::closePage ( )

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

Access:\n private
Returns
string

Definition at line 628 of file Export.php.

◆ closeStream()

XmlDumpWriter::closeStream ( )

Closes the output stream with the closing root element.

Call when finished dumping things.

Returns
string

Definition at line 585 of file Export.php.

◆ generator()

XmlDumpWriter::generator ( )
Returns
string

Definition at line 539 of file Export.php.

References array(), Xml\element(), and global.

Referenced by siteInfo().

◆ homelink()

XmlDumpWriter::homelink ( )
Returns
string

Definition at line 547 of file Export.php.

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

Referenced by siteInfo().

◆ namespaces()

XmlDumpWriter::namespaces ( )
Returns
string

Definition at line 564 of file Export.php.

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

Referenced by siteInfo().

◆ openPage()

XmlDumpWriter::openPage (   $row)

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

Parameters
$rowobject
Returns
string

Definition at line 596 of file Export.php.

References $out, $title, array(), Xml\element(), Xml\elementClean(), WikiPage\factory(), Title\isValidRedirectTarget(), Title\makeTitle(), and wfRunHooks().

◆ 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 497 of file Export.php.

References array(), Xml\element(), global, WikiExporter\schemaVersion(), siteInfo(), there, up, and version.

◆ schemaVersion()

XmlDumpWriter::schemaVersion ( )

Returns the export schema version.

Deprecated:
in 1.20; use WikiExporter::schemaVersion() instead
Returns
string

Definition at line 482 of file Export.php.

References WikiExporter\schemaVersion(), and wfDeprecated().

◆ siteInfo()

XmlDumpWriter::siteInfo ( )
Returns
string

Definition at line 516 of file Export.php.

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

Referenced by openStream().

◆ sitename()

XmlDumpWriter::sitename ( )
Returns
string

Definition at line 531 of file Export.php.

References array(), Xml\element(), and global.

Referenced by siteInfo().

◆ writeContributor()

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

Definition at line 784 of file Export.php.

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

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
$rowobject
Returns
string
Access:\n private

Definition at line 729 of file Export.php.

References $out, $title, array(), LogPage\DELETED_ACTION, LogPage\DELETED_COMMENT, LogPage\DELETED_USER, Xml\element(), Xml\elementClean(), Title\makeTitle(), wfProfileIn(), wfProfileOut(), 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
$rowobject
Returns
string
Access:\n private

Definition at line 640 of file Export.php.

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

◆ writeTimestamp()

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

Definition at line 773 of file Export.php.

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

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

◆ writeUpload()

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

Definition at line 822 of file Export.php.

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

Referenced by writeUploads().

◆ writeUploads()

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

Warning! This data is potentially inconsistent.

:(

Parameters
$row
$dumpContentsbool
Returns
string

Definition at line 802 of file Export.php.

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


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