Browse Source

Added File::move and File::copy methods.

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

+ 24 - 0
laravel/file.php

@@ -68,6 +68,30 @@ class File {
 		if (static::exists($path)) @unlink($path);
 	}
 
+	/**
+	 * Move a file to a new location.
+	 *
+	 * @param  string  $path
+	 * @param  string  $target
+	 * @return void
+	 */
+	public static function move($path, $target)
+	{
+		return rename($path, $target);
+	}
+
+	/**
+	 * Copy a file to a new location.
+	 *
+	 * @param  string  $path
+	 * @param  string  $target
+	 * @return void
+	 */
+	public static function copy($path, $target)
+	{
+		return copy($path, $target);
+	}
+
 	/**
 	 * Extract the file extension from a file path.
 	 *