diff --git a/bl-kernel/helpers/filesystem.class.php b/bl-kernel/helpers/filesystem.class.php index c7417afa..81e37290 100644 --- a/bl-kernel/helpers/filesystem.class.php +++ b/bl-kernel/helpers/filesystem.class.php @@ -27,6 +27,7 @@ class Filesystem { // $chunk = amount of chunks, FALSE if you don't want to chunk public static function listFiles($path, $regex='*', $extension='*', $sortByDate=false, $chunk=false) { + error_log($path.$regex.'.'.$extension); $files = glob($path.$regex.'.'.$extension); if (empty($files)) { @@ -292,4 +293,18 @@ class Filesystem { return sprintf("%.{$decimals}f ", $bytes / pow(1024, $factor)) . @$size[$factor]; } + /* + | Returns the mime type of the file + | Example: + | @file /home/diego/dog.jpg + | @return image/jpeg + | + | @file string Full path of the file + | + | @return string + */ + public static function mimeType($file) { + return mime_content_type($file); + } + }