marcandreappel/flysystem-backblaze

Backblaze adapter for the flysystem filesystem abstraction library

1.7.3 2021-06-09 07:36 UTC

This package is auto-updated.

Last update: 2021-09-09 08:09:28 UTC


README

Author Latest Version on Packagist Software License Total Downloads

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

The Backblaze adapter makes it possible 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 marcandreappel/flysystem-backblaze

Usage

use MarcAndreAppel\FlysystemBackblaze\BackblazeAdapter;
use League\Flysystem\Filesystem;
use BackblazeB2\Client;

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

$filesystem = new Filesystem($adapter);

Using ApplicationKey instead of MasterKey

If you specify only the $bucketName when creating the BackblazeAdapter, your $applicationKey must be the master key. However, if you specify both bucket name and bucket id, you can use an application key. Fetch your $bucketId using the b2 command line tool b2 get-bucket <bucketName>

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

Documentation

Here is the complete guide of all available options.

Security

If you discover any security related issues, please open a ticket on the issue tracker.

Credits

License

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