PHPackages                             esd-cloud/saber-cloud-plugin - 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. [DevOps &amp; Deployment](/categories/devops)
4. /
5. esd-cloud/saber-cloud-plugin

ActiveLibrary[DevOps &amp; Deployment](/categories/devops)

esd-cloud/saber-cloud-plugin
============================

saber-cloud-plugin

0.3(7y ago)017MITPHP

Since Jun 11Pushed 7y ago1 watchersCompare

[ Source](https://github.com/esd-cloud/saber-cloud-plugin)[ Packagist](https://packagist.org/packages/esd-cloud/saber-cloud-plugin)[ RSS](/packages/esd-cloud-saber-cloud-plugin/feed)WikiDiscussions master Synced 2w ago

READMEChangelog (3)Dependencies (7)Versions (4)Used By (0)

saber-cloud-plugin
==================

[](#saber-cloud-plugin)

使用saber进行微服务访问，声明试web服务客户端

通过接口描述web客户端行为，服务提供方和调用方共用接口，服务提供方实现接口。

接口描述

```
/**
 * @RequestMapping("test")
 * Interface IRestController
 */
interface IRestController
{
    /**
     * get请求
     * @GetMapping("/")
     * @return string
     */
    public function hello();

    /**
     * get请求
     * @GetMapping("test/{name}")
     * @PathVariable("name")
     * @RequestParam("id")
     * @param $name
     * @param $id
     * @return string
     */
    public function test($name, $id);

}

```

服务提供方AnnRestController

```
/**
 * @RestController()
 * Class TestController
 * @package ESD\Plugins\EasyRoute
 */
class AnnRestController extends EasyController implements IRestController
{

    /**
     * 找不到方法时调用
     * @param $methodName
     * @return mixed
     */
    protected function defaultMethod(?string $methodName)
    {
        // TODO: Implement defaultMethod() method.
    }

    /**
     * get请求
     * @GetMapping("/")
     * @return string
     */
    public function hello()
    {
        return "hello";
    }

    /**
     * get请求
     * @GetMapping("test/{name}")
     * @PathVariable("name")
     * @RequestParam("id")
     * @param $name
     * @param $id
     * @return string
     */
    public function test($name, $id)
    {
        return "hello"
    }
}

```

客户端RestClient

```
/**
 * @SaberClient(host="http://127.0.0.1:8082",fallback=RestClientFallback::class)
 * Interface RestClient
 * @package ESD\Plugins\SaberCloud\ExampleClass\Clients
 */
interface RestClient extends IRestController
{

}

```

客户端降级结果RestClientFallback

```
class RestClientFallback implements RestClient
{

    /**
     * get请求
     * @GetMapping("/")
     * @return string
     */
    public function hello()
    {
        return "hello";
    }

    /**
     * get请求
     * @GetMapping("test/{name}")
     * @PathVariable("name")
     * @RequestParam("id")
     * @param $name
     * @param $id
     * @return string
     */
    public function test($name, $id)
    {
        return "test";
    }
}

```

使用客户端

```
    /**
     * @Inject()
     * @var RestClient
     */
    private $restClient;

     /**
     * get请求
     * @GetMapping("/")
     * @return string
     */
    public function hello()
    {
        return $this->restClient->hello();
    }

```

###  Health Score

23

—

LowBetter than 26% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity6

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

Total

3

Last Release

2574d ago

### Community

Maintainers

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

---

Top Contributors

[![tmtbe](https://avatars.githubusercontent.com/u/5286367?v=4)](https://github.com/tmtbe "tmtbe (1 commits)")

---

Tags

serverswoole

### Embed Badge

![Health badge](/badges/esd-cloud-saber-cloud-plugin/health.svg)

```
[![Health](https://phpackages.com/badges/esd-cloud-saber-cloud-plugin/health.svg)](https://phpackages.com/packages/esd-cloud-saber-cloud-plugin)
```

PHPackages © 2026

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