Skip to content

Commit 77dba1a

Browse files
author
Ahmad Fikrizaman Bin Abd Rahim
committed
accel redirect data
1 parent 142808d commit 77dba1a

1 file changed

Lines changed: 14 additions & 0 deletions

File tree

src/BackblazeAdapter.php

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
use League\Flysystem\Adapter\AbstractAdapter;
88
use League\Flysystem\Adapter\Polyfill\NotSupportingVisibilityTrait;
99
use League\Flysystem\Config;
10+
use League\Flysystem\Util;
1011

1112
class BackblazeAdapter extends AbstractAdapter
1213
{
@@ -118,6 +119,19 @@ public function readStream($path)
118119
return ['type' => 'file', 'path' => $path, 'stream' => $resource];
119120
}
120121

122+
public function accelRedirectData($path)
123+
{
124+
$path = Util::normalizePath($path);
125+
$file = $this->getClient()->getFile([
126+
'BucketName' => $this->bucketName,
127+
'FileName' => $path,
128+
]);
129+
130+
return $this->getClient()->accelRedirectData([
131+
'FileId' => $file->getId(),
132+
]);
133+
}
134+
121135
/**
122136
* {@inheritdoc}
123137
*/

0 commit comments

Comments
 (0)