X-Git-Url: https://git.heureux-cyclage.org/?a=blobdiff_plain;f=maintenance%2FpurgeChangedFiles.php;h=29a36d552cffa7a146c59055bd3ef9ae6835f824;hb=0d5da03a15911f0bcaab7f67512280df379565fc;hp=70a26cbdf626c6433114d0223b92b0ed94b2b0ba;hpb=b54d9cb68067a4a274b518a510b59cedabab937f;p=lhc%2Fweb%2Fwiklou.git diff --git a/maintenance/purgeChangedFiles.php b/maintenance/purgeChangedFiles.php index 70a26cbdf6..29a36d552c 100644 --- a/maintenance/purgeChangedFiles.php +++ b/maintenance/purgeChangedFiles.php @@ -77,7 +77,7 @@ class PurgeChangedFiles extends Maintenance { global $wgHTCPRouting; if ( $this->hasOption( 'htcp-dest' ) ) { - $parts = explode( ':', $this->getOption( 'htcp-dest' ) ); + $parts = explode( ':', $this->getOption( 'htcp-dest' ), 2 ); if ( count( $parts ) < 2 ) { // Add default htcp port $parts[] = '4827'; @@ -106,7 +106,7 @@ class PurgeChangedFiles extends Maintenance { } // Validate the timestamps - $dbr = $this->getDB( DB_SLAVE ); + $dbr = $this->getDB( DB_REPLICA ); $this->startTimestamp = $dbr->timestamp( $this->getOption( 'starttime' ) ); $this->endTimestamp = $dbr->timestamp( $this->getOption( 'endtime' ) ); @@ -137,7 +137,7 @@ class PurgeChangedFiles extends Maintenance { */ protected function purgeFromLogType( $type ) { $repo = RepoGroup::singleton()->getLocalRepo(); - $dbr = $this->getDB( DB_SLAVE ); + $dbr = $this->getDB( DB_REPLICA ); foreach ( self::$typeMappings[$type] as $logType => $logActions ) { $this->verbose( "Scanning for {$logType}/" . implode( ',', $logActions ) . "\n" ); @@ -200,7 +200,7 @@ class PurgeChangedFiles extends Maintenance { $this->verbose( "Purged file {$row->log_title}; {$type} @{$row->log_timestamp}.\n" ); - if ( $this->hasOption( 'sleep-per-batch' ) && ++$bSize > $this->mBatchSize ) { + if ( $this->hasOption( 'sleep-per-batch' ) && ++$bSize > $this->getBatchSize() ) { $bSize = 0; // sleep-per-batch is milliseconds, usleep wants micro seconds. usleep( 1000 * (int)$this->getOption( 'sleep-per-batch' ) ); @@ -210,7 +210,7 @@ class PurgeChangedFiles extends Maintenance { } protected function purgeFromArchiveTable( LocalRepo $repo, LocalFile $file ) { - $dbr = $repo->getSlaveDB(); + $dbr = $repo->getReplicaDB(); $res = $dbr->select( 'filearchive', [ 'fa_archive_name' ], @@ -258,5 +258,5 @@ class PurgeChangedFiles extends Maintenance { } } -$maintClass = "PurgeChangedFiles"; +$maintClass = PurgeChangedFiles::class; require_once RUN_MAINTENANCE_IF_MAIN;