RecursiveIteratorIterator::LEAVES_ONLY
);
} private function replaceRecoveryFiles(string
$fileDir): void
{ $recoveryDir =
$fileDir . '/recovery';
if (!
is_dir($recoveryDir)) { return;
} $iterator =
$this->
createRecursiveFileIterator($recoveryDir);
$fs =
new Filesystem();
foreach ($iterator as $file) { $sourceFile =
$file->
getPathname();
$destinationFile =
Shopware()->
DocPath() .
str_replace($fileDir, '',
$file->
getPathname());
$destinationDirectory = \
dirname($destinationFile);
$fs->
mkdir($destinationDirectory);
$fs->
rename($sourceFile,
$destinationFile, true
);
} }