X-Git-Url: https://git.heureux-cyclage.org/?a=blobdiff_plain;f=maintenance%2FcopyFileBackend.php;h=b39ff55eda1b68697dfc8677b3b2b1d0cbbf12c4;hb=1fb06c0c71282807b0ccecd1d71fb16244846955;hp=86e47af9be8f5635a90593b160679dfb7cbc23f7;hpb=fd3ac84a6b10145fe79a8479bd0e9afc84e3a763;p=lhc%2Fweb%2Fwiklou.git diff --git a/maintenance/copyFileBackend.php b/maintenance/copyFileBackend.php index 86e47af9be..b39ff55eda 100644 --- a/maintenance/copyFileBackend.php +++ b/maintenance/copyFileBackend.php @@ -226,8 +226,8 @@ class CopyFileBackend extends Maintenance { } $t_start = microtime( true ); $fsFiles = $src->getLocalReferenceMulti( array( 'srcs' => $srcPaths, 'latest' => 1 ) ); - $ellapsed_ms = floor( ( microtime( true ) - $t_start ) * 1000 ); - $this->output( "\n\tDownloaded these file(s) [{$ellapsed_ms}ms]:\n\t" . + $elapsed_ms = floor( ( microtime( true ) - $t_start ) * 1000 ); + $this->output( "\n\tDownloaded these file(s) [{$elapsed_ms}ms]:\n\t" . implode( "\n\t", $srcPaths ) . "\n\n" ); } @@ -281,12 +281,12 @@ class CopyFileBackend extends Maintenance { sleep( 10 ); // wait and retry copy again $status = $dst->doQuickOperations( $ops, array( 'bypassReadOnly' => 1 ) ); } - $ellapsed_ms = floor( ( microtime( true ) - $t_start ) * 1000 ); + $elapsed_ms = floor( ( microtime( true ) - $t_start ) * 1000 ); if ( !$status->isOK() ) { $this->error( print_r( $status->getErrorsArray(), true ) ); $this->error( "$wikiId: Could not copy file batch.", 1 ); // die } elseif ( count( $copiedRel ) ) { - $this->output( "\n\tCopied these file(s) [{$ellapsed_ms}ms]:\n\t" . + $this->output( "\n\tCopied these file(s) [{$elapsed_ms}ms]:\n\t" . implode( "\n\t", $copiedRel ) . "\n\n" ); } } @@ -318,12 +318,12 @@ class CopyFileBackend extends Maintenance { sleep( 10 ); // wait and retry copy again $status = $dst->doQuickOperations( $ops, array( 'bypassReadOnly' => 1 ) ); } - $ellapsed_ms = floor( ( microtime( true ) - $t_start ) * 1000 ); + $elapsed_ms = floor( ( microtime( true ) - $t_start ) * 1000 ); if ( !$status->isOK() ) { $this->error( print_r( $status->getErrorsArray(), true ) ); $this->error( "$wikiId: Could not delete file batch.", 1 ); // die } elseif ( count( $deletedRel ) ) { - $this->output( "\n\tDeleted these file(s) [{$ellapsed_ms}ms]:\n\t" . + $this->output( "\n\tDeleted these file(s) [{$elapsed_ms}ms]:\n\t" . implode( "\n\t", $deletedRel ) . "\n\n" ); } } @@ -373,6 +373,7 @@ class CopyFileBackend extends Maintenance { $same = ( $src->getFileSha1Base36( array( 'src' => $sPath, 'latest' => 1 ) ) === $dst->getFileSha1Base36( array( 'src' => $dPath, 'latest' => 1 ) ) ); } + return $same; } }