From 3c7a1270a71b8a9d3693d69057e7695fd3772c8f Mon Sep 17 00:00:00 2001 From: Taylor Otwell Date: Wed, 21 Mar 2012 11:25:37 -0500 Subject: [PATCH] Added File::move and File::copy methods. --- laravel/file.php | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/laravel/file.php b/laravel/file.php index 94147485..ca08a9c5 100644 --- a/laravel/file.php +++ b/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. *