summaryrefslogtreecommitdiff
path: root/maintenance/importDump.php
diff options
context:
space:
mode:
Diffstat (limited to 'maintenance/importDump.php')
-rw-r--r--maintenance/importDump.php32
1 files changed, 16 insertions, 16 deletions
diff --git a/maintenance/importDump.php b/maintenance/importDump.php
index f51d7ad7..1f47cf12 100644
--- a/maintenance/importDump.php
+++ b/maintenance/importDump.php
@@ -24,7 +24,7 @@
* @ingroup Maintenance
*/
-require_once( __DIR__ . '/Maintenance.php' );
+require_once __DIR__ . '/Maintenance.php';
/**
* Maintenance script that imports XML dump files into the current wiki.
@@ -32,18 +32,18 @@ require_once( __DIR__ . '/Maintenance.php' );
* @ingroup Maintenance
*/
class BackupReader extends Maintenance {
- var $reportingInterval = 100;
- var $pageCount = 0;
- var $revCount = 0;
- var $dryRun = false;
- var $uploads = false;
- var $imageBasePath = false;
- var $nsFilter = false;
+ public $reportingInterval = 100;
+ public $pageCount = 0;
+ public $revCount = 0;
+ public $dryRun = false;
+ public $uploads = false;
+ public $imageBasePath = false;
+ public $nsFilter = false;
function __construct() {
parent::__construct();
- $gz = in_array('compress.zlib', stream_get_wrappers()) ? 'ok' : '(disabled; requires PHP zlib module)';
- $bz2 = in_array('compress.bzip2', stream_get_wrappers()) ? 'ok' : '(disabled; requires PHP bzip2 module)';
+ $gz = in_array( 'compress.zlib', stream_get_wrappers() ) ? 'ok' : '(disabled; requires PHP zlib module)';
+ $bz2 = in_array( 'compress.bzip2', stream_get_wrappers() ) ? 'ok' : '(disabled; requires PHP bzip2 module)';
$this->mDescription = <<<TEXT
This script reads pages from an XML file as produced from Special:Export or
@@ -73,7 +73,7 @@ TEXT;
}
public function execute() {
- if( wfReadOnly() ) {
+ if ( wfReadOnly() ) {
$this->error( "Wiki is in read-only mode; you'll need to disable it for import to work.", true );
}
@@ -91,7 +91,7 @@ TEXT;
$this->setNsfilter( explode( '|', $this->getOption( 'namespaces' ) ) );
}
- if( $this->hasArg() ) {
+ if ( $this->hasArg() ) {
$this->importFromFile( $this->getArg() );
} else {
$this->importFromStdin();
@@ -247,7 +247,7 @@ TEXT;
function importFromStdin() {
$file = fopen( 'php://stdin', 'rt' );
- if( self::posix_isatty( $file ) ) {
+ if ( self::posix_isatty( $file ) ) {
$this->maybeHelp( true );
}
return $this->importFromHandle( $file );
@@ -259,14 +259,14 @@ TEXT;
$source = new ImportStreamSource( $handle );
$importer = new WikiImporter( $source );
- if( $this->hasOption( 'debug' ) ) {
+ if ( $this->hasOption( 'debug' ) ) {
$importer->setDebug( true );
}
if ( $this->hasOption( 'no-updates' ) ) {
$importer->setNoUpdates( true );
}
$importer->setPageCallback( array( &$this, 'reportPage' ) );
- $this->importCallback = $importer->setRevisionCallback(
+ $this->importCallback = $importer->setRevisionCallback(
array( &$this, 'handleRevision' ) );
$this->uploadCallback = $importer->setUploadCallback(
array( &$this, 'handleUpload' ) );
@@ -288,4 +288,4 @@ TEXT;
}
$maintClass = 'BackupReader';
-require_once( RUN_MAINTENANCE_IF_MAIN );
+require_once RUN_MAINTENANCE_IF_MAIN;