PHPackages                             ctala/yii2-aws-s3 - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [File &amp; Storage](/categories/file-storage)
4. /
5. ctala/yii2-aws-s3

ActiveYii2-extension[File &amp; Storage](/categories/file-storage)

ctala/yii2-aws-s3
=================

Contenedor de las clases de S3 para Yii2

V0.6(10y ago)12.7k↑275%MITPHPPHP &gt;=5.5.0

Since Apr 30Pushed 10y agoCompare

[ Source](https://github.com/ctala/yii2-aws-s3)[ Packagist](https://packagist.org/packages/ctala/yii2-aws-s3)[ Docs](https://github.com/ctala/yii2-aws-s3)[ RSS](/packages/ctala-yii2-aws-s3/feed)WikiDiscussions master Synced 1mo ago

READMEChangelogDependencies (2)Versions (16)Used By (0)

Yii2 AWS S3
===========

[](#yii2-aws-s3)

An Amazon S3Client wrapper as Yii2 component.

Yii2 AWS S3 can only work with **one** bucket per a component configuration.

The component currently supports CloudFront (getting a CDN url for an object in a S3 bucket).

Installation
------------

[](#installation)

1. Run the [Composer](http://getcomposer.org/download/) command to install the latest stable version:

    ```
    composer require ctala/yii2-aws-s3

    ```
2. Add component to `config/main.php`

    ```
    'components' => [
        // ...
        's3bucket' => [
            'class' => \CTala\Storage::className(),
            'region' => 'your region',
            'credentials' => [ // Aws\Credentials\CredentialsInterface|array|callable
                'key' => 'your aws s3 key',
                'secret' => 'your aws s3 secret',
            ],
            'bucket' => 'your aws s3 bucket',
            'cdnHostname' => 'http://example.cloudfront.net',
            'defaultAcl' => \CTala\Storage::ACL_PUBLIC_READ,
            'debug' => true, // bool|array
        ],
        // ...
    ],
    ```

Usage
-----

[](#usage)

### Uploading objects

[](#uploading-objects)

```
// creating an object
$data = ['one', 'two', 'three'];
Yii::$app->get('s3bucket')->put('path/to/s3object.ext', Json::encode($data));

// uploading an object by streaming the contents of a stream
$resource = fopen('/path/to/local/file.ext', 'r+');
Yii::$app->get('s3bucket')->put('path/to/s3object.ext', $resource);
```

### Uploading files

[](#uploading-files)

```
Yii::$app->get('s3bucket')->upload('path/to/s3object.ext', '/path/to/local/file.ext');
```

### Uploading large files using multipart uploads with custom options

[](#uploading-large-files-using-multipart-uploads-with-custom-options)

```
$concurrency = 5;
$minPartSize = 536870912; // 512 MB

Yii::$app->get('s3bucket')->multipartUpload(
    'path/to/s3object.ext',
    '/path/to/local/file.ext',
    $concurrency,
    $minPartSize
);
```

### Reading objects

[](#reading-objects)

```
/** @var \Aws\Result $result */
$result = Yii::$app->get('s3bucket')->get('path/to/s3object.ext');
$data = $result['Body'];
```

### Saving objects to a file

[](#saving-objects-to-a-file)

```
Yii::$app->get('s3bucket')->get('path/to/s3object.ext', '/path/to/local/file.ext');
```

### Deleting objects

[](#deleting-objects)

```
Yii::$app->get('s3bucket')->delete('path/to/s3object.ext');
```

### Getting a plain URL

[](#getting-a-plain-url)

```
$url = Yii::$app->get('s3bucket')->getUrl('path/to/s3object.ext');
```

### Creating a pre-signed URL

[](#creating-a-pre-signed-url)

```
$url = Yii::$app->get('s3bucket')->getPresignedUrl('path/to/s3object.ext', '+10 minutes');
```

### Getting a CDN URL

[](#getting-a-cdn-url)

```
$url = Yii::$app->get('s3bucket')->getCdnUrl('path/to/s3object.ext');
```

### Listing objects

[](#listing-objects)

```
$result = Yii::$app->get('s3bucket')->getList('path/');
foreach ($result['Contents'] as $object) {
    echo $object['Key'] . PHP_EOL;
}
```

\##ChangeLog

- 0.6 : Added Create Folder, Added Iterator for All files.

###  Health Score

32

—

LowBetter than 72% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity21

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity66

Established project with proven stability

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~13 days

Recently: every ~0 days

Total

15

Last Release

3850d ago

PHP version history (2 changes)v0.1.0PHP &gt;=5.4.0

v0.3.0PHP &gt;=5.5.0

### Community

Maintainers

![](https://www.gravatar.com/avatar/1e7c95137d30493785bcbd323b2d35b3913da2aa3935aa6827ee7f9aa698f2d6?d=identicon)[ctala](/maintainers/ctala)

---

Top Contributors

[![frostealth](https://avatars.githubusercontent.com/u/1785217?v=4)](https://github.com/frostealth "frostealth (14 commits)")

---

Tags

s3yii2aws-s3

### Embed Badge

![Health badge](/badges/ctala-yii2-aws-s3/health.svg)

```
[![Health](https://phpackages.com/badges/ctala-yii2-aws-s3/health.svg)](https://phpackages.com/packages/ctala-yii2-aws-s3)
```

###  Alternatives

[frostealth/yii2-aws-s3

An Amazon S3 component for Yii2

90698.9k5](/packages/frostealth-yii2-aws-s3)[fedemotta/yii2-aws-sdk

This extension provides the AWS SDK integration for the Yii2 framework

15430.4k2](/packages/fedemotta-yii2-aws-sdk)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
