dev-master
9999999-devYii2 component for Amazon Web Service
The Requires
by Mike Grigorieff
extension php yii2 aws
dev-develop
dev-developYii2 component for Amazon Web Service
The Requires
by Mike Grigorieff
extension php yii2 aws
Yii2 component for Amazon Web Service
The preferred way to install this extension is through composer., (*1)
Either run, (*2)
php composer.phar require --prefer-dist grigorieff/yii2-aws "master-dev"
or add, (*3)
"grigorieff/yii2-aws": "*"
to the require section of your composer.json., (*4)
Add to your app config:, (*5)
'components' => [ ......... 'aws' => [ 'class' => grigorieff\aws\AWSComponent, 'key' => '......', 'secret' => '......', 'region' => '......' ], ......... ];
$aws = Yii::$app->aws; // AWS S3 $s3 = $aws->get('s3'); try { $s3->putObject(array( 'Bucket' => 'my-bucket', 'Key' => 'my-object', 'Body' => fopen('/path/to/file', 'r'), 'ACL' => 'public-read', )); } catch (S3Exception $e) { echo "There was an error uploading the file.\n"; } ...... try { $resource = fopen('/path/to/file', 'r'); $s3->upload('my-bucket', 'my-object', $resource, 'public-read'); } catch (S3Exception $e) { echo "There was an error uploading the file.\n"; } ...... $s3->getObject(array( 'Bucket' => $bucket, 'Key' => 'data.txt', 'SaveAs' => '/tmp/data.txt' )); echo $result['Body']->getUri() . "\n";
Yii2 component for Amazon Web Service
extension php yii2 aws
Yii2 component for Amazon Web Service
extension php yii2 aws