X-Git-Url: http://git.cyclocoop.org/?a=blobdiff_plain;f=maintenance%2FimportDump.php;h=f0e0555af1deca3e2103865e69014db65186ae77;hb=937e602c2c56f068272f635c5867d69f00f9ef49;hp=43e5060a8447ef4d6acd42af19d59ccca6b85c75;hpb=207aabea297c8f634f26b82f762fea90e6ef09b1;p=lhc%2Fweb%2Fwiklou.git diff --git a/maintenance/importDump.php b/maintenance/importDump.php index 43e5060a84..f0e0555af1 100644 --- a/maintenance/importDump.php +++ b/maintenance/importDump.php @@ -49,7 +49,8 @@ class BackupReader extends Maintenance { ? 'ok' : '(disabled; requires PHP bzip2 module)'; - $this->mDescription = <<addDescription( + << -TEXT; +TEXT + ); $this->stderr = fopen( "php://stderr", "wt" ); $this->addOption( 'report', 'Report position and speed after every n pages processed', false, true ); @@ -116,7 +118,7 @@ TEXT; return; } - $this->nsFilter = array_unique( array_map( array( $this, 'getNsIndex' ), $namespaces ) ); + $this->nsFilter = array_unique( array_map( [ $this, 'getNsIndex' ], $namespaces ) ); } private function getNsIndex( $namespace ) { @@ -201,9 +203,9 @@ TEXT; if ( !$this->dryRun ) { // bluuuh hack // call_user_func( $this->uploadCallback, $revision ); - $dbw = wfGetDB( DB_MASTER ); + $dbw = $this->getDB( DB_MASTER ); - return $dbw->deadlockLoop( array( $revision, 'importUpload' ) ); + return $dbw->deadlockLoop( [ $revision, 'importUpload' ] ); } } @@ -295,13 +297,13 @@ TEXT; return false; } } - $importer->setPageCallback( array( &$this, 'reportPage' ) ); + $importer->setPageCallback( [ $this, 'reportPage' ] ); $this->importCallback = $importer->setRevisionCallback( - array( &$this, 'handleRevision' ) ); + [ $this, 'handleRevision' ] ); $this->uploadCallback = $importer->setUploadCallback( - array( &$this, 'handleUpload' ) ); + [ $this, 'handleUpload' ] ); $this->logItemCallback = $importer->setLogItemCallback( - array( &$this, 'handleLogItem' ) ); + [ $this, 'handleLogItem' ] ); if ( $this->uploads ) { $importer->setImportUploads( true ); }