Merge pull request #12 from chillu/pulls/check-file-existence

Check file existence in for_file()
This commit is contained in:
Damian Mooyman 2015-05-12 16:45:35 +12:00
commit fd917f04a1

View File

@ -72,9 +72,13 @@ abstract class FileTextExtractor extends Object {
/**
* @param string $path
* @return FileTextExtractor
* @return FileTextExtractor|null
*/
static function for_file($path) {
if(!file_exists($path) || is_dir($path)) {
return;
}
$extension = pathinfo($path, PATHINFO_EXTENSION);
$mime = self::get_mime($path);
foreach(self::get_extractor_classes() as $className) {