2017 © Pedro Peláez
 

yii2-extension yii2-cloudstorage

Common interface for amazon s3 and rackspace cloud files

image

bigdropinc/yii2-cloudstorage

Common interface for amazon s3 and rackspace cloud files

  • Friday, May 13, 2016
  • by bigdropinc
  • Repository
  • 1 Watchers
  • 2 Stars
  • 6 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 1 Versions
  • 0 % Grown

The README.md

Yii2 Cloud Storage

Common interface for amazon s3 and rackspace cloud files., (*1)

Configuration

Amazon S3

Once the extension is installed, simply modify your application configuration as follows:, (*2)

return [
    //...
    'components' => [
        //...
        'cloudStorage' => [
            'class' => 'bigdropinc\cloudStorage\AmazonS3',
            'key' => '***',
            'secret' => '***',
            'bucket' => 'bucket name',
            //fill this attribute, if you know the base url of your bucket
            'cloudStorageBaseUrl' => 'http://site.s3.amazon.com/'
        ],
    ],
];

Rackspace Cloud Files

Once the extension is installed, simply modify your application configuration as follows:, (*3)

return [
    //...
    'components' => [
        //...
        'cloudStorage' => [
            'class' => 'bigdropinc\cloudStorage\RackspaceCloudFiles',
            'username' => '***',
            'apiKey' => '***',
            'region' => 'LON',
            'containerName' => 'container name',
            //fill this attribute, if you know the base url of your container
            'cloudStorageBaseUrl' => 'http://site.rackspace.com/'
        ],
    ],
];

Usage

Uploading Files

$file = '@frontend/web/media/image.png';
Yii::$app->cloudStorage->upload($file);

Downloading Files

$name = 'media/image.png';
$dir = '@frontend/web/tmp';
Yii::$app->cloudStorage->download($name, $dir);

Deleting Files

$name = 'media/image.png';
Yii::$app->cloudStorage->delete($name);

Getting Public Url

$name = 'media/image.png';
Yii::$app->cloudStorage->getPublicUrl($name);

The Versions

13/05 2016

dev-master

9999999-dev http://www.yiiframework.com/

Common interface for amazon s3 and rackspace cloud files

  Sources   Download

BSD-3-Clause

The Requires

 

The Development Requires

by Buba Suma

yii2 cloud amazon s3 storage remote rackspace