File tree 1 file changed +1
-14
lines changed
1 file changed +1
-14
lines changed Original file line number Diff line number Diff line change @@ -17,10 +17,7 @@ class S3File extends File
17
17
18
18
public function calculateFilesize (): int
19
19
{
20
- return $ this ->getS3Client ()->headObject ([
21
- 'Bucket ' => $ this ->getBucket (),
22
- 'Key ' => $ this ->getKey ()
23
- ])->get ('ContentLength ' );
20
+ return $ this ->getReadableStream ()->getSize ();
24
21
}
25
22
26
23
public function setS3Client (S3Client $ client ): self
@@ -39,16 +36,6 @@ public function getS3Client(): S3Client
39
36
return $ this ->client ;
40
37
}
41
38
42
- public function getBucket (): string
43
- {
44
- return parse_url ($ this ->getSource (), PHP_URL_HOST );
45
- }
46
-
47
- public function getKey (): string
48
- {
49
- return ltrim (parse_url ($ this ->getSource (), PHP_URL_PATH ), "/ " );
50
- }
51
-
52
39
protected function buildReadableStream (): StreamInterface
53
40
{
54
41
$ this ->getS3Client ()->registerStreamWrapper ();
You can’t perform that action at this time.
0 commit comments