Browse Source

Added File::cleandir.

Taylor Otwell 12 years ago
parent
commit
b41bba45d7
1 changed files with 11 additions and 0 deletions
  1. 11 0
      laravel/file.php

+ 11 - 0
laravel/file.php

@@ -273,6 +273,17 @@ class File {
 		if ( ! $preserve) @rmdir($directory);
 	}
 
+	/**
+	 * Empty the specified directory of all files and folders.
+	 *
+	 * @param  string  $directory
+	 * @return void
+	 */
+	public static function cleandir($directory)
+	{
+		return static::rmdir($directory, true);
+	}
+
 	/**
 	 * Get the most recently modified file in a directory.
 	 *