MediaWiki master
MediaWiki\Export\DumpFileOutput Class Reference

Inherits MediaWiki\Export\DumpOutput.

Inherited by MediaWiki\Export\DumpPipeOutput.

Collaboration diagram for MediaWiki\Export\DumpFileOutput:

Public Member Functions

 __construct ( $file)
 
 closeAndRename ( $newname, $open=false)
 Close the old file, and move it to a specified name.Use this for the last piece of a file written out at specified checkpoints (e.g. every n hours).

Parameters
string | string[]$newnameFile name. May be a string or an array with one element
bool$openIf true, a new file with the old filename will be opened again for writing (default: false)

 
 closeRenameAndReopen ( $newname)
 Close the old file, move it to a specified name, and reopen new file with the old name.Use this for writing out a file in multiple pieces at specified checkpoints (e.g. every n hours).

Parameters
string | string[]$newnameFile name. May be a string or an array with one element

 
 getFilenames ()
 
 write ( $string)
 
 writeCloseStream ( $string)
 
- Public Member Functions inherited from MediaWiki\Export\DumpOutput
 writeClosePage ( $string)
 
 writeLogItem ( $rev, $string)
 
 writeOpenPage ( $page, $string)
 
 writeOpenStream ( $string)
 
 writeRevision ( $rev, $string)
 

Protected Member Functions

 checkRenameArgCount ( $newname)
 
 renameOrException ( $newname)
 

Protected Attributes

string $filename
 
resource false $handle = false
 

Detailed Description

Definition at line 20 of file DumpFileOutput.php.

Constructor & Destructor Documentation

◆ __construct()

MediaWiki\Export\DumpFileOutput::__construct ( $file)

Member Function Documentation

◆ checkRenameArgCount()

MediaWiki\Export\DumpFileOutput::checkRenameArgCount ( $newname)
protected
Parameters
string | string[]$newname
Returns
string
Exceptions
MWException

Definition at line 73 of file DumpFileOutput.php.

Referenced by MediaWiki\Export\Dump7ZipOutput\closeAndRename(), MediaWiki\Export\DumpFileOutput\closeAndRename(), and MediaWiki\Export\DumpPipeOutput\closeAndRename().

◆ closeAndRename()

MediaWiki\Export\DumpFileOutput::closeAndRename ( $newname,
$open = false )

Close the old file, and move it to a specified name.Use this for the last piece of a file written out at specified checkpoints (e.g. every n hours).

Parameters
string | string[]$newnameFile name. May be a string or an array with one element
bool$openIf true, a new file with the old filename will be opened again for writing (default: false)

Reimplemented from MediaWiki\Export\DumpOutput.

Reimplemented in MediaWiki\Export\Dump7ZipOutput, and MediaWiki\Export\DumpPipeOutput.

Definition at line 86 of file DumpFileOutput.php.

References MediaWiki\Export\DumpFileOutput\checkRenameArgCount(), and MediaWiki\Export\DumpFileOutput\renameOrException().

Referenced by MediaWiki\Export\DumpFileOutput\closeRenameAndReopen().

◆ closeRenameAndReopen()

MediaWiki\Export\DumpFileOutput::closeRenameAndReopen ( $newname)

Close the old file, move it to a specified name, and reopen new file with the old name.Use this for writing out a file in multiple pieces at specified checkpoints (e.g. every n hours).

Parameters
string | string[]$newnameFile name. May be a string or an array with one element

Reimplemented from MediaWiki\Export\DumpOutput.

Reimplemented in MediaWiki\Export\DumpPipeOutput.

Definition at line 55 of file DumpFileOutput.php.

References MediaWiki\Export\DumpFileOutput\closeAndRename().

◆ getFilenames()

MediaWiki\Export\DumpFileOutput::getFilenames ( )
Returns
string|null

Reimplemented from MediaWiki\Export\DumpOutput.

Definition at line 103 of file DumpFileOutput.php.

References MediaWiki\Export\DumpFileOutput\$filename.

◆ renameOrException()

MediaWiki\Export\DumpFileOutput::renameOrException ( $newname)
protected

◆ write()

MediaWiki\Export\DumpFileOutput::write ( $string)
Parameters
string$string

Reimplemented from MediaWiki\Export\DumpOutput.

Definition at line 48 of file DumpFileOutput.php.

◆ writeCloseStream()

MediaWiki\Export\DumpFileOutput::writeCloseStream ( $string)
Parameters
string$string

Reimplemented from MediaWiki\Export\DumpOutput.

Reimplemented in MediaWiki\Export\DumpPipeOutput.

Definition at line 37 of file DumpFileOutput.php.

Member Data Documentation

◆ $filename

string MediaWiki\Export\DumpFileOutput::$filename
protected

Definition at line 24 of file DumpFileOutput.php.

Referenced by MediaWiki\Export\DumpFileOutput\getFilenames().

◆ $handle

resource false MediaWiki\Export\DumpFileOutput::$handle = false
protected

Definition at line 22 of file DumpFileOutput.php.


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