* @ingroup Dump
*/
class XmlDumpWriter {
- var $firstPageWritten = 0;
- var $lastPageWritten = 0;
- var $pageInProgress = 0;
+ protected $firstPageWritten = 0, $lastPageWritten = 0, $pageInProgress = 0;
/**
* Returns the export schema version.
*/
function closePage() {
return " </page>\n";
- if (! $this->firstPageWritten) {
+ if ( !$this->firstPageWritten ) {
$this->firstPageWritten = $this->pageInProgress;
}
$this->lastPageWritten = $this->pageInProgress;
print $string;
}
+ /**
+ * 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).
+ * @param $newname mixed File name. May be a string or an array with one element
+ */
function closeRenameAndReopen( $newname ) {
return;
}
+ // TODO: document
function closeAndRename( $newname ) {
return;
}
+ // TODO: document
function rename( $newname ) {
return;
}
+ // TODO: document
function getFilename() {
return NULL;
}
fputs( $this->handle, $string );
}
- /**
- * 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).
- */
function closeRenameAndReopen( $newname ) {
if ( is_array($newname) ) {
if (count($newname) > 1) {
- throw new MWException("Export closeRenameAndReopen: passed multiple argumnts for rename of single file\n");
+ throw new MWException(__METHOD__ . ": passed multiple arguments for rename of single file\n");
}
else {
$newname = $newname[0];
function closeAndRename( $newname ) {
if ( is_array($newname) ) {
if (count($newname) > 1) {
- throw new MWException("Export closeRenameAndReopen: passed multiple argumnts for rename of single file\n");
+ throw new MWException(__METHOD__ . ": passed multiple arguments for rename of single file\n");
}
else {
$newname = $newname[0];
function rename( $newname ) {
if ( is_array($newname) ) {
if (count($newname) > 1) {
- throw new MWException("Export closeRenameAndReopen: passed multiple argumnts for rename of single file\n");
+ throw new MWException(__METHOD__ . ": passed multiple arguments for rename of single file\n");
}
else {
$newname = $newname[0];
* @ingroup Dump
*/
class DumpPipeOutput extends DumpFileOutput {
- var $command;
+ protected $command, $filename;
function __construct( $command, $file = null ) {
if ( !is_null( $file ) ) {
function closeRenameAndReopen( $newname ) {
if ( is_array($newname) ) {
if (count($newname) > 1) {
- throw new MWException("Export closeRenameAndReopen: passed multiple argumnts for rename of single file\n");
+ throw new MWException(__METHOD__ . ": passed multiple arguments for rename of single file\n");
}
else {
$newname = $newname[0];
function closeAndRename( $newname ) {
if ( is_array($newname) ) {
if (count($newname) > 1) {
- throw new MWException("Export closeRenameAndReopen: passed multiple argumnts for rename of single file\n");
+ throw new MWException(__METHOD__ . ": passed multiple arguments for rename of single file\n");
}
else {
$newname = $newname[0];
function rename( $newname ) {
if ( is_array($newname) ) {
if (count($newname) > 1) {
- throw new MWException("Export closeRenameAndReopen: passed multiple argumnts for rename of single file\n");
+ throw new MWException(__METHOD__ . ": passed multiple arguments for rename of single file\n");
}
else {
$newname = $newname[0];
* @ingroup Dump
*/
class Dump7ZipOutput extends DumpPipeOutput {
- var $filename;
+ protected $filename;
function __construct( $file ) {
$command = "7za a -bd -si " . wfEscapeShellArg( $file );
function closeRenameAndReopen( $newname ) {
if ( is_array($newname) ) {
if (count($newname) > 1) {
- throw new MWException("Export closeRenameAndReopen: passed multiple argumnts for rename of single file\n");
+ throw new MWException(__METHOD__ . ": passed multiple arguments for rename of single file\n");
}
else {
$newname = $newname[0];
function closeAndRename( $newname ) {
if ( is_array($newname) ) {
if (count($newname) > 1) {
- throw new MWException("Export closeRenameAndReopen: passed multiple argumnts for rename of single file\n");
+ throw new MWException(__METHOD__ . ": passed multiple arguments for rename of single file\n");
}
else {
$newname = $newname[0];
function rename( $newname ) {
if ( is_array($newname) ) {
if (count($newname) > 1) {
- throw new MWException("Export closeRenameAndReopen: passed multiple argumnts for rename of single file\n");
+ throw new MWException(__METHOD__ . ": passed multiple arguments for rename of single file\n");
}
else {
$newname = $newname[0];