Download the PHP package steppinghat/backblaze-b2-bundle without Composer

On this page you can find all versions of the php package steppinghat/backblaze-b2-bundle. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package backblaze-b2-bundle

Backblaze B2 API for Symfony

Latest Stable Version Total Downloads License PHP Version Require

📼 Backblaze B2 API client services for Symfony projects

Installation

To install this bundle, run the following in your Symfony project directory:

Then register the bundle in config/bundles.php

And lastly, create a config file in config/packages called backblaze_b2.yaml

Configuration

Backblaze API keys

Before setting off, you'll need to create a key by going to App Keys in your Backblaze Account.

Not all keys are created equal!

You can use an application key, however the capabilities are very limited in comparison to the master application key. Please bare this in mind when configuring the bundle.

Caching Tokens

In order to both reduce the number of API calls made, and speed up the overall turnaround time, we can optionally cache tokens to disk. This means that instead of requesting the authentication token needed to carry out requests every time, we use one from an earlier call that we've cached. These tokens last ~12 hours before they expire and a new one is needed.

While is can be preferable, some might not like the idea of keeping a token saved to disk for security reasons. If your system is well secured and this isn't as much of a risk, turn this on by setting tokenCacheDirectory to a valid directory in that we have permissions to write to.

This cache is not cleared by running php bin/console cache:clear

Usage

For all basic usage of the API, simply use the BackblazeClient class in your service.

Create a bucket

Requires the writeBuckets capability

List all buckets

Requires the listBuckets capability

Update a bucket

Requires the writeBuckets capability

Delete a bucket

Requires the deleteBuckets capability

List all files

Requires the listFiles capability

Check if a file exists

Requires the listFiles capability

Get file info

Requires the readFiles capability

Delete a file

Requires the deleteFiles capability

If a file has governance restrictions, access keys with the bypassGovernance capability can force delete files.

Upload a file

Requires the writeFiles capability

Files can be uploaded by either passing a string content

or files can be passed in as a resource

⚠ Resource content is loaded into memory before being sent. This is due to a limitation where the Symfony HttpClient library sends headers after the content, and the Backblaze API expects it before. As a result, we can't directly pass the resource directly to Backblaze. This is currently a //TODO to find a workaround for. If you intend to upload large files, this may be an issue.

Download a file

Requires the readFiles capability

Downloaded content is simply returned into a variable

but can also be passed directly into a resource

Testing

In terms of tests, there are no tests. (Boooo).

This library is still a work in progress as I don't yet fully support the B2 API, nor have I ironed out 100% of the kinks (see uploading a resource for example).

Most of the functionality works (I use it in my own app), I guess you can call that some sort of guarantee?

But don't worry, once I've built out the library some more there will be tests - I promise!

License

Made with :heart: by Javan Eskander

Available for use under the MIT license.


All versions of backblaze-b2-bundle with dependencies

PHP Build Version
Package Version
Requires php Version >=7.4
symfony/http-client Version ^5.4
symfony/config Version ^5.4
symfony/dependency-injection Version ^5.4
symfony/framework-bundle Version ^5.4
symfony/cache Version ^5.4
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package steppinghat/backblaze-b2-bundle contains the following files

Loading the files please wait ....