2017 © Pedro Peláez
 

library yii2amazons3

Amazon S3 Client wrapper as Yii2 component

image

sect0r/yii2amazons3

Amazon S3 Client wrapper as Yii2 component

  • Thursday, September 22, 2016
  • by Sect0R
  • Repository
  • 1 Watchers
  • 0 Stars
  • 3 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 1 Versions
  • 50 % Grown

The README.md

# yii2-amazons3

Amazon S3 Client wrapper as Yii2 component., (*1)

Usage, (*2)

return [
    // ...
    'components' => [
        'storage' => [
            'class' => '\Sect0R\yii2-amazons3\AmazonS3',
            'key' => 'AWS_ACCESS_KEY_ID',
            'secret' => 'AWS_SECRET_ACCESS_KEY',
            'bucket' => 'YOUR_BUCKET',
        ],
        // ...
    ],
];

You can then start using this component as:, (*3)

$storage = \Yii::$app->storage;

// Uploads the file into S3 in that bucket.
$url = $storage->uploadFile('/path/to/file', 'unique_file_name');

// Delete multiple objects from a bucket using a single HTTP request. You may specify up to 1000 keys.
$result = $storage->deleteObjects([131234,121421]);

// Removes the null version (if there is one) of an object and inserts a delete marker, which becomes the latest version of the object.
$result = $storage->deleteObject(131234);

// Returns some or all (up to 1000) of the objects in a bucket.
$objects = $storage->listObjects();

// Returns metadata about all of the versions of objects in a bucket.
$keys = $storage->listObjectVersions();

// Deletes objects from Amazon S3 that match the result of a ListObjects operation.
$result = $storage->deleteMatchingObjects('thumbnail-');

The Versions

22/09 2016

dev-master

9999999-dev https://github.com/sect0r/yii2amazons3

Amazon S3 Client wrapper as Yii2 component

  Sources   Download

MIT

The Requires

 

by Avatar Sect0R

yii2 s3 yii2-s3 yii2s3 yii2-amazon