PHPackages                             imiphp/project-grpc - 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. [Framework](/categories/framework)
4. /
5. imiphp/project-grpc

ActiveProject[Framework](/categories/framework)

imiphp/project-grpc
===================

imi 框架的 Grpc 项目。https://imiphp.com

v2.1.5(2y ago)574PHPPHP &gt;=7.4

Since Oct 14Pushed 2y ago1 watchersCompare

[ Source](https://github.com/imiphp/project-grpc)[ Packagist](https://packagist.org/packages/imiphp/project-grpc)[ RSS](/packages/imiphp-project-grpc/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (6)Dependencies (7)Versions (7)Used By (0)

说明
==

[](#说明)

这是一个 imi gRPC 项目开发骨架项目，你可以基于这个项目来开发你的项目。

imi 框架：

imi 文档：

内置了 HTTP 代理网关的实现 `GrpcServer/Controller/ProxyController.php`。

安装
--

[](#安装)

创建项目：`composer create-project imiphp/project-grpc:~2.1.0`

配置
--

[](#配置)

### 项目命名空间

[](#项目命名空间)

默认是 `ImiApp`，可以在 `composer.json` 中修改：

- `autoload.psr-4.ImiApp`
- `imi.namespace`

然后替换代码中的命名空间即可。

### 运行配置

[](#运行配置)

项目配置目录：`config`

gRPC 服务器配置目录：`GrpcServer/config`

启动命令
----

[](#启动命令)

`vendor/bin/imi-swoole swoole/start`

测试代码
----

[](#测试代码)

```
curl --location "http://127.0.0.1:8080/proxy/grpc/grpc.TestService/test" \
--header 'Content-Type: application/json' \
--data '{
    "int": 114514
}' \
-vvv
```

权限
--

[](#权限)

`.runtime` 目录需要有可写权限

Grpc Protobuf
-------------

[](#grpc-protobuf)

修改 proto 文件后必须要重新生成。

Grpc 的 protobuf 生成：`cd grpc && protoc --php_out=./ grpc.proto`

protoc 下载和安装：

生产环境
----

[](#生产环境)

**关闭热更新：**`config/beans.php` 中 `hotUpdate.status` 设为 `false`

代码质量
----

[](#代码质量)

### 格式化代码

[](#格式化代码)

内置 `php-cs-fixer`，统一代码风格。

配置文件 `.php-cs-fixer.php`，可根据自己实际需要进行配置，文档：

**格式化项目：** `./vendor/bin/php-cs-fixer fix`

**格式化指定文件：** `./vendor/bin/php-cs-fixer fix test.php`

### 代码静态分析

[](#代码静态分析)

内置 `phpstan`，可规范代码，排查出一些隐藏问题。

配置文件 `phpstan.neon`，可根据自己实际需要进行配置，文档：

**分析项目：** `./vendor/bin/phpstan`

**分析指定文件：** `./vendor/bin/phpstan test.php`

### 测试用例

[](#测试用例)

内置 `phpunit`，可以实现自动化测试。

**文档：**

**测试用例 demo：**`tests/Module/Test/TestServiceTest.php`

**运行测试用例：**`composer test`

###  Health Score

26

—

LowBetter than 43% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity14

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity51

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 ~46 days

Recently: every ~57 days

Total

6

Last Release

1082d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/6f917bb42280d114c53cebadc2942a13ee03abe14971089f88895e266d637169?d=identicon)[Yurunsoft](/maintainers/Yurunsoft)

---

Top Contributors

[![Yurunsoft](https://avatars.githubusercontent.com/u/20104656?v=4)](https://github.com/Yurunsoft "Yurunsoft (8 commits)")

###  Code Quality

TestsPHPUnit

Static AnalysisPHPStan

Code StylePHP CS Fixer

Type Coverage Yes

### Embed Badge

![Health badge](/badges/imiphp-project-grpc/health.svg)

```
[![Health](https://phpackages.com/badges/imiphp-project-grpc/health.svg)](https://phpackages.com/packages/imiphp-project-grpc)
```

###  Alternatives

[nolimits4web/swiper

Most modern mobile touch slider and framework with hardware accelerated transitions

41.8k177.2k1](/packages/nolimits4web-swiper)[laravel/dusk

Laravel Dusk provides simple end-to-end testing and browser automation.

1.9k36.7M259](/packages/laravel-dusk)[laravel/prompts

Add beautiful and user-friendly forms to your command-line applications.

712181.8M596](/packages/laravel-prompts)[cakephp/chronos

A simple API extension for DateTime.

1.4k47.7M121](/packages/cakephp-chronos)[laravel/pail

Easily delve into your Laravel application's log files directly from the command line.

91545.3M590](/packages/laravel-pail)[nette/bootstrap

🅱 Nette Bootstrap: the simple way to configure and bootstrap your Nette application.

68535.8M592](/packages/nette-bootstrap)

PHPackages © 2026

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