PHPackages                             poplary/consul-sdk - 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. poplary/consul-sdk

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

poplary/consul-sdk
==================

Consul SDK

0.1.1(5y ago)01.7k1MITPHPPHP &gt;=7.2.5

Since Aug 13Pushed 5y ago1 watchersCompare

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

READMEChangelog (1)Dependencies (2)Versions (3)Used By (1)

poplary/consul
==============

[](#poplaryconsul)

安装
--

[](#安装)

使用以下命令

```
composer require poplary/consul
```

使用
--

[](#使用)

Consul 服务已经搭建完成，URL 为

```
// 获取 Consul 中已经注册的服务列表
$consulService = new ServiceFactory(['base_uri' => 'http://xxx.xxx.xxx.xxx:8500']);

// 获取不同 API 的服务
$catalog = $consulService->get(CatalogInterface::class);

// 调用 Consul 的 API 接口，返回的 $response 变量为一个 Poplary\Consul\ConsulResponse 对象，可以使用类的方法进行解析
$response = $catalog->service('service_name');
```

这个包提供的主要 API 都在 src/Services 目录下，对应的 API 可以在 Consul 的 [API 文档](https://www.consul.io/api-docs) 查看

```
AgentInterface.php
CatalogInterface.php
HealthInterface.php
KVInterface.php
SessionInterface.php

```

###  Health Score

23

—

LowBetter than 27% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity15

Limited adoption so far

Community9

Small or concentrated contributor base

Maturity40

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

Total

2

Last Release

1976d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/2ee85aede69eddaedcab6f55e1a5c7ab33732cbb560e73976ae0f97700af7919?d=identicon)[poplary](/maintainers/poplary)

---

Top Contributors

[![poplary](https://avatars.githubusercontent.com/u/18026812?v=4)](https://github.com/poplary "poplary (2 commits)")

---

Tags

consul

### Embed Badge

![Health badge](/badges/poplary-consul-sdk/health.svg)

```
[![Health](https://phpackages.com/badges/poplary-consul-sdk/health.svg)](https://phpackages.com/packages/poplary-consul-sdk)
```

###  Alternatives

[grumpydictator/firefly-iii

Firefly III: a personal finances manager.

22.8k69.3k](/packages/grumpydictator-firefly-iii)[civicrm/civicrm-core

Open source constituent relationship management for non-profits, NGOs and advocacy organizations.

728272.9k17](/packages/civicrm-civicrm-core)[aedart/athenaeum

Athenaeum is a mono repository; a collection of various PHP packages

255.2k](/packages/aedart-athenaeum)

PHPackages © 2026

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