From 15043348c13b9d6855790fac818607255e984c02 Mon Sep 17 00:00:00 2001 From: Taylor Otwell Date: Mon, 22 Aug 2011 22:30:58 -0500 Subject: [PATCH] refactoring file class. --- laravel/file.php | 21 ++++++++++++++++++--- 1 file changed, 18 insertions(+), 3 deletions(-) diff --git a/laravel/file.php b/laravel/file.php index 676e8c8e..1ae1b69e 100644 --- a/laravel/file.php +++ b/laravel/file.php @@ -74,6 +74,13 @@ class File { /** * Get a file MIME type by extension. * + * Any extension in the MIMEs configuration file may be passed to the method. + * + * + * // Returns "application/x-tar" + * $mime = File::mime('tar'); + * + * * @param string $extension * @param string $default * @return string @@ -93,9 +100,17 @@ class File { /** * Determine if a file is a given type. * - * The Fileinfo PHP extension will be used to determine the MIME type - * of the file. Any extension in the mimes configuration array may - * be passed as a type. + * The Fileinfo PHP extension will be used to determine the MIME type of the file. Any extension + * in the MIMEs configuration file may be passed as a type. + * + * + * // Determine if the file is a JPG image + * $image = File::is('jpg', 'path/to/image.jpg'); + * + * + * @param string $extension + * @param string $path + * @return bool */ public static function is($extension, $path) {