File tree Expand file tree Collapse file tree 1 file changed +1
-14
lines changed Expand file tree Collapse file tree 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
1717
1818 public function calculateFilesize (): int
1919 {
20- return $ this ->getS3Client ()->headObject ([
21- 'Bucket ' => $ this ->getBucket (),
22- 'Key ' => $ this ->getKey ()
23- ])->get ('ContentLength ' );
20+ return $ this ->getReadableStream ()->getSize ();
2421 }
2522
2623 public function setS3Client (S3Client $ client ): self
@@ -39,16 +36,6 @@ public function getS3Client(): S3Client
3936 return $ this ->client ;
4037 }
4138
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-
5239 protected function buildReadableStream (): StreamInterface
5340 {
5441 $ this ->getS3Client ()->registerStreamWrapper ();
You can’t perform that action at this time.
0 commit comments