Skip to content

Commit aa7ded3

Browse files
committed
feat: add ChecksumProvider
1 parent f759846 commit aa7ded3

File tree

2 files changed

+11
-2
lines changed

2 files changed

+11
-2
lines changed

composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
}
1010
],
1111
"require": {
12-
"league/flysystem": "^3.6",
12+
"league/flysystem": "^3.7",
1313
"ext-json": "*",
1414
"guzzlehttp/guzzle": "^7.4",
1515
"league/mime-type-detection": "^1.11"

src/BunnyCDNAdapter.php

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@
33
namespace PlatformCommunity\Flysystem\BunnyCDN;
44

55
use Exception;
6+
use League\Flysystem\CalculateChecksumFromStream;
7+
use League\Flysystem\ChecksumProvider;
68
use League\Flysystem\Config;
79
use League\Flysystem\DirectoryAttributes;
810
use League\Flysystem\DirectoryListing;
@@ -27,8 +29,10 @@
2729
use RuntimeException;
2830
use TypeError;
2931

30-
class BunnyCDNAdapter implements FilesystemAdapter, PublicUrlGenerator
32+
class BunnyCDNAdapter implements FilesystemAdapter, PublicUrlGenerator, ChecksumProvider
3133
{
34+
use CalculateChecksumFromStream;
35+
3236
/**
3337
* Pull Zone URL
3438
*
@@ -486,4 +490,9 @@ private function replaceFirst(string $search, string $replace, string $subject):
486490

487491
return $subject;
488492
}
493+
494+
public function checksum(string $path, Config $config): string
495+
{
496+
return $this->calculateChecksumFromStream($path, $config);
497+
}
489498
}

0 commit comments

Comments
 (0)