Commit 0637042c authored by Taylor Otwell's avatar Taylor Otwell

Added preserve option to File::rmdir.

parent 3c3e9136
...@@ -246,9 +246,10 @@ class File { ...@@ -246,9 +246,10 @@ class File {
* Recursively delete a directory. * Recursively delete a directory.
* *
* @param string $directory * @param string $directory
* @param bool $preserve
* @return void * @return void
*/ */
public static function rmdir($directory) public static function rmdir($directory, $preserve = false)
{ {
if ( ! is_dir($directory)) return; if ( ! is_dir($directory)) return;
...@@ -269,7 +270,7 @@ class File { ...@@ -269,7 +270,7 @@ class File {
} }
} }
@rmdir($directory); if ( ! $preserve) @rmdir($directory);
} }
/** /**
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment