2017 © Pedro Peláez
 

library yii2-aws

Yii2 component for Amazon Web Service

image

grigorieff/yii2-aws

Yii2 component for Amazon Web Service

  • Sunday, December 21, 2014
  • by grigorieff
  • Repository
  • 1 Watchers
  • 0 Stars
  • 297 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 1 Forks
  • 1 Open issues
  • 2 Versions
  • 2 % Grown

The README.md

Yii2 component for AWS

Installation

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)

Configuration

Add to your app config:, (*5)

    'components' => [

        .........

        'aws' => [
            'class' => grigorieff\aws\AWSComponent,
            'key' => '......',
            'secret' => '......',
            'region' => '......'
        ],

        .........

    ];

Usage

$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";

The Versions

21/12 2014

dev-master

9999999-dev

Yii2 component for Amazon Web Service

  Sources   Download

The Requires

 

by Mike Grigorieff

extension php yii2 aws

21/12 2014

dev-develop

dev-develop

Yii2 component for Amazon Web Service

  Sources   Download

The Requires

 

by Mike Grigorieff

extension php yii2 aws