@@ 109-121 (lines=13) @@ | ||
106 | $this->output( "\tCopying file(s)...\n" ); |
|
107 | $count = 0; |
|
108 | $batchPaths = []; |
|
109 | foreach ( $srcPathsRel as $srcPathRel ) { |
|
110 | // Check up on the rate file periodically to adjust the concurrency |
|
111 | if ( $rateFile && ( !$count || ( $count % 500 ) == 0 ) ) { |
|
112 | $this->mBatchSize = max( 1, (int)file_get_contents( $rateFile ) ); |
|
113 | $this->output( "\tBatch size is now {$this->mBatchSize}.\n" ); |
|
114 | } |
|
115 | $batchPaths[$srcPathRel] = 1; // remove duplicates |
|
116 | if ( count( $batchPaths ) >= $this->mBatchSize ) { |
|
117 | $this->copyFileBatch( array_keys( $batchPaths ), $backendRel, $src, $dst ); |
|
118 | $batchPaths = []; // done |
|
119 | } |
|
120 | ++$count; |
|
121 | } |
|
122 | if ( count( $batchPaths ) ) { // left-overs |
|
123 | $this->copyFileBatch( array_keys( $batchPaths ), $backendRel, $src, $dst ); |
|
124 | $batchPaths = []; // done |
|
@@ 136-148 (lines=13) @@ | ||
133 | $this->output( "\tDeleting file(s)...\n" ); |
|
134 | $count = 0; |
|
135 | $batchPaths = []; |
|
136 | foreach ( $delPathsRel as $delPathRel ) { |
|
137 | // Check up on the rate file periodically to adjust the concurrency |
|
138 | if ( $rateFile && ( !$count || ( $count % 500 ) == 0 ) ) { |
|
139 | $this->mBatchSize = max( 1, (int)file_get_contents( $rateFile ) ); |
|
140 | $this->output( "\tBatch size is now {$this->mBatchSize}.\n" ); |
|
141 | } |
|
142 | $batchPaths[$delPathRel] = 1; // remove duplicates |
|
143 | if ( count( $batchPaths ) >= $this->mBatchSize ) { |
|
144 | $this->delFileBatch( array_keys( $batchPaths ), $backendRel, $dst ); |
|
145 | $batchPaths = []; // done |
|
146 | } |
|
147 | ++$count; |
|
148 | } |
|
149 | if ( count( $batchPaths ) ) { // left-overs |
|
150 | $this->delFileBatch( array_keys( $batchPaths ), $backendRel, $dst ); |
|
151 | $batchPaths = []; // done |