PHPackages                             hxy2015/yii2-oss - 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. [Utility &amp; Helpers](/categories/utility)
4. /
5. hxy2015/yii2-oss

ActiveYii2-extension[Utility &amp; Helpers](/categories/utility)

hxy2015/yii2-oss
================

Oss integration for the Yii framework

1.0.0(8y ago)05BSD-3-ClausePHP

Since Sep 4Pushed 8y ago1 watchersCompare

[ Source](https://github.com/hxy2015/yii2-oss)[ Packagist](https://packagist.org/packages/hxy2015/yii2-oss)[ RSS](/packages/hxy2015-yii2-oss/feed)WikiDiscussions master Synced yesterday

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

An Oss client of yii2 extension.
================================

[](#an-oss-client-of-yii2-extension)

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

[](#installation)

The preferred way to install this extension is through [composer](http://getcomposer.org/download/).

Either run

```
php composer.phar require --prefer-dist hxy2015/yii2-oss

```

or add

```
"hxy2015/yii2-oss": "~1.0"
```

to the require section of your composer.json.

Configuration
-------------

[](#configuration)

To use this extension, you have to configure the Connection class in your application configuration:

```
return [
    //....
    'components' => [
        'oss' => [
            'hostname' => 'localhost',
            'bucket' => 'risk-test',
            'accessId' => 'test', // oss id
            'accessKey' => 'test', // oss id
        ],
    ]
];
```

Usage
-----

[](#usage)

Upload File

```
$oss = \Yii::$app->get('oss');
$oss->putObjectByContent('some_dir/some_file_name', 'hehe');

$filename = 'test.txt';
file_put_contents($filename, 'hehe');
$oss->putObjectByFile('some_dir/some_file_name', $filename);
```

Download File

```
$oss = \Yii::$app->get('oss');
$oss->getObjectContent('some_dir/some_file_name');

$filename = 'test.txt';
$oss->getObjectFile('some_dir/some_file_name', $filename);
```

Test File Exist

```
$oss = \Yii::$app->get('oss');
$oss->isObjectExist('some_dir/some_file_name');
```

###  Health Score

26

—

LowBetter than 43% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity4

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity63

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

Unknown

Total

1

Last Release

3172d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/e3304ac49cb0de02a88a041ef014f7c65d272bdb6b14b1fa4fe9192aceffea4e?d=identicon)[hxy2015](/maintainers/hxy2015)

---

Top Contributors

[![hxy2015](https://avatars.githubusercontent.com/u/11882138?v=4)](https://github.com/hxy2015 "hxy2015 (8 commits)")

---

Tags

yii2oss

### Embed Badge

![Health badge](/badges/hxy2015-yii2-oss/health.svg)

```
[![Health](https://phpackages.com/badges/hxy2015-yii2-oss/health.svg)](https://phpackages.com/packages/hxy2015-yii2-oss)
```

###  Alternatives

[dmstr/yii2-cookie-consent

Yii2 Cookie Consent Widget

1452.6k](/packages/dmstr-yii2-cookie-consent)

PHPackages © 2026

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