mirror of
https://github.com/getformwork/formwork.git
synced 2025-01-18 05:58:20 +01:00
Make FileSystem::createDirectory()
error handling similar to FileSystem::createFile()
This commit is contained in:
parent
43b9836b3c
commit
b29350e801
@ -447,8 +447,10 @@ class FileSystem
|
||||
*/
|
||||
public static function createDirectory(string $directory, bool $recursive = false): bool
|
||||
{
|
||||
static::assertExists($directory, false);
|
||||
return @mkdir($directory, 0777, $recursive);
|
||||
if (@mkdir($directory, 0777, $recursive)) {
|
||||
return true;
|
||||
}
|
||||
throw new RuntimeException('Cannot create directory ' . $directory);
|
||||
}
|
||||
|
||||
/**
|
||||
|
Loading…
x
Reference in New Issue
Block a user