mirror of
https://github.com/silverstripe/silverstripe-textextraction
synced 2024-10-22 11:06:00 +02:00
Merge pull request #12 from chillu/pulls/check-file-existence
Check file existence in for_file()
This commit is contained in:
commit
fd917f04a1
@ -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) {
|
||||
|
Loading…
Reference in New Issue
Block a user