From a5821cf8bed53d8b45febab20e6524df501293a8 Mon Sep 17 00:00:00 2001 From: Aaron Date: Tue, 10 Jul 2012 12:20:55 -0700 Subject: [PATCH] [FileBackend] Only show "copied file(s)" for files the script had to copy. Change-Id: I22741303e05d6ea50d33875d9f7438d2b3905b18 --- maintenance/copyFileBackend.php | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/maintenance/copyFileBackend.php b/maintenance/copyFileBackend.php index 1f72e33226..0af1aa7d18 100644 --- a/maintenance/copyFileBackend.php +++ b/maintenance/copyFileBackend.php @@ -104,6 +104,7 @@ class CopyFileBackend extends Maintenance { ) { $ops = array(); $fsFiles = array(); + $copiedRel = array(); // for output message foreach ( $srcPathsRel as $srcPathRel ) { $srcPath = $src->getRootStoragePath() . "/$backendRel/$srcPathRel"; $dstPath = $dst->getRootStoragePath() . "/$backendRel/$srcPathRel"; @@ -125,6 +126,7 @@ class CopyFileBackend extends Maintenance { } $ops[] = array( 'op' => 'store', 'src' => $fsFile->getPath(), 'dst' => $dstPath, 'overwrite' => 1 ); + $copiedRel[] = $srcPathRel; } $t_start = microtime( true ); @@ -133,9 +135,9 @@ class CopyFileBackend extends Maintenance { if ( !$status->isOK() ) { $this->error( print_r( $status->getErrorsArray(), true ) ); $this->error( "Could not copy file batch.", 1 ); // die - } else { + } elseif ( count( $copiedRel ) ) { $this->output( "\nCopied these file(s) [{$ellapsed_ms}ms]:\n" . - implode( "\n", $srcPathsRel ) . "\n\n" ); + implode( "\n", $copiedRel ) . "\n\n" ); } } -- 2.20.1