Skip to content

Commit 142808d

Browse files
committed
fix authentication required after 1 day
1 parent ea3fc83 commit 142808d

2 files changed

Lines changed: 8 additions & 10 deletions

File tree

src/BackblazeAdapter.php

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -10,17 +10,17 @@
1010

1111
class BackblazeAdapter extends AbstractAdapter
1212
{
13-
1413
use NotSupportingVisibilityTrait;
1514

16-
protected $client;
17-
15+
protected $accountId;
16+
protected $applicationKey;
1817
protected $bucketName;
1918

20-
public function __construct(Client $client, $bucketName)
19+
public function __construct($accountId, $applicationKey, $bucketName)
2120
{
22-
$this->client = $client;
23-
$this->bucketName = $bucketName;
21+
$this->accountId = $accountId;
22+
$this->applicationKey = $applicationKey;
23+
$this->bucketName = $bucketName;
2424
}
2525

2626
/**
@@ -207,7 +207,7 @@ public function getTimestamp($path)
207207
*/
208208
public function getClient()
209209
{
210-
return $this->client;
210+
return new Client($this->accountId, $this->applicationKey);
211211
}
212212

213213
/**

src/BackblazeServiceProvider.php

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22

33
namespace RunCloudIO\FlysystemB2;
44

5-
use ChrisWhite\B2\Client;
65
use Illuminate\Support\Facades\Storage;
76
use Illuminate\Support\ServiceProvider;
87
use League\Flysystem\Filesystem;
@@ -19,8 +18,7 @@ public function boot()
1918
isset($config['bucketName']))) {
2019
throw new \Exception('Please set all configuration keys. (accountId, applicationKey, bucketName)');
2120
}
22-
$client = new Client($config['accountId'], $config['applicationKey']);
23-
$adapter = new BackblazeAdapter($client, $config['bucketName']);
21+
$adapter = new BackblazeAdapter($config['accountId'], $config['applicationKey'], $config['bucketName']);
2422
return new Filesystem($adapter);
2523
});
2624
}

0 commit comments

Comments
 (0)