public function migrate(MediaServiceInterface
$fromFilesystem, MediaServiceInterface
$toFileSystem, OutputInterface
$output,
$skipScan = false
) { $output->
writeln(' // Migrating all media files in your filesystem. This might take some time, depending on the number of media files you have.'
);
$output->
writeln(''
);
$filesToMigrate = 0;
if (!
$skipScan) { $filesToMigrate =
$this->
countFilesToMigrate('media',
$fromFilesystem);
} $progressBar =
new ProgressBar($output,
$filesToMigrate);
$progressBar->
setFormat(" %current%/%max% [%bar%] %percent%%, %migrated% migrated, %skipped% skipped, %moved% moved, Elapsed: %elapsed%\n Current file: %filename%"
);
$progressBar->
setMessage('', 'filename'
);
$this->
migrateFilesIn('media',
$fromFilesystem,
$toFileSystem,
$progressBar);
$progressBar->
finish();
$rows =
[];
foreach ($this->counter
as $key =>
$value) { $rows[] =
[$key,
$value];
}