PHPackages                             simonxiaoma/yii2-hejiang-storage - 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. simonxiaoma/yii2-hejiang-storage

ActiveLibrary

simonxiaoma/yii2-hejiang-storage
================================

A file uploading extension for Yii2, saving files to object storage service.

031[1 PRs](https://github.com/Brother-Simon/yii2-hejiang-storage/pulls)PHP

Since Jul 18Pushed 2y agoCompare

[ Source](https://github.com/Brother-Simon/yii2-hejiang-storage)[ Packagist](https://packagist.org/packages/simonxiaoma/yii2-hejiang-storage)[ RSS](/packages/simonxiaoma-yii2-hejiang-storage/feed)WikiDiscussions master Synced 2mo ago

READMEChangelogDependenciesVersions (2)Used By (0)

Hejiang Storage
===============

[](#hejiang-storage)

Thanks for your attention. This package is only used for my company projects, please do NOT use it in your product environment.

Usage
-----

[](#usage)

1. Firstly, add this lines of code to your Yii application config:

    ```
    'components' => [
        'class' => 'Hejiang\Storage\Components\StorageComponent',
        'basePath' => 'temp/',
        'driver' => [
            'class' => 'Hejiang\Storage\Drivers\Local',
            'accessKey' => '',
            'secretKey' => '',
            'bucket' => '',
        ]
    ]
    ```
2. Then after app bootstarpping, you would get the storage component instance like that:

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

    Alternatively, you can also create a driver while app running:

    ```
    $storage->setDriver('Hejiang\Storage\Drivers\Local', []);
    ```
3. Fetch uploaded file by field name:

    ```
    $file = $storage->getUploadedFile('FILE-FIELD-NAME');
    ```
4. Save it.

    ```
    $url = $file->saveAs('NEW-FILE-NAME.EXT');
    // or
    $url = $file->saveWithOriginalExtension('NEW-FILE-BASE-NAME');
    // or
    $url = $file->saveAsUniqueHash();
    ```

    `$url` will be a URL string which can access this file on success, or `false` on failure.

    If there's any error occurred, these methods will throw a `Hejiang\Storage\Exceptions\StorageException`. Don't forget to `try... catch ...`.

About
-----

[](#about)

Working at: [Zhejiang Hejiang Technology Co., Ltd.](http://www.zjhejiang.com/)

###  Health Score

19

—

LowBetter than 10% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity4

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity38

Early-stage or recently created project

 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.

### Community

Maintainers

![](https://www.gravatar.com/avatar/18beec2e3d651bf2beadb2c15f15910f7a013be90c05801a1c13f69bae7d7cf5?d=identicon)[Brother-Simon](/maintainers/Brother-Simon)

---

Top Contributors

[![d1webtop](https://avatars.githubusercontent.com/u/16299633?v=4)](https://github.com/d1webtop "d1webtop (2 commits)")

### Embed Badge

![Health badge](/badges/simonxiaoma-yii2-hejiang-storage/health.svg)

```
[![Health](https://phpackages.com/badges/simonxiaoma-yii2-hejiang-storage/health.svg)](https://phpackages.com/packages/simonxiaoma-yii2-hejiang-storage)
```

PHPackages © 2026

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