|
1 | | -# flysystem-backblaze |
| 1 | +# flysystem-b2 |
2 | 2 |
|
3 | | -[](https://twitter.com/mhetreramesh) |
4 | | -[](https://packagist.org/packages/mhetreramesh/flysystem-backblaze) |
5 | | -[![Software License][ico-license]](LICENSE.md) |
6 | | -[](https://travis-ci.org/gliterd/flysystem-backblaze) |
7 | | -[![Coverage Status][ico-scrutinizer]][link-scrutinizer] |
8 | | -[![Quality Score][ico-code-quality]][link-code-quality] |
9 | | -[](https://packagist.org/packages/mhetreramesh/flysystem-backblaze) |
| 3 | +This is a fork based on https://github.com/mhetreramesh/flysystem-backblaze. It includes download file stream. Since B2 SDK from original package no longer maintained (Last PR merge is November 2016), I'm including the B2 SDK that I've forked and modified. This package also include ServiceProvider for Laravel. |
10 | 4 |
|
11 | 5 | Visit (https://secure.backblaze.com/b2_buckets.htm) and get your account id, application key. |
12 | 6 |
|
13 | | -The Backblaze adapter gives the possibility to use the Flysystem filesystem abstraction library with backblaze. It uses the [Backblaze B2 SDK](https://github.com/cwhite92/b2-sdk-php) to communicate with the API. |
| 7 | +The Backblaze adapter gives the possibility to use the Flysystem filesystem abstraction library with backblaze. It uses the [Backblaze B2 SDK](https://github.com/RunCloudIO/b2-sdk-php) to communicate with the API. |
14 | 8 |
|
15 | 9 | ## Install |
16 | 10 |
|
17 | 11 | Via Composer |
18 | 12 |
|
19 | 13 | ``` bash |
20 | | -$ composer require mhetreramesh/flysystem-backblaze |
| 14 | +$ composer require runcloudio/flysystem-b2 |
21 | 15 | ``` |
22 | 16 |
|
23 | | -## Usage |
| 17 | +## Usage with Laravel |
| 18 | + |
| 19 | + |
| 20 | +In your app.php config file add to the list of service providers: |
| 21 | +``` |
| 22 | +\RunCloudIO\FlysystemB2\BackblazeServiceProvider::class, |
| 23 | +``` |
| 24 | + |
| 25 | +Add the following to your filesystems.php config file in the ```disks``` section: |
| 26 | +``` |
| 27 | +'b2' => [ |
| 28 | + 'driver' => 'b2', |
| 29 | + 'accountId' => '', |
| 30 | + 'applicationKey' => '', |
| 31 | + 'bucketName' => '', |
| 32 | +], |
| 33 | +``` |
| 34 | + |
| 35 | +Just use it as you normally would use the Storage facade. |
| 36 | +``` |
| 37 | +\Storage::disk('b2')->put('test.txt', 'test') |
| 38 | +``` |
| 39 | +and |
| 40 | +``` |
| 41 | +\Storage::disk('b2')->get('test.txt') |
| 42 | +``` |
| 43 | + |
| 44 | + |
| 45 | +## Usage without Laravel |
24 | 46 |
|
25 | 47 | ``` php |
26 | | -use Mhetreramesh\Flysystem\BackblazeAdapter; |
| 48 | +use RunCloudIO\FlysystemB2\BackblazeAdapter; |
27 | 49 | use League\Flysystem\Filesystem; |
28 | 50 | use ChrisWhite\B2\Client; |
29 | 51 |
|
|
0 commit comments