Skip to content
Permalink
Browse files

add method to ensure a directory exists

  • Loading branch information
taylorotwell committed Jan 27, 2020
1 parent b5f3d22 commit 8a8eed4d157102ef77527891ac1d8f8e85e7afee
Showing with 15 additions and 0 deletions.
  1. +15 −0 src/Illuminate/Filesystem/Filesystem.php
@@ -459,6 +459,21 @@ public function directories($directory)
return $directories;
}

/**
* Ensure a directory exists.
*
* @param string $path
* @param int $mode
* @param bool $recursive
* @return void
*/
public function ensureDirectoryExists($path, $mode = 0755, $recursive = true)
{
if (! $this->isDirectory($path)) {
$this->makeDirectory($path, $mode, $recursive);
}
}

/**
* Create a directory.
*

0 comments on commit 8a8eed4

Please sign in to comment.
You can’t perform that action at this time.