Skip to content

Commit

Permalink
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix 1827
Browse files Browse the repository at this point in the history
mvorisek committed Aug 27, 2022
1 parent 56bb21c commit 7bf745d
Showing 1 changed file with 12 additions and 14 deletions.
26 changes: 12 additions & 14 deletions demos/init-db.php
Original file line number Diff line number Diff line change
@@ -363,23 +363,21 @@ public function importFromFilesystem(string $path, bool $isSub = null): void
continue;
}

if (in_array($fileinfo->getFilename(), ['demos', 'src', 'tests'], true) || $isSub) {
$entity = $this->createEntity();
$entity = $this->createEntity();

$entity->save([
$this->fieldName()->name => $fileinfo->getFilename(),
$this->fieldName()->is_folder => $fileinfo->isDir(),
$this->fieldName()->type => pathinfo($fileinfo->getFilename(), \PATHINFO_EXTENSION),
]);
$entity->save([
$this->fieldName()->name => $fileinfo->getFilename(),
$this->fieldName()->is_folder => $fileinfo->isDir(),
$this->fieldName()->type => pathinfo($fileinfo->getFilename(), \PATHINFO_EXTENSION),
]);

if ($fileinfo->isDir()) {
$entity->SubFolder->importFromFilesystem($fileinfo->getPath() . '/' . $fileinfo->getFilename(), true);
}
if ($fileinfo->isDir()) {
$entity->SubFolder->importFromFilesystem($fileinfo->getPath() . '/' . $fileinfo->getFilename(), true);
}

// skip full/slow import for Behat testing
if ($_ENV['CI'] ?? null) {
break;
}
// skip full/slow import for Behat testing
if ($_ENV['CI'] ?? null) {
break;
}
}
}

0 comments on commit 7bf745d

Please sign in to comment.