File tree Expand file tree Collapse file tree 2 files changed +9
-1
lines changed
src/Illuminate/Filesystem Expand file tree Collapse file tree 2 files changed +9
-1
lines changed Original file line number Diff line number Diff line change 6
6
use FilesystemIterator ;
7
7
use Illuminate \Contracts \Filesystem \FileNotFoundException ;
8
8
use Illuminate \Support \Traits \Macroable ;
9
+ use RuntimeException ;
9
10
use Symfony \Component \Finder \Finder ;
10
11
use Symfony \Component \Mime \MimeTypes ;
11
12
@@ -321,6 +322,12 @@ public function extension($path)
321
322
*/
322
323
public function guessExtension ($ path )
323
324
{
325
+ if (! class_exists (MimeTypes::class)) {
326
+ throw new RuntimeException (
327
+ 'To enable support for guessing extensions, please install the symfony/mime package. '
328
+ );
329
+ }
330
+
324
331
return (new MimeTypes )->getExtensions ($ this ->mimeType ($ path ))[0 ] ?? null ;
325
332
}
326
333
Original file line number Diff line number Diff line change 35
35
"league/flysystem-aws-s3-v3" : " Required to use the Flysystem S3 driver (^1.0)." ,
36
36
"league/flysystem-cached-adapter" : " Required to use the Flysystem cache (^1.0)." ,
37
37
"league/flysystem-sftp" : " Required to use the Flysystem SFTP driver (^1.0)." ,
38
- "psr/http-message" : " Required to allow Storage::put to accept a StreamInterface (^1.0)."
38
+ "psr/http-message" : " Required to allow Storage::put to accept a StreamInterface (^1.0)." ,
39
+ "symfony/mime" : " Required to enable support for guessing extensions (^5.0)."
39
40
},
40
41
"config" : {
41
42
"sort-packages" : true
You can’t perform that action at this time.
0 commit comments