2017 © Pedro Peláez
 

library backblaze-b2

PHP SDK for working with backblaze B2 cloud storage.

image

gliterd/backblaze-b2

PHP SDK for working with backblaze B2 cloud storage.

  • Tuesday, July 3, 2018
  • by mhetreramesh
  • Repository
  • 1 Watchers
  • 8 Stars
  • 2,845 Installations
  • PHP
  • 1 Dependents
  • 0 Suggesters
  • 3 Forks
  • 0 Open issues
  • 9 Versions
  • 63 % Grown

The README.md

Backblaze B2 for PHP

Author Latest Version on Packagist ![Software License][ico-license] Build Status ![Coverage Status][ico-scrutinizer] Quality Score Total Downloads, (*1)

backblaze-b2 is the SDK for working with Backblaze's B2 storage service., (*2)

Install

Via Composer, (*3)

``` bash $ composer require gliterd/backblaze-b2, (*4)


## Usage ``` php use BackblazeB2\Client; use BackblazeB2\Bucket; $options = ['auth_timeout_seconds' => seconds]; $client = new Client('accountId', 'applicationKey', $options);

$options is optional. If omitted, the default timeout is 12 hours. The timeout allows for a long lived Client object so that the authorization token does not expire., (*5)

ApplicationKey is not supported yet, please use MasterKey only

Returns a bucket details

``` php $bucket = $client->createBucket([ 'BucketName' => 'my-special-bucket', 'BucketType' => Bucket::TYPE_PRIVATE // or TYPE_PUBLIC ]);, (*6)


#### Change the bucket Type ``` php $updatedBucket = $client->updateBucket([ 'BucketId' => $bucket->getId(), 'BucketType' => Bucket::TYPE_PUBLIC ]);

List all buckets

``` php $buckets = $client->listBuckets();, (*7)

#### Delete a bucket
``` php
$client->deleteBucket([
    'BucketId' => 'YOUR_BUCKET_ID'
]);

File Upload

``` php $file = $client->upload([ 'BucketName' => 'my-special-bucket', 'FileName' => 'path/to/upload/to', 'Body' => 'I am the file content', (*8)

// The file content can also be provided via a resource.
// 'Body' => fopen('/path/to/input', 'r')

]);, (*9)


#### File Download ``` php $fileContent = $client->download([ 'FileId' => $file->getId() // Can also identify the file via bucket and path: // 'BucketName' => 'my-special-bucket', // 'FileName' => 'path/to/file' // Can also save directly to a location on disk. This will cause download() to not return file content. // 'SaveAs' => '/path/to/save/location' ]);

File Copy

``` php $copyOfFile = $client->copy([ 'BucketName' => $bucketName, 'FileName' => $path, 'SaveAs' => $newPath,, (*10)

// Can also supply BucketId instead of BucketName
// Optional are DestinationBucketName or DestinationBucketId

]);, (*11)


#### File Delete ``` php $fileDelete = $client->deleteFile([ 'FileId' => $file->getId() // Can also identify the file via bucket and path: // 'BucketName' => 'my-special-bucket', // 'FileName' => 'path/to/file' ]);

List all files

``` php $fileList = $client->listFiles([ 'BucketId' => 'YOUR_BUCKET_ID' ]);, (*12)



## Change log Please see [CHANGELOG](CHANGELOG.md) for more information what has changed recently. ## Testing ```bash $ vendor/bin/phpunit

Contributing

Please see CONTRIBUTING and CONDUCT for details., (*13)

Security

If you discover any security related issues, please email mhetreramesh@gmail.com instead of using the issue tracker., (*14)

Credits

License

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

The Versions

03/07 2018

dev-develop

dev-develop https://github.com/gliterd/b2-sdk-php

PHP SDK for working with backblaze B2 cloud storage.

  Sources   Download

MIT

The Requires

 

The Development Requires

filesystem cloud storage backup b2 backblaze cloud-storage

03/07 2018

1.0.4

1.0.4.0 https://github.com/gliterd/b2-sdk-php

PHP SDK for working with backblaze B2 cloud storage.

  Sources   Download

MIT

The Requires

 

The Development Requires

filesystem cloud storage backup b2 backblaze cloud-storage

03/07 2018

dev-analysis-qoj29N

dev-analysis-qoj29N https://github.com/gliterd/b2-sdk-php

PHP SDK for working with backblaze B2 cloud storage.

  Sources   Download

MIT

The Requires

 

The Development Requires

filesystem cloud storage backup b2 backblaze cloud-storage

02/07 2018

1.0.1

1.0.1.0 https://github.com/gliterd/b2-sdk-php

PHP SDK for working with backblaze B2 cloud storage.

  Sources   Download

MIT

The Requires

 

The Development Requires

filesystem cloud storage backup b2 backblaze cloud-storage

02/07 2018

dev-master

9999999-dev https://github.com/gliterd/b2-sdk-php

PHP SDK for working with backblaze B2 cloud storage.

  Sources   Download

MIT

The Requires

 

The Development Requires

filesystem cloud storage backup b2 backblaze cloud-storage

02/07 2018

1.0.0

1.0.0.0 https://github.com/gliterd/b2-sdk-php

PHP SDK for working with backblaze B2 cloud storage.

  Sources   Download

MIT

The Requires

 

The Development Requires

filesystem cloud storage backup b2 backblaze cloud-storage

09/08 2017

0.0.3

0.0.3.0 https://github.com/gliterd/b2-sdk-php

PHP SDK for working with backblaze B2 cloud storage.

  Sources   Download

MIT

The Requires

 

The Development Requires

filesystem cloud storage backup b2 backblaze cloud-storage

09/08 2017

0.0.2

0.0.2.0 https://github.com/gliterd/b2-sdk-php

PHP SDK for working with backblaze B2 cloud storage.

  Sources   Download

MIT

The Requires

 

The Development Requires

filesystem cloud storage backup b2 backblaze cloud-storage

09/08 2017

0.0.1

0.0.1.0 https://github.com/gliterd/b2-sdk-php

PHP SDK for working with backblaze B2 cloud storage.

  Sources   Download

MIT

The Requires

 

The Development Requires

filesystem cloud storage backup b2 backblaze cloud-storage