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

Public Member Functions

 __construct ( $args)
 
 __destruct ()
 
 backupDb ()
 
 backupServer ()
 
 dump ( $history, $text=WikiExporter::TEXT)
 
 fatalError ( $msg)
 
 initProgress ( $history=WikiExporter::FULL)
 Initialise starting time and maximum revision count. More...
 
 loadPlugin ( $class, $file)
 Load a plugin and register it. More...
 
 processArgs ( $args)
 
 processOption ( $opt, $val, $param)
 
 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...
 
 showReport ()
 

Public Attributes

 $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 null $forcedDb = null
 The dependency-injected database to use. More...
 
LoadBalancer $lb
 

Detailed Description

Definition at line 39 of file backup.inc.

Constructor & Destructor Documentation

◆ __construct()

BackupDumper::__construct (   $args)

Definition at line 75 of file backup.inc.

References $args, processArgs(), registerFilter(), and registerOutput().

◆ __destruct()

BackupDumper::__destruct ( )

Definition at line 298 of file backup.inc.

Member Function Documentation

◆ backupDb()

BackupDumper::backupDb ( )
Todo:
Fixme: the –server parameter is currently not respected, as it doesn't seem terribly easy to ask the load balancer for a particular connection by name.
Returns
DatabaseBase

Definition at line 271 of file backup.inc.

References $forcedDb, array(), DB_SLAVE, and wfGetLBFactory().

Referenced by dump().

◆ backupServer()

BackupDumper::backupServer ( )

Definition at line 304 of file backup.inc.

References global, and server.

◆ dump()

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

◆ fatalError()

BackupDumper::fatalError (   $msg)

Definition at line 364 of file backup.inc.

References progress().

Referenced by processArgs().

◆ initProgress()

BackupDumper::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 in TextPassDumper.

Definition at line 251 of file backup.inc.

References $dbr, $forcedDb, WikiExporter\CURRENT, DB_SLAVE, ID, and wfGetDB().

Referenced by dump().

◆ loadPlugin()

BackupDumper::loadPlugin (   $class,
  $file 
)

Load a plugin and register it.

Parameters
$classString: name of plugin class; must have a static 'register' method that takes a BackupDumper as a parameter.
$fileString: full or relative path to the PHP file to load, or empty

Definition at line 115 of file backup.inc.

References $file, and array().

Referenced by processArgs().

◆ processArgs()

BackupDumper::processArgs (   $args)
Parameters
$argsArray
Returns
Array

Definition at line 127 of file backup.inc.

References $args, $matches, $sink, $type, array(), as, fatalError(), list, loadPlugin(), processOption(), and server.

Referenced by __construct().

◆ processOption()

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

Reimplemented in TextPassDumper.

Definition at line 193 of file backup.inc.

Referenced by processArgs().

◆ progress()

◆ registerFilter()

BackupDumper::registerFilter (   $name,
  $class 
)
Parameters
$nameString
$classString: name of filter plugin class

Definition at line 104 of file backup.inc.

References $name.

Referenced by __construct().

◆ registerOutput()

BackupDumper::registerOutput (   $name,
  $class 
)
Parameters
$nameString
$classString: name of output filter plugin class

Definition at line 96 of file backup.inc.

References $name.

Referenced by __construct().

◆ report()

BackupDumper::report (   $final = false)

Definition at line 320 of file backup.inc.

References revCount(), and showReport().

Referenced by TextPassDumper\dump(), dump(), and revCount().

◆ reportPage()

BackupDumper::reportPage ( )

Definition at line 311 of file backup.inc.

◆ revCount()

BackupDumper::revCount ( )

Definition at line 315 of file backup.inc.

References report().

Referenced by report(), TextPassDumper\showReport(), and showReport().

◆ setDb()

BackupDumper::setDb ( DatabaseBase  $db = null)

Force the dump to use the provided database connection for database operations, wherever possible.

Parameters
$dbDatabaseBase|null: (Optional) the database connection to use. If null, resort to use the globally provided ways to get database connections.

Definition at line 294 of file backup.inc.

◆ showReport()

BackupDumper::showReport ( )

Reimplemented in TextPassDumper.

Definition at line 326 of file backup.inc.

References $lastTime, $pageCountLast, $revCount, $revCountLast, ID, progress(), revCount(), TS_DB, wfTimestamp(), and wfWikiID().

Referenced by report().

Member Data Documentation

◆ $dumpUploadFileContents

BackupDumper::$dumpUploadFileContents = false

Definition at line 55 of file backup.inc.

Referenced by dump().

◆ $dumpUploads

BackupDumper::$dumpUploads = false

Definition at line 54 of file backup.inc.

Referenced by dump().

◆ $endId

BackupDumper::$endId = 0

Definition at line 49 of file backup.inc.

◆ $filterTypes

BackupDumper::$filterTypes = array()

Definition at line 61 of file backup.inc.

◆ $forcedDb

DatabaseBase null BackupDumper::$forcedDb = null
protected

The dependency-injected database to use.

See also
self::setDb

Definition at line 69 of file backup.inc.

Referenced by backupDb(), initProgress(), and TextPassDumper\rotateDb().

◆ $ID

BackupDumper::$ID = 0

Definition at line 59 of file backup.inc.

◆ $lastTime

BackupDumper::$lastTime = 0

Definition at line 56 of file backup.inc.

Referenced by TextPassDumper\endElement(), TextPassDumper\showReport(), and showReport().

◆ $lb

LoadBalancer BackupDumper::$lb
protected

Definition at line 73 of file backup.inc.

◆ $outputTypes

BackupDumper::$outputTypes = array()

Definition at line 61 of file backup.inc.

◆ $pageCount

BackupDumper::$pageCount = 0

Definition at line 42 of file backup.inc.

◆ $pageCountLast

BackupDumper::$pageCountLast = 0

Definition at line 57 of file backup.inc.

Referenced by TextPassDumper\showReport(), and showReport().

◆ $pages

BackupDumper::$pages = null

Definition at line 45 of file backup.inc.

◆ $reporting

BackupDumper::$reporting = true

Definition at line 41 of file backup.inc.

◆ $reportingInterval

BackupDumper::$reportingInterval = 100

Definition at line 40 of file backup.inc.

◆ $revCount

BackupDumper::$revCount = 0

Definition at line 43 of file backup.inc.

Referenced by TextPassDumper\showReport(), and showReport().

◆ $revCountLast

BackupDumper::$revCountLast = 0

Definition at line 58 of file backup.inc.

Referenced by TextPassDumper\showReport(), and showReport().

◆ $revEndId

BackupDumper::$revEndId = 0

Definition at line 51 of file backup.inc.

◆ $revStartId

BackupDumper::$revStartId = 0

Definition at line 50 of file backup.inc.

◆ $server

BackupDumper::$server = null

Definition at line 44 of file backup.inc.

◆ $sink

BackupDumper::$sink = null

Definition at line 52 of file backup.inc.

Referenced by processArgs().

◆ $skipFooter

BackupDumper::$skipFooter = false

Definition at line 47 of file backup.inc.

◆ $skipHeader

BackupDumper::$skipHeader = false

Definition at line 46 of file backup.inc.

◆ $startId

BackupDumper::$startId = 0

Definition at line 48 of file backup.inc.

◆ $stubText

BackupDumper::$stubText = false

Definition at line 53 of file backup.inc.


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