MediaWiki master
DumpFileOutput Class Reference

Inherits DumpOutput.

Inherited by DumpPipeOutput.

Collaboration diagram for 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 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 29 of file DumpFileOutput.php.

Constructor & Destructor Documentation

◆ __construct()

DumpFileOutput::__construct ( $file)
Parameters
string$file

Reimplemented in DumpBZip2Output, DumpDBZip2Output, DumpGZipOutput, and DumpLBZip2Output.

Definition at line 38 of file DumpFileOutput.php.

Member Function Documentation

◆ checkRenameArgCount()

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

Definition at line 82 of file DumpFileOutput.php.

Referenced by Dump7ZipOutput\closeAndRename(), closeAndRename(), and DumpPipeOutput\closeAndRename().

◆ closeAndRename()

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 DumpOutput.

Reimplemented in Dump7ZipOutput, and DumpPipeOutput.

Definition at line 95 of file DumpFileOutput.php.

References checkRenameArgCount(), and renameOrException().

Referenced by closeRenameAndReopen().

◆ closeRenameAndReopen()

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 DumpOutput.

Reimplemented in DumpPipeOutput.

Definition at line 64 of file DumpFileOutput.php.

References closeAndRename().

◆ getFilenames()

DumpFileOutput::getFilenames ( )
Returns
string|null

Reimplemented from DumpOutput.

Definition at line 112 of file DumpFileOutput.php.

References $filename.

◆ renameOrException()

DumpFileOutput::renameOrException ( $newname)
protected
Parameters
string$newname

Definition at line 71 of file DumpFileOutput.php.

Referenced by Dump7ZipOutput\closeAndRename(), closeAndRename(), and DumpPipeOutput\closeAndRename().

◆ write()

DumpFileOutput::write ( $string)
Parameters
string$string

Reimplemented from DumpOutput.

Definition at line 57 of file DumpFileOutput.php.

◆ writeCloseStream()

DumpFileOutput::writeCloseStream ( $string)
Parameters
string$string

Reimplemented from DumpOutput.

Reimplemented in DumpPipeOutput.

Definition at line 46 of file DumpFileOutput.php.

Member Data Documentation

◆ $filename

string DumpFileOutput::$filename
protected

Definition at line 33 of file DumpFileOutput.php.

Referenced by getFilenames().

◆ $handle

resource false DumpFileOutput::$handle = false
protected

Definition at line 31 of file DumpFileOutput.php.


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