Skip to content

Commit c77eb90

Browse files
committed
seeder missing folder creation
1 parent 66d3ecc commit c77eb90

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

src/Commands/H5PSeedCommand.php

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,9 +29,14 @@ private function downloadAndSeed($lib, $addContent = false)
2929
// eg https://h5p.org/sites/default/files/h5p/exports/interactive-video-2-618.h5p
3030
$url = "https://h5p.org/sites/default/files/h5p/exports/$lib";
3131

32-
$filename = realpath(__dir__."/../../storage/h5p/temp")."/$lib";
3332
$filename = storage_path("app/h5p/temp/$lib");
3433

34+
$dirname = dirname($filename);
35+
36+
if (!is_dir($dirname)) {
37+
mkdir($dirname, 0777, true);
38+
}
39+
3540
if (!is_file($filename)) {
3641
if (file_put_contents($filename, file_get_contents($url))) {
3742
echo "File downloaded from $url \n";

0 commit comments

Comments
 (0)