PHPackages                             rebie-kong/mp-tools - 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. rebie-kong/mp-tools

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

rebie-kong/mp-tools
===================

1.1.0(9y ago)011Apache-2.0PHP

Since Feb 2Pushed 9y ago1 watchersCompare

[ Source](https://github.com/RebieKong/mp-tools)[ Packagist](https://packagist.org/packages/rebie-kong/mp-tools)[ RSS](/packages/rebie-kong-mp-tools/feed)WikiDiscussions master Synced 2mo ago

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

微信公众号开发组件
=========

[](#微信公众号开发组件)

---

### QuickStart

[](#quickstart)

---

composer require rebie-kong/mp-tools

```
// Hooker.php
class Hooker extends MpHook
{
    public function __construct()
    {
        parent::__construct();

        $function = new MpHookFunction(function(MessageBean $bean){
            if ($bean->content =='不理我'){
                return ResponseGainer::nullResult();
            }
            return ResponseGainer::genTextResult(sprintf("你发送的消息是：%s",$bean->content),$bean);
        });
        $this->hook(HookInterface::HOOK_MSG_TEXT,$function);
    }
}
```

```
// Controller.php
class Controller
{
    public function action(){
        $mpConfig = [];
        $hooker = new Hooker();
        $runner = new MpTask($hooker);

        $response = $runner->run($mpConfig['app_id'], $mpConfig['app_secret'], $mpConfig['token'],
            $mpConfig['aes_key']);
    }
}
```

上述代码实现了当用户发送文字信息时回复`你发送的消息是：%s`

当发送`不理我`时不回复

其他消息事件将会因为没有被hook而报告错误

### Business Support

[](#business-support)

---

本组件仅许可非商业开源，如用于商用请联系[开发者邮箱](mailto:main@rebiekong.com)

###  Health Score

28

—

LowBetter than 54% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity5

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity67

Established project with proven stability

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

Total

5

Last Release

3382d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/cde4d78a93548a98e4b7b8ac18b52a42c1b356cbecbbd075f45ed70ba3f05740?d=identicon)[RebieKong](/maintainers/RebieKong)

---

Top Contributors

[![RebieKong](https://avatars.githubusercontent.com/u/14296362?v=4)](https://github.com/RebieKong "RebieKong (26 commits)")

### Embed Badge

![Health badge](/badges/rebie-kong-mp-tools/health.svg)

```
[![Health](https://phpackages.com/badges/rebie-kong-mp-tools/health.svg)](https://phpackages.com/packages/rebie-kong-mp-tools)
```

###  Alternatives

[ericmann/wp-session-manager

Prototype session management for WordPress.

27123.6k1](/packages/ericmann-wp-session-manager)[irazasyed/docgen

Streamline your Laravel package development with automatic facade documentation using Docgen for Laravel

233.8k10](/packages/irazasyed-docgen)

PHPackages © 2026

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