PHPackages                             zyprosoft/hyperf-common - 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. zyprosoft/hyperf-common

ActiveLibrary

zyprosoft/hyperf-common
=======================

zyprosoft inc base hyperf adapter

v1.0.31(4mo ago)01742MITPHPPHP &gt;=7.4

Since Sep 28Pushed 4mo ago1 watchersCompare

[ Source](https://github.com/zyprosoft/hyperf-common)[ Packagist](https://packagist.org/packages/zyprosoft/hyperf-common)[ RSS](/packages/zyprosoft-hyperf-common/feed)WikiDiscussions master Synced 4w ago

READMEChangelog (10)Dependencies (28)Versions (33)Used By (2)

内部库

\####一、使用zyprosoft/hyperf-skeleton项目来创建脚手架

1. composer create-project zyprosoft/hyperf-skeleton
2. 完成后执行composer install

\####ZGW协议接口开发 三段式接口名：大模块名.控制器.方法 使用AutoController(prefix="大模块名/控制器")进行注解之后， 按照ZGW协议请求便可自动调用到对应的方法 如下示范:ZgwController下使用AutoController(prefix="/common/zgw")进行注解之后便可 请求到sayHello方法

```
curl -d'{
    "version":"1.0",
    "seqId":"xxxxx",
    "timestamp":1601017327,
    "eventId":1601017327,
    "caller":"test",
    "interface":{
        "name":"common.zgw.sayHello",
        "param":{}
    }
}' http://127.0.0.1:9506
```

\####普通协议开发可直接按照想要的路径做AutoController注解即可

\####根据需求继承需要鉴权和不需要鉴权的Request AdminRequest:需要管理员身份的请求 AuthedRequest:需要登陆身份的请求

\####zgw协议请求内容防篡改 签名算法: 在hyperf-common.php配置好appId和appSecret 第一步:生成当前时间戳timestamp和随机字符串nonce 第二步:取出协议中的interface.name和param, php eg. `$name = $reqBody['interface']['name']`; 第三步:将第一步取出的参数按照如下加入到param, php eg. `$param['interfaceName'] = $name`; 第四步:将第二步的param参数按照首字母升序 第五步:将第四部参数数组json编码后进行md5编码得到参数字符串paramString,注意这里json编码不要主动编码为Unicode,不转义/字符 第六步:按照下面的格式拼接参数: appId=$appId&amp;appSecret=$appSecret&amp;nonce=$nonce&amp;timestamp=$timestamp&amp;$paramString; 第七步:用appSecret和第六步字符串采用sha256算法算出签名 第八步:将得到的签名使用参数名signature加入到请求协议的外层即可

重点:如果是接口带文件上传，需要将上述得到的auth和interface字段进行json编码,后端会在获取到请求的时候自动解码

参考请求包

```
curl -d'{
    "auth":{
       "timestamp":1601017327,
       "nonce":"1601017327",
       "appId":"test",
       "signature":"xxasdfsfdsfffg"
    },
    "version":"1.0",
    "seqId":"xxxxx",
    "timestamp":1601017327,
    "eventId":1601017327,
    "caller":"test",
    "interface":{
        "name":"common.zgw.sayHello",
        "param":{}
    }
}' http://127.0.0.1:9506
```

本地开发：

docker run -d --name hyperf-common
-v /Users/zyvincent/Desktop/iCodeFutureWorkSpace/hyperfCommon:/data/project
-p 8001:8001 -it
\--privileged -u root
\--entrypoint /bin/sh
hyperf/hyperf:8.0-alpine-v3.12-swoole

###  Health Score

42

—

FairBetter than 89% of packages

Maintenance78

Regular maintenance activity

Popularity11

Limited adoption so far

Community11

Small or concentrated contributor base

Maturity57

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

Every ~38 days

Recently: every ~29 days

Total

32

Last Release

145d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/7a6b0152c88e6c2fcf9586bdcb44fc349635be78ae18331b3c190cf65bee2d5b?d=identicon)[zyprosoft](/maintainers/zyprosoft)

---

Top Contributors

[![zyprosoft](https://avatars.githubusercontent.com/u/1636223?v=4)](https://github.com/zyprosoft "zyprosoft (165 commits)")

---

Tags

phphyperf

###  Code Quality

Static AnalysisPHPStan

Code StylePHP CS Fixer

Type Coverage Yes

### Embed Badge

![Health badge](/badges/zyprosoft-hyperf-common/health.svg)

```
[![Health](https://phpackages.com/badges/zyprosoft-hyperf-common/health.svg)](https://phpackages.com/packages/zyprosoft-hyperf-common)
```

###  Alternatives

[xmo/mine-core

mineadmin core package

1684.2k1](/packages/xmo-mine-core)

PHPackages © 2026

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