PHPackages                             yogcloud/hyperf-soar - 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. yogcloud/hyperf-soar

ActiveLibrary

yogcloud/hyperf-soar
====================

Soar optimization sql tips based on hyperf implementation

1.0.0(4y ago)28Apache-2.0PHPPHP &gt;=7.4

Since Apr 25Pushed 4y ago1 watchersCompare

[ Source](https://github.com/YogCloud/hyperf-soar)[ Packagist](https://packagist.org/packages/yogcloud/hyperf-soar)[ RSS](/packages/yogcloud-hyperf-soar/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (1)Dependencies (9)Versions (2)Used By (0)

Hyperf-soar
===========

[](#hyperf-soar)

> soar 是一个小米公司开源的 soar 开发的 SQL 优化器、重写器(辅助 SQL 调优)。

[![Latest Stable Version](https://camo.githubusercontent.com/50d45d70a16c3ec889a1d3840bd286cfd787a4910ad37052287b656a30f31c12/687474703a2f2f706f7365722e707567782e6f72672f796f67636c6f75642f6879706572662d736f61722f76)](https://packagist.org/packages/yogcloud/hyperf-soar) [![Total Downloads](https://camo.githubusercontent.com/09aa46dc79d96075c776861b8cd22bfc7332245828fa44143fad00fcc86c355b/687474703a2f2f706f7365722e707567782e6f72672f796f67636c6f75642f6879706572662d736f61722f646f776e6c6f616473)](https://packagist.org/packages/yogcloud/hyperf-soar) [![Latest Unstable Version](https://camo.githubusercontent.com/b3bca2a0b0839e145e219fda21eed5dc516dc2486ff121361761347983f18cb5/687474703a2f2f706f7365722e707567782e6f72672f796f67636c6f75642f6879706572662d736f61722f762f756e737461626c65)](https://packagist.org/packages/yogcloud/hyperf-soar) [![License](https://camo.githubusercontent.com/acc419e309828fffd367534122bd8fbc699095da321cadac710518c06c9451f5/687474703a2f2f706f7365722e707567782e6f72672f796f67636c6f75642f6879706572662d736f61722f6c6963656e7365)](https://packagist.org/packages/yogcloud/hyperf-soar) [![PHP Version Require](https://camo.githubusercontent.com/75e4e1a314e11835ff178169e84eece71613a30e39d1ec6c99377636e04aa0f3/687474703a2f2f706f7365722e707567782e6f72672f796f67636c6f75642f6879706572662d736f61722f726571756972652f706870)](https://packagist.org/packages/yogcloud/hyperf-soar)

环境要求
====

[](#环境要求)

- Hyperf 2.2
- Swoole 4.6
- ext-json
- ext-mbstring
- ext-pdo

安装
==

[](#安装)

```
composer require yogcloud/hyperf-soar

```

发布文件
====

[](#发布文件)

```
php bin/hyperf.php vendor:publish yogcloud/hyperf-soar

```

配置文件
====

[](#配置文件)

```
SOAR_ENABLED=true
SOAR_TEST_DSN_DISABLE=false
SOAR_PATH=your_soar_path
SOAR_TEST_DSN_HOST=127.0.0.1
SOAR_TEST_DSN_PORT=3306
SOAR_TEST_DSN_DBNAME=yourdb
SOAR_TEST_DSN_USER=root
SOAR_TEST_DSN_PASSWORD=
SOAR_REPORT_TYPE=json
```

使用
==

[](#使用)

执行查询日志生成到`runtime/logs/xxx.log`

```
[2022-04-25 04:06:03] soar.INFO: [
 {
  "ID": "2E5B1F825CF2009A",
  "Fingerprint": "select * from `kd_farm_account` where `kd_farm_account`.`user_id` = ? limit ?",
  "Score": 75,
  "Sample": "select * from `kd_farm_account` where `kd_farm_account`.`user_id` = '500' limit 1",
  "Explain": null,
  "HeuristicRules": [
    {
      "Item": "COL.001",
      "Severity": "L1",
      "Summary": "不建议使用 SELECT * 类型查询",
      "Content": "当表结构变更时，使用 * 通配符选择所有列将导致查询的含义和行为会发生更改，可能导致查询返回更多的数据。",
      "Case": "select * from tbl where id=1",
      "Position": 0
    },
    {
      "Item": "RES.002",
      "Severity": "L4",
      "Summary": "未使用 ORDER BY 的 LIMIT 查询",
      "Content": "没有 ORDER BY 的 LIMIT 会导致非确定性的结果，这取决于查询执行计划。",
      "Case": "select col1,col2 from tbl where name=xx limit 10",
      "Position": 0
    }
  ],
  "IndexRules": null,
  "Tables": [
    "`information_schema`.`kd_farm_account`"
  ]
}
]
 [] []
```

License
=======

[](#license)

Apache License Version 2.0,

###  Health Score

23

—

LowBetter than 27% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity7

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

1485d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/26520956?v=4)[ben](/maintainers/cexll)[@cexll](https://github.com/cexll)

---

Top Contributors

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

### Embed Badge

![Health badge](/badges/yogcloud-hyperf-soar/health.svg)

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

###  Alternatives

[mineadmin/mineadmin

Quickly build a background management system for web applications

1.2k2.0k](/packages/mineadmin-mineadmin)[hyperf/odin

425.9k](/packages/hyperf-odin)[mzh/hyperf-validate

hyperf-validate 支持request 和方法场景验证，兼容tp5写法 支持控制器注解验证、方法注解验证

202.9k1](/packages/mzh-hyperf-validate)

PHPackages © 2026

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