+ } elseif ( $this->getOption( 'prestat' ) ) {
+ // Build the stat cache for the destination files
+ $this->output( "Building destination stat cache..." );
+ $dstPathsRel = $dst->getFileList( array(
+ 'dir' => $dst->getRootStoragePath() . "/$backendRel",
+ 'adviseStat' => true // avoid HEADs
+ ) );
+ if ( $dstPathsRel === null ) {
+ $this->error( "Could not list files in $container.", 1 ); // die
+ }
+ $this->statCache = array(); // clear
+ foreach ( $dstPathsRel as $dstPathRel ) {
+ $path = $dst->getRootStoragePath() . "/$backendRel/$dstPathRel";
+ $this->statCache[sha1( $path )] = $dst->getFileStat( array( 'src' => $path ) );
+ }
+ $this->output( "done [" . count( $this->statCache ) . " file(s)]\n" );