PHPackages                             tinywan/think-arms - 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. tinywan/think-arms

ActiveLibrary[Framework](/categories/framework)

tinywan/think-arms
==================

ThinkPHP 6.0 arms plugin

v1.2.0(2y ago)31271MITPHPPHP &gt;=7.4

Since Dec 1Pushed 2y ago1 watchersCompare

[ Source](https://github.com/Tinywan/think-arms)[ Packagist](https://packagist.org/packages/tinywan/think-arms)[ RSS](/packages/tinywan-think-arms/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (1)Dependencies (4)Versions (12)Used By (0)

ThinkPHP6.0-ARMS
----------------

[](#thinkphp60-arms)

ARMS 阿里云应用监控链路追踪 library for ThinkPHP6.0 plugin library

安装
--

[](#安装)

```
composer require tinywan/think-arms
```

配置
--

[](#配置)

### 发布配置

[](#发布配置)

```
php think tinywan:arms
```

这将自动生成 `config/arms.php` 配置文件。

### 配置中间件

[](#配置中间件)

全局中间件在app目录下面`middleware.php`文件中定义，使用下面的方式：

```
return [
	\tinywan\middleware\ArmsMiddleware::class,
];
```

全局路由中间件`config/route.php`文件中定义，使用下面的方式：

```
return [
    // 路由中间件全局执行
    'middleware'     => [
        \tinywan\middleware\ArmsMiddleware::class
    ]
];
```

使用案例
----

[](#使用案例)

### [GuzzleHttp\\Client](https://github.com/guzzle/guzzle)

[](#guzzlehttpclient)

```
public function requestHandle(string $method, string $uri, array $body = [], array $header = [])
{
    $config = self::_appConfig();
    if (empty($config)) {
        return self::setError(false, '请先在创培服务中心，开通站点配置');
    }

    $client = new Client(['base_uri' => $config['app_base_uri']]);
    try {
        $options = ['json' => $body];
        $tracingHeader = [];
        /* Injects the context into the wire */
        $injector = request()->tracing->getPropagation()->getInjector(new \Zipkin\Propagation\Map());
        $injector(request()->childSpan->getContext(), $tracingHeader);
        $headers = array_merge($tracingHeader, $header);
        if ($uri !== '/oauth/token') {
            $_accessToken = self::_issueAccessToken($config);
            if (false === $_accessToken) {
                return self::setError(false, self::getMessage());
            }
            $headers = array_merge(['Authorization' => 'Bearer ' . $_accessToken], $headers);
        }
        $options = array_merge(['headers' => $headers], $options);
        /* Creates the span for getting Ucenter */
        request()->zipKin->addChildSpan('ucenter:'.$uri, [
            'uri' => $uri,
            'method' => $method,
            'headers' => json_encode($headers),
            'body' => json_encode($body),
        ]);
        /* HTTP Request to the Ucenter */
        request()->childSpan->annotate('request.started', now());
        $resp = $client->request($method, $uri, $options);
    } catch (RequestException | GuzzleException $e) {
        if ($e->hasResponse()) {
            if (200 != $e->getResponse()->getStatusCode()) {
                $jsonStr = $e->getResponse()->getBody()->getContents();
                $content = json_decode($jsonStr, true);
                return self::setError(false, '温馨提示：' . $content['msg'] ?? '未知的错误信息');
            }
        }
        return self::setError(false, '系统中心提示：' . $e->getMessage());
    }
    request()->childSpan->annotate('request.finished', now());
    request()->childSpan->finish();
    request()->zipKin->endRootSpan();
    $jsonStr = $resp->getBody()->getContents();
    $data = json_decode($jsonStr, true);
    if (!isset($data['code']) || 0 != $data['code']) {
        return self::setError(false, $data['msg'] ?? '响应数据结构异常');
    }
    return $data;
}
```

###  Health Score

27

—

LowBetter than 49% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity15

Limited adoption so far

Community10

Small or concentrated contributor base

Maturity52

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 94.4% 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 ~22 days

Recently: every ~46 days

Total

11

Last Release

1043d ago

### Community

Maintainers

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

---

Top Contributors

[![Tinywan](https://avatars.githubusercontent.com/u/14959876?v=4)](https://github.com/Tinywan "Tinywan (17 commits)")[![licyril](https://avatars.githubusercontent.com/u/23089397?v=4)](https://github.com/licyril "licyril (1 commits)")

###  Code Quality

Static AnalysisPHPStan

Code StylePHP CS Fixer

Type Coverage Yes

### Embed Badge

![Health badge](/badges/tinywan-think-arms/health.svg)

```
[![Health](https://phpackages.com/badges/tinywan-think-arms/health.svg)](https://phpackages.com/packages/tinywan-think-arms)
```

###  Alternatives

[laravel/telescope

An elegant debug assistant for the Laravel framework.

5.2k67.8M192](/packages/laravel-telescope)[spiral/roadrunner

RoadRunner: High-performance PHP application server and process manager written in Go and powered with plugins

8.4k12.2M84](/packages/spiral-roadrunner)[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.

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

A simple API extension for DateTime.

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

PHPackages © 2026

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