PHPackages                             tmzkj-yii2-shop/yii2-shop-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. tmzkj-yii2-shop/yii2-shop-storage

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

tmzkj-yii2-shop/yii2-shop-storage
=================================

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

01PHP

Since Dec 1Pushed 2y ago1 watchersCompare

[ Source](https://github.com/haozhili520/yii2-shop-storage)[ Packagist](https://packagist.org/packages/tmzkj-yii2-shop/yii2-shop-storage)[ RSS](/packages/tmzkj-yii2-shop-yii2-shop-storage/feed)WikiDiscussions master Synced 1mo ago

READMEChangelogDependenciesVersions (1)Used By (0)

Tmzkj Storage
=============

[](#tmzkj-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' => 'Tmzkj\Storage\Components\StorageComponent',
        'basePath' => 'temp/',
        'driver' => [
            'class' => 'Tmzkj\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('Tmzkj\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 `Tmzkj\Storage\Exceptions\StorageException`. Don't forget to `try... catch ...`.

About
-----

[](#about)

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

###  Health Score

12

—

LowBetter than 0% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity1

Limited adoption so far

Community4

Small or concentrated contributor base

Maturity20

Early-stage or recently created project

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/62e400b0f84e8802f2a07938ccc654c2d28621073137501bac48ff0f877918f6?d=identicon)[haozhili520](/maintainers/haozhili520)

### Embed Badge

![Health badge](/badges/tmzkj-yii2-shop-yii2-shop-storage/health.svg)

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

###  Alternatives

[knplabs/gaufrette

PHP library that provides a filesystem abstraction layer

2.5k39.8M123](/packages/knplabs-gaufrette)[google/cloud-storage

Cloud Storage Client for PHP

34390.8M125](/packages/google-cloud-storage)[illuminate/filesystem

The Illuminate Filesystem package.

15261.6M2.6k](/packages/illuminate-filesystem)[superbalist/flysystem-google-storage

Flysystem adapter for Google Cloud Storage

26320.6M30](/packages/superbalist-flysystem-google-storage)[creocoder/yii2-flysystem

The flysystem extension for the Yii framework

2931.7M62](/packages/creocoder-yii2-flysystem)[flowjs/flow-php-server

PHP library for handling chunk uploads. Works with flow.js html5 file uploads.

2451.6M15](/packages/flowjs-flow-php-server)

PHPackages © 2026

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