You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit cf6a12b
Browse filesBrowse the repository at this point in the historyBrowse files
`b2-sdk-php` is a client library for working with Backblaze's B2 storage service.
4
+
`backblaze-b2-php` is a client library for working with the B2 cloud storage service from Backblaze.
5
5
6
6
## Documentation
7
7
8
-
[Full documentation of the Backblaze B2 API can be found here.](https://www.backblaze.com/b2/docs/index.html)
8
+
[Full documentation of the Backblaze B2 API can be found here.][b2-docs]
9
9
10
-
Each method is well documented in [`src/client.php`](src/Client.php).
11
-
12
-
For examples and options that are specific to this library, please see [`docs/`](docs/):
13
-
14
-
*[Authorization](docs/authorization.md)
15
-
*[Downloading](docs/downloading.md)
16
-
*[Uploading](docs/uploading.md)
17
-
*[Large Files](docs/large_files.md)
18
-
*[Buckets](docs/buckets.md)
19
-
*[Files](docs/files.md)
20
-
*[Keys](docs/keys.md)
10
+
Complete documentation for this library does not exist yet, however most methods are already documented in the source code.
21
11
22
12
## Installation
23
13
24
14
Installation is via Composer:
25
15
26
16
```bash
27
-
$ composer require zaxbux/b2-sdk-php
17
+
$ composer require zaxbux/backblaze-b2-php
28
18
```
29
19
30
20
## Getting Started
@@ -37,15 +27,15 @@ use Zaxbux\BackblazeB2\Client;
37
27
$accountId = '...';
38
28
$applicationKey = '...';
39
29
40
-
$client = new Client($accountId, $applicationKey);
30
+
$client = new Client([$accountId, $applicationKey]);
41
31
42
32
// Retrieve an array of Bucket objects on your account.
43
33
$buckets = $client->listBuckets();
44
34
```
45
35
46
36
## Authorization Cache
47
37
48
-
If you want to cache the authorization token to reduce the number of API calls, create a class that implements `Zaxbux\BackblazeB2\AuthorizationCacheInterface`.
38
+
If you want to cache the authorization token to reduce the number of API calls, create a class that implements `Zaxbux\BackblazeB2\Interfaces\AuthorizationCacheInterface`.
49
39
50
40
```php
51
41
<?php
@@ -54,15 +44,17 @@ use Zaxbux\BackblazeB2\Client;
54
44
55
45
$authCache = new AuthorizationCacheExample;
56
46
57
-
$client = new Client($accountId, $applicationKey, $authCache);
47
+
$client = new Client(new Config($accountId, $applicationKey, [
48
+
'authorizationCache' => $authCache,
49
+
]));
58
50
59
51
```
60
52
61
53
### Sample Authorization Cache
62
54
```php
63
55
<?php
64
56
65
-
use Zaxbux\BackblazeB2\AuthorizationCacheInterface;
57
+
use Zaxbux\BackblazeB2\Interfaces\AuthorizationCacheInterface;
66
58
67
59
class AuthorizationCacheExample implements AuthorizationCacheInterface {
68
60
public function cache($key, $value) {
@@ -89,6 +81,10 @@ $ vendor/bin/phpunit
89
81
90
82
Feel free to contribute in any way by reporting an issue, making a suggestion, or submitting a pull request.
0 commit comments