zodimo / yii-aws-sdk
An AWS SDK Wrapper
Installs: 220
Dependents: 0
Suggesters: 0
Security: 0
Stars: 0
Watchers: 1
Forks: 0
Open Issues: 0
Type:yii-component
Requires
- php: >=5.5
- aws/aws-sdk-php: ~3
This package is auto-updated.
Last update: 2025-03-29 00:40:36 UTC
README
AWS SDK for PHP 3.x wrapper for yii 1.1
https://docs.aws.amazon.com/aws-sdk-php/v3/api/class-Aws.Sdk.html
install:
//todo
config :
Yii::setPathOfAlias('zodimo', dirname(__FILE__).'/../../../vendor/zodimo'); 'components'=>array( //.. 'awsSdk'=>array( 'class'=>'zodimo.yii-aws-sdk.AwsSdk', 'sharedConfig'=>array( 'region' => 'us-east-2', 'version' => 'latest', 'credentials' => array( 'key' => 'your-aws-key', 'secret' => 'your-aws-secret', ), ), 'serviceConfig'=>array( //Service specific config 'S3'=>array( 'region' => 'us-east-2', 'credentials' => array( 'key' => 'your-aws-key', 'secret' => 'your-aws-secret', ), ), ), ), //.. )
usage :
$s3Client =yii::app()->awsSdk->createS3(); //create bucket $s3Client->createBucket('BucketExists',['Bucket' => $bucket_name]); $s3Client->waitUntil( 'BucketExists', array( 'Bucket' => $bucket_name, '@waiter' => [ 'delay' => 3, 'maxAttempts' => 10 ] )); $response = $s3Client->listBuckets(); foreach ($response['Buckets'] as $bucket){ //Do stuff }