When deleting old thumbnails, actually increment $i
authorReedy <reedy@wikimedia.org>
Sun, 21 Oct 2012 14:14:10 +0000 (15:14 +0100)
committerReedy <reedy@wikimedia.org>
Sun, 21 Oct 2012 14:15:22 +0000 (15:15 +0100)
Change-Id: Ic213fed61959ab4d25bcd891c81df20e39cbc5f5

maintenance/cleanupUploadStash.php

index 6afe9e1..dc03c34 100644 (file)
@@ -70,7 +70,7 @@ class UploadStashCleanup extends Maintenance {
                        array_push( $keys, $row->us_key );
                }
 
-               $this->output( 'Removing ' . count($keys) . " file(s)...\n" );
+               $this->output( 'Removing ' . count( $keys ) . " file(s)...\n" );
                // this could be done some other, more direct/efficient way, but using
                // UploadStash's own methods means it's less likely to fall accidentally
                // out-of-date someday
@@ -100,6 +100,7 @@ class UploadStashCleanup extends Maintenance {
                $this->output( "Deleting old thumbnails...\n" );
                $i = 0;
                foreach ( $iterator as $file ) {
+                       $i++;
                        if ( wfTimestamp( TS_UNIX, $tempRepo->getFileTimestamp( "$dir/$file" ) ) < $cutoff ) {
                                $tempRepo->quickPurge( "$dir/$file" );
                        }