Download the PHP package kamilz/b2backblaze-bundle without Composer
On this page you can find all versions of the php package kamilz/b2backblaze-bundle. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download kamilz/b2backblaze-bundle
More information about kamilz/b2backblaze-bundle
Files in kamilz/b2backblaze-bundle
Package b2backblaze-bundle
Short Description Symfony bundle for B2 Cloud Storage
License MIT
Homepage https://github.com/kamilZ
Informations about the package b2backblaze-bundle
B2BackblazeBundle
This bundle is a Symfony2 wrapper for b2backblaze library
About B2 Cloud Storage
B2 Cloud Storage is a cloud service for storing files in the cloud. Files are available for download at any time, either through the API or through a browser-compatible URL.
The documentation for B2 Cloud storage can be found at https://www.backblaze.com/b2/docs/.
Installation
The recommended way to install this bundle is through Composer.
Install Composer
curl -sS https://getcomposer.org/installer | php
Add B2BackblazeBundle as a dependency
php composer.phar require "kamilz/b2backblaze-bundle":"dev-master"
Enable the bundle in the kernel
<?php
// app/AppKernel.php
public function registerBundles()
{
$bundles = array(
// ...
new KamilZ\B2BackblazeBundle\B2BackblazeBundle(),
// ...
);
}
Add required configuration
##config.yml
b2_backblaze:
account_id: YOUR_ID
account_key: YOUR_ACCCOUNT_SECRET_KEY
bucket_id: YOUR_BUCKET_ID
bucket_region: 'https://fxxx.backblaze.com/file/YOUR_BUCKET_NAME/'
timeout: 2000
Usage
Upload File:
<?php
(...)
$b2 = $this->get("backblaze.b2");
$b2->uploadFile("...test.png","test.png");
//or
$b2->uploadFileByContent($file,"test.png");
(...)
Twig image filter:
{# twig template #}
(..)
<img src="{{ app.user.avatar|b2 }}" alt="">
(..)
License
This bundle is under the MIT license. See the complete license in the bundle:
Resources/meta/LICENSEAll versions of b2backblaze-bundle with dependencies
kamilz/b2backblaze Version >= 0.1.3
symfony/framework-bundle Version >= 2.0