dev-master
9999999-dev http://www.yiiframework.com/Common interface for amazon s3 and rackspace cloud files
BSD-3-Clause
The Requires
The Development Requires
by Buba Suma
yii2 cloud amazon s3 storage remote rackspace
Common interface for amazon s3 and rackspace cloud files
Common interface for amazon s3 and rackspace cloud files., (*1)
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/' ], ], ];
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/' ], ], ];
$file = '@frontend/web/media/image.png'; Yii::$app->cloudStorage->upload($file);
$name = 'media/image.png'; $dir = '@frontend/web/tmp'; Yii::$app->cloudStorage->download($name, $dir);
$name = 'media/image.png'; Yii::$app->cloudStorage->delete($name);
$name = 'media/image.png'; Yii::$app->cloudStorage->getPublicUrl($name);
Common interface for amazon s3 and rackspace cloud files
BSD-3-Clause
yii2 cloud amazon s3 storage remote rackspace