All Projects → cwhite92 → b2-sdk-php

cwhite92 / b2-sdk-php

Licence: MIT license
SDK for Backblaze's B2 storage service.

Programming Languages

PHP
23972 projects - #3 most used programming language

Projects that are alternatives of or similar to b2-sdk-php

backblaze
Backblaze.Agent is a high-performance .NET Core implementation of the Backblaze B2 Cloud Storage API.
Stars: ✭ 32 (-57.33%)
Mutual labels:  backblaze, backblaze-b2
butdr
Backup to Cloud( Google Drive, Dropbox ... ) use rclone
Stars: ✭ 49 (-34.67%)
Mutual labels:  backup, backblaze-b2
B2.NET
.NET library for Backblaze's B2 Cloud Storage
Stars: ✭ 63 (-16%)
Mutual labels:  backblaze, backblaze-b2
Bivac
🏕 📦 Backup Interface for Volumes Attached to Containers
Stars: ✭ 245 (+226.67%)
Mutual labels:  backup
Elkarbackup
Open source backup solution for your network
Stars: ✭ 247 (+229.33%)
Mutual labels:  backup
vbo365-rest-self-service
Unofficial Self-Service Web Portal for Veeam Backup for Microsoft Office 365
Stars: ✭ 24 (-68%)
Mutual labels:  backup
Photos
[DEPRECATED] Encrypted, secure, decentralized personal data wallet -- technology behind textile.photos
Stars: ✭ 236 (+214.67%)
Mutual labels:  backup
IAmLazy
Easily backup and restore your tweaks
Stars: ✭ 37 (-50.67%)
Mutual labels:  backup
sicksync
Don’t accept the available as the preferable. Go the extra mile with extra speed.
Stars: ✭ 67 (-10.67%)
Mutual labels:  backup
virt-backup
Fully backup your KVM Virtual Machines
Stars: ✭ 27 (-64%)
Mutual labels:  backup
VestaCP-Sync-Backups-To-Mega
VestaCP: uploading backups to the MEGA cloud
Stars: ✭ 17 (-77.33%)
Mutual labels:  backup
OBS Settings Manager
Backup your OBS Studio profiles and manage them in an easy, user friendly way.
Stars: ✭ 20 (-73.33%)
Mutual labels:  backup
mysql-backup-golang
Mysql backup golang
Stars: ✭ 25 (-66.67%)
Mutual labels:  backup
planb
PlanB - automating remote backups and snapshots with zfs/rsync
Stars: ✭ 24 (-68%)
Mutual labels:  backup
Go Mydumper
A multi-threaded MySQL backup and restore tool, faster than mysqldump
Stars: ✭ 250 (+233.33%)
Mutual labels:  backup
proxmox toolbox
A toolbox to get the firsts configurations of Proxmox VE / BS done in no time
Stars: ✭ 158 (+110.67%)
Mutual labels:  backup
Docker Gphotos Sync
A Docker image for synchronizing your original-quality Google Photos
Stars: ✭ 241 (+221.33%)
Mutual labels:  backup
myaas
Fresh Mysql instances for your developers in seconds
Stars: ✭ 26 (-65.33%)
Mutual labels:  backup
trello-full-backup
Python script to backup everything from Trello: boards, lists, cards and attachments
Stars: ✭ 119 (+58.67%)
Mutual labels:  backup
open2fa
Two-factor authentication app with import/export for iOS and macOS. All codes encrypted with AES 256. FaceID & TouchID support included. Written with love in SwiftUI ❤️
Stars: ✭ 24 (-68%)
Mutual labels:  backup

Backblaze B2 SDK for PHP

Software License Latest Version SensioLabs Rating Build Status

b2-sdk-php is a client library for working with Backblaze's B2 storage service. It aims to make using the service as easy as possible by exposing a clear API and taking influence from other SDKs that you may be familiar with.

Example

This is just a short example, full examples to come on the wiki.

use ChrisWhite\B2\Client;
use ChrisWhite\B2\Bucket;

$client = new Client('accountId', 'applicationKey');

// Returns a Bucket object.
$bucket = $client->createBucket([
    'BucketName' => 'my-special-bucket',
    'BucketType' => Bucket::TYPE_PRIVATE // or TYPE_PUBLIC
]);

// Change the bucket to private. Also returns a Bucket object.
$updatedBucket = $client->updateBucket([
    'BucketId' => $bucket->getId(),
    'BucketType' => Bucket::TYPE_PUBLIC
]);

// Retrieve an array of Bucket objects on your account.
$buckets = $client->listBuckets();

// Delete a bucket.
$client->deleteBucket([
    'BucketId' => '4c2b957661da9c825f465e1b'
]);

// Upload a file to a bucket. Returns a File object.
$file = $client->upload([
    'BucketName' => 'my-special-bucket',
    'FileName' => 'path/to/upload/to',
    'Body' => 'I am the file content'

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

// Download a file from a bucket. Returns the file content.
$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'
]);

// Delete a file from a bucket. Returns true or false.
$fileDelete = $client->deleteFile([
    'FileId' => $file->getId()
    
    // Can also identify the file via bucket and path:
    // 'BucketName' => 'my-special-bucket',
    // 'FileName' => 'path/to/file'
]);

// Retrieve an array of file objects from a bucket.
$fileList = $client->listFiles([
    'BucketId' => '4d2dbbe08e1e983c5e6f0d12'
]);

Installation

Installation is via Composer:

$ composer require cwhite92/b2-sdk-php

Tests

Tests are run with PHPUnit. After installing PHPUnit via Composer:

$ vendor/bin/phpunit

Contributors

Feel free to contribute in any way you can whether that be reporting issues, making suggestions or sending PRs. :)

License

MIT.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].