Skip to content

Commit

Permalink
Merge pull request #4 from bladeroot/create-path-error
Browse files Browse the repository at this point in the history
throw exception when could not create storage
  • Loading branch information
SilverFire committed Feb 4, 2019
2 parents 83b33c5 + 29ebbe7 commit 2cb410d
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/FileStorage.php
Expand Up @@ -41,7 +41,9 @@ public function set($name, $text)
$path = $this->getFullPath($name);
$dir = dirname($path);
if (!is_dir($dir)) {
mkdir($dir, 0755, true);
if (!mkdir($dir, 0755, true)) {
throw new \Exception('Could not create storage in ' . $dir);
}
}

return file_put_contents($path, $text);
Expand Down

0 comments on commit 2cb410d

Please sign in to comment.