runcloudio/flysystem-b2

Backblaze adapter for the flysystem filesystem abstraction library. A fork from https://github.com/mhetreramesh/flysystem-backblaze and maintained as separate package.

1.1.3 2018-09-27 17:39 UTC

README

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.

Visit (https://secure.backblaze.com/b2_buckets.htm) and get your account id, application key.

The Backblaze adapter gives the possibility to use the Flysystem filesystem abstraction library with backblaze. It uses the Backblaze B2 SDK to communicate with the API.

Install

Via Composer

$ composer require runcloudio/flysystem-b2

Usage with Laravel

If you are using Laravel 5.4 and below, add this line to app.php inside list of Service Providers.:

\RunCloudIO\FlysystemB2\BackblazeServiceProvider::class,

Starting from Laravel 5.5, they implements Package Auto Discovery, so you don't have to add the service provider.

Doesn't matter which Laravel version you are using, add the following to your filesystems.php config file in the disks section:

'b2' => [
    'driver'         => 'b2',
    'accountId'      => '',
    'applicationKey' => '',
    'bucketName'     => '',
],

Just use it as you normally would use the Storage facade.

\Storage::disk('b2')->put('test.txt', 'test')

and

\Storage::disk('b2')->get('test.txt')

Usage without Laravel

use RunCloudIO\FlysystemB2\BackblazeAdapter;
use League\Flysystem\Filesystem;
use ChrisWhite\B2\Client;

$client = new Client($accountId, $applicationKey);
$adapter = new BackblazeAdapter($client,$bucketName);

$filesystem = new Filesystem($adapter);

Change log

Please see CHANGELOG for more information what has changed recently.

Testing

$ composer test

Contributing

Please see CONTRIBUTING and CONDUCT for details.

Security

If you discover any security related issues, please email fikri@runcloud.io instead of using the issue tracker.

Credits

License

The MIT License (MIT). Please see License File for more information.