|
@@ -129,15 +129,12 @@ class Filesystem
|
|
{
|
|
{
|
|
$it = new RecursiveDirectoryIterator($source, RecursiveDirectoryIterator::SKIP_DOTS);
|
|
$it = new RecursiveDirectoryIterator($source, RecursiveDirectoryIterator::SKIP_DOTS);
|
|
$ri = new RecursiveIteratorIterator($it, RecursiveIteratorIterator::SELF_FIRST);
|
|
$ri = new RecursiveIteratorIterator($it, RecursiveIteratorIterator::SELF_FIRST);
|
|
-
|
|
|
|
- if (!file_exists($target)) {
|
|
|
|
- mkdir($target, 0777, true);
|
|
|
|
- }
|
|
|
|
|
|
+ $this->ensureDirectoryExists($target);
|
|
|
|
|
|
foreach ($ri as $file) {
|
|
foreach ($ri as $file) {
|
|
$targetPath = $target . DIRECTORY_SEPARATOR . $ri->getSubPathName();
|
|
$targetPath = $target . DIRECTORY_SEPARATOR . $ri->getSubPathName();
|
|
if ($file->isDir()) {
|
|
if ($file->isDir()) {
|
|
- mkdir($targetPath);
|
|
|
|
|
|
+ $this->ensureDirectoryExists($targetPath);
|
|
} else {
|
|
} else {
|
|
copy($file->getPathname(), $targetPath);
|
|
copy($file->getPathname(), $targetPath);
|
|
}
|
|
}
|