PHPackages                             adamyxt/helper - 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. adamyxt/helper

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

adamyxt/helper
==============

Various custom plug-ins used by the project

041PHP

Since May 7Pushed 7y ago1 watchersCompare

[ Source](https://github.com/adamyxt/helper)[ Packagist](https://packagist.org/packages/adamyxt/helper)[ RSS](/packages/adamyxt-helper/feed)WikiDiscussions master Synced 3d ago

READMEChangelogDependenciesVersions (1)Used By (0)

Various custom plug-ins used by the project
===========================================

[](#various-custom-plug-ins-used-by-the-project)

Various custom plug-ins used by the project

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

[](#installation)

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

Either run

```
php composer.phar require --prefer-dist adamyxt/helper "*"

```

or add

```
"adamyxt/helper": "*"

```

to the require section of your `composer.json` file.

Usage
-----

[](#usage)

根据传输数据生成签名方式传递数据帮助类使用方法(API传输数据加密方式) :

```
    1配置组件
    'components' => [
        'encrypt' => [
            'class' => 'common\components\crypt\Encrypt',
            'key' => '123',
        ],
    ],
    key设置自己生成的
    2使用
    $encrypt = Yii::$app->get('encrypt');
    数据格式
    $data = [
                'sn' => 'sn123456789,
                'timestamp' => time(),
                'user_id' => 45,
                'type' => 2,
                'num' => 455,
    ];
    $sign = $encrypt->encrypt($data);
    $data['sign'] = $sign;
    将计算出的签名sign加入data并传输data
    ```
-----

数据库批量修改封装帮助类使用方法(配合事物使用，此方法适用于批量修改数字型字段的加减)  :

```php
        $data = [
            1 => [
                'num' => [
                    'value' => 45,
                    'type' => MysqlHelper::UPDATE_PLUS
                ],
                'create_at' => time(),
                'ice_num' => 6
            ],
            2 => [
                'num' => [
                    'value' => 45,
                    'type' => MysqlHelper::UPDATE_MINUS
                ],
                'create_at' => time(),
                'ice_num' => 3
            ],
            3 => [
                'num' => 456,
                'ice_num' => 9,
                'create_at' => time()
            ],
            5 => [
                'num' => 12783,
                'ice_num' => 7,
                'create_at' => time()
            ],
        ];
        //二维数组键为where条件(比如说上面的意思是修改id为1的num，create_at，ice_num字段)，每个修改的字段可以单独设置为替换，加，减，不设置默认为替换
        $connection = Yii::$app->db;
        $transaction = $connection->beginTransaction();
        try {
        //test为表名，id为where条件字段
            if (!MysqlHelper::batchUpdate('test', 'id', $data)) {
                throw new Exception(123);
            }
            $transaction->commit();
        } catch (Exception $e) {
            $transaction->rollBack();
            var_dump($e->getMessage());
        }
```

###  Health Score

19

—

LowBetter than 10% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity4

Limited adoption so far

Community8

Small or concentrated contributor base

Maturity37

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/0f0777608fe1bf4c86c2d171fed0f6109f90d199c255981478e641aca5a8dfd0?d=identicon)[adamyxt](/maintainers/adamyxt)

---

Top Contributors

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

### Embed Badge

![Health badge](/badges/adamyxt-helper/health.svg)

```
[![Health](https://phpackages.com/badges/adamyxt-helper/health.svg)](https://phpackages.com/packages/adamyxt-helper)
```

PHPackages © 2026

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