Skip to content

Commit 85c795d

Browse files
authored
Merge pull request #15 from PhpGt/14-nested-directories
feature: allow nested directories
2 parents 923dc60 + f7ac021 commit 85c795d

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/FileAccess.php

+3-3
Original file line numberDiff line numberDiff line change
@@ -18,10 +18,10 @@ public function getData(string $name):mixed {
1818
}
1919

2020
public function setData(string $name, mixed $value):void {
21-
if(!is_dir($this->dirPath)) {
22-
mkdir($this->dirPath, 0775, true);
23-
}
2421
$filePath = "$this->dirPath/$name";
22+
if(!is_dir(dirname($filePath))) {
23+
mkdir(dirname($filePath), 0775, true);
24+
}
2525
file_put_contents($filePath, serialize($value));
2626
}
2727

0 commit comments

Comments
 (0)