MediaWiki  1.23.2
TextPassDumper Class Reference
Inheritance diagram for TextPassDumper:
Collaboration diagram for TextPassDumper:

Public Member Functions

 characterData ( $parser, $data)
 
 checkIfTimeExceeded ()
 
 clearOpenElement ( $style)
 
 dump ( $history, $text=WikiExporter::TEXT)
 
 endElement ( $parser, $name)
 
 finalOptionCheck ()
 
 getText ( $id)
 Tries to get the revision text for a revision id. More...
 
 initProgress ( $history=WikiExporter::FULL)
 Initialise starting time and maximum revision count. More...
 
 openSpawn ()
 
 processFileOpt ( $val, $param)
 
 processOption ( $opt, $val, $param)
 
 readDump ( $input)
 
 rotateDb ()
 Drop the database connection $this->db and try to get a new one. More...
 
 setTimeExceeded ()
 
 showReport ()
 Overridden to include prefetch ratio if enabled. More...
 
 startElement ( $parser, $name, $attribs)
 
- Public Member Functions inherited from BackupDumper
 __construct ( $args)
 
 __destruct ()
 
 backupDb ()
 
 backupServer ()
 
 fatalError ( $msg)
 
 loadPlugin ( $class, $file)
 Load a plugin and register it. More...
 
 processArgs ( $args)
 
 progress ( $string)
 
 registerFilter ( $name, $class)
 
 registerOutput ( $name, $class)
 
 report ( $final=false)
 
 reportPage ()
 
 revCount ()
 
 setDb (DatabaseBase $db=null)
 Force the dump to use the provided database connection for database operations, wherever possible. More...
 

Public Attributes

 $checkpointFiles = array()
 
 $checkpointJustWritten = false
 
 $failureTimeout = 5
 
 $fetchCount = 0
 
 $fetchCountLast = 0
 
 $firstPageWritten = false
 
 $history = WikiExporter::FULL
 
 $input = "php://stdin"
 
 $lastPageWritten = false
 
 $maxConsecutiveFailedTextRetrievals = 200
 
 $maxFailures = 5
 
 $maxTimeAllowed = 0
 
 $php = "php"
 
 $prefetch = null
 
 $prefetchCount = 0
 
 $prefetchCountLast = 0
 
 $spawn = false
 
bool resource $spawnErr = false
 
bool resource $spawnProc = false
 
bool resource $spawnRead = false
 
bool resource $spawnWrite = false
 
 $timeExceeded = false
 
 $xmlwriterobj = false
 
- Public Attributes inherited from BackupDumper
 $dumpUploadFileContents = false
 
 $dumpUploads = false
 
 $endId = 0
 
 $filterTypes = array()
 
 $ID = 0
 
 $lastTime = 0
 
 $outputTypes = array()
 
 $pageCount = 0
 
 $pageCountLast = 0
 
 $pages = null
 
 $reporting = true
 
 $reportingInterval = 100
 
 $revCount = 0
 
 $revCountLast = 0
 
 $revEndId = 0
 
 $revStartId = 0
 
 $server = null
 
 $sink = null
 
 $skipFooter = false
 
 $skipHeader = false
 
 $startId = 0
 
 $stubText = false
 

Protected Attributes

DatabaseBase $db
 
- Protected Attributes inherited from BackupDumper
DatabaseBase null $forcedDb = null
 The dependency-injected database to use. More...
 
LoadBalancer $lb
 

Private Member Functions

 closeSpawn ()
 
 getTextDb ( $id)
 May throw a database error if, say, the server dies during query. More...
 
 getTextSpawned ( $id)
 
 getTextSpawnedOnce ( $id)
 

Detailed Description

Definition at line 32 of file backupTextPass.inc.

Member Function Documentation

◆ characterData()

TextPassDumper::characterData (   $parser,
  $data 
)

Definition at line 797 of file backupTextPass.inc.

References clearOpenElement().

Referenced by startElement().

◆ checkIfTimeExceeded()

TextPassDumper::checkIfTimeExceeded ( )

Definition at line 293 of file backupTextPass.inc.

Referenced by readDump().

◆ clearOpenElement()

TextPassDumper::clearOpenElement (   $style)

Definition at line 817 of file backupTextPass.inc.

References Xml\element().

Referenced by characterData(), endElement(), and startElement().

◆ closeSpawn()

TextPassDumper::closeSpawn ( )
private

Definition at line 627 of file backupTextPass.inc.

References wfRestoreWarnings(), and wfSuppressWarnings().

Referenced by dump(), and getText().

◆ dump()

TextPassDumper::dump (   $history,
  $text = WikiExporter::TEXT 
)

◆ endElement()

TextPassDumper::endElement (   $parser,
  $name 
)

Definition at line 738 of file backupTextPass.inc.

References BackupDumper\$lastTime, $name, array(), and clearOpenElement().

◆ finalOptionCheck()

TextPassDumper::finalOptionCheck ( )

Definition at line 300 of file backupTextPass.inc.

References $count, array(), and as.

Referenced by dump().

◆ getText()

TextPassDumper::getText (   $id)

Tries to get the revision text for a revision id.

Upon errors, retries (Up to $this->maxFailures tries each call). If still no good revision get could be found even after this retrying, "" is returned. If no good revision text could be returned for $this->maxConsecutiveFailedTextRetrievals consecutive calls to getText, MWException is thrown.

Parameters
$idstring The revision id to get the text for
Returns
string The revision text for $id, or ""
Exceptions
MWException

Definition at line 408 of file backupTextPass.inc.

References $e, array(), closeSpawn(), CONTENT_MODEL_WIKITEXT, getTextDb(), getTextSpawned(), global, openSpawn(), BackupDumper\progress(), and rotateDb().

Referenced by startElement().

◆ getTextDb()

TextPassDumper::getTextDb (   $id)
private

May throw a database error if, say, the server dies during query.

Parameters
$id
Returns
bool|string
Exceptions
MWException

Definition at line 557 of file backupTextPass.inc.

References $wgContLang, array(), Revision\getRevisionText(), and global.

Referenced by getText().

◆ getTextSpawned()

TextPassDumper::getTextSpawned (   $id)
private

Definition at line 575 of file backupTextPass.inc.

References getTextSpawnedOnce(), openSpawn(), wfRestoreWarnings(), and wfSuppressWarnings().

Referenced by getText().

◆ getTextSpawnedOnce()

TextPassDumper::getTextSpawnedOnce (   $id)
private

Definition at line 648 of file backupTextPass.inc.

References $ok, $wgContLang, global, and BackupDumper\progress().

Referenced by getTextSpawned().

◆ initProgress()

TextPassDumper::initProgress (   $history = WikiExporter::FULL)

Initialise starting time and maximum revision count.

We'll make ETA calculations based an progress, assuming relatively constant per-revision rate.

Parameters
$historyInteger: WikiExporter::CURRENT or WikiExporter::FULL

Reimplemented from BackupDumper.

Definition at line 128 of file backupTextPass.inc.

Referenced by dump().

◆ openSpawn()

TextPassDumper::openSpawn ( )

Definition at line 586 of file backupTextPass.inc.

References $IP, array(), global, list, php, BackupDumper\progress(), and wfWikiID().

Referenced by getText(), and getTextSpawned().

◆ processFileOpt()

TextPassDumper::processFileOpt (   $val,
  $param 
)

Definition at line 207 of file backupTextPass.inc.

References as.

Referenced by processOption().

◆ processOption()

TextPassDumper::processOption (   $opt,
  $val,
  $param 
)

Reimplemented from BackupDumper.

Definition at line 174 of file backupTextPass.inc.

References $IP, WikiExporter\CURRENT, WikiExporter\FULL, global, php, and processFileOpt().

◆ readDump()

TextPassDumper::readDump (   $input)
Exceptions
MWExceptionFailure to parse XML input
Returns
true

Definition at line 324 of file backupTextPass.inc.

References $input, $parser, array(), checkIfTimeExceeded(), setTimeExceeded(), wfDebug(), and wfMessage().

Referenced by dump().

◆ rotateDb()

TextPassDumper::rotateDb ( )

Drop the database connection $this->db and try to get a new one.

This function tries to get a /different/ connection if this is possible. Hence, (if this is possible) it switches to a different failover upon each call.

This function resets $this->lb and closes all connections on it.

Exceptions
MWException

Definition at line 91 of file backupTextPass.inc.

References $e, BackupDumper\$forcedDb, DB_SLAVE, and wfGetLBFactory().

Referenced by dump(), and getText().

◆ setTimeExceeded()

TextPassDumper::setTimeExceeded ( )

Definition at line 289 of file backupTextPass.inc.

Referenced by readDump().

◆ showReport()

TextPassDumper::showReport ( )

◆ startElement()

TextPassDumper::startElement (   $parser,
  $name,
  $attribs 
)

Definition at line 708 of file backupTextPass.inc.

References $attribs, $name, $parser, array(), characterData(), clearOpenElement(), and getText().

Member Data Documentation

◆ $checkpointFiles

TextPassDumper::$checkpointFiles = array()

Definition at line 74 of file backupTextPass.inc.

◆ $checkpointJustWritten

TextPassDumper::$checkpointJustWritten = false

Definition at line 73 of file backupTextPass.inc.

◆ $db

DatabaseBase TextPassDumper::$db
protected

Definition at line 78 of file backupTextPass.inc.

◆ $failureTimeout

TextPassDumper::$failureTimeout = 5

Definition at line 43 of file backupTextPass.inc.

◆ $fetchCount

TextPassDumper::$fetchCount = 0

Definition at line 36 of file backupTextPass.inc.

Referenced by showReport().

◆ $fetchCountLast

TextPassDumper::$fetchCountLast = 0

Definition at line 39 of file backupTextPass.inc.

Referenced by showReport().

◆ $firstPageWritten

TextPassDumper::$firstPageWritten = false

Definition at line 71 of file backupTextPass.inc.

◆ $history

TextPassDumper::$history = WikiExporter::FULL

Definition at line 35 of file backupTextPass.inc.

◆ $input

TextPassDumper::$input = "php://stdin"

Definition at line 34 of file backupTextPass.inc.

Referenced by dump(), and readDump().

◆ $lastPageWritten

TextPassDumper::$lastPageWritten = false

Definition at line 72 of file backupTextPass.inc.

◆ $maxConsecutiveFailedTextRetrievals

TextPassDumper::$maxConsecutiveFailedTextRetrievals = 200

Definition at line 42 of file backupTextPass.inc.

◆ $maxFailures

TextPassDumper::$maxFailures = 5

Definition at line 41 of file backupTextPass.inc.

◆ $maxTimeAllowed

TextPassDumper::$maxTimeAllowed = 0

Definition at line 69 of file backupTextPass.inc.

◆ $php

TextPassDumper::$php = "php"

Definition at line 45 of file backupTextPass.inc.

◆ $prefetch

TextPassDumper::$prefetch = null

Definition at line 33 of file backupTextPass.inc.

◆ $prefetchCount

TextPassDumper::$prefetchCount = 0

Definition at line 37 of file backupTextPass.inc.

Referenced by showReport().

◆ $prefetchCountLast

TextPassDumper::$prefetchCountLast = 0

Definition at line 38 of file backupTextPass.inc.

◆ $spawn

TextPassDumper::$spawn = false

Definition at line 46 of file backupTextPass.inc.

◆ $spawnErr

bool resource TextPassDumper::$spawnErr = false

Definition at line 62 of file backupTextPass.inc.

◆ $spawnProc

bool resource TextPassDumper::$spawnProc = false

Definition at line 50 of file backupTextPass.inc.

◆ $spawnRead

bool resource TextPassDumper::$spawnRead = false

Definition at line 58 of file backupTextPass.inc.

◆ $spawnWrite

bool resource TextPassDumper::$spawnWrite = false

Definition at line 54 of file backupTextPass.inc.

◆ $timeExceeded

TextPassDumper::$timeExceeded = false

Definition at line 70 of file backupTextPass.inc.

◆ $xmlwriterobj

TextPassDumper::$xmlwriterobj = false

Definition at line 64 of file backupTextPass.inc.


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