PHPackages                             eposgit/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. [File &amp; Storage](/categories/file-storage)
4. /
5. eposgit/yii2-hejiang-storage

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

eposgit/yii2-hejiang-storage
============================

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

v1.0(5y ago)06PHPPHP &gt;=5.4.0

Since Jan 25Pushed 5y ago1 watchersCompare

[ Source](https://github.com/eposgit/yii2-hejiang-storage)[ Packagist](https://packagist.org/packages/eposgit/yii2-hejiang-storage)[ RSS](/packages/eposgit-yii2-hejiang-storage/feed)WikiDiscussions main Synced 3d ago

READMEChangelog (1)Dependencies (4)Versions (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

22

—

LowBetter than 22% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity4

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity48

Maturing project, gaining track record

 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

1936d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/976704a97b54f8fd5e961f3169a735427d1351528c0280c2a10f71e0061cb0e8?d=identicon)[xiaoshuhe](/maintainers/xiaoshuhe)

---

Top Contributors

[![eposgit](https://avatars.githubusercontent.com/u/37104983?v=4)](https://github.com/eposgit "eposgit (1 commits)")

### Embed Badge

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

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

PHPackages © 2026

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