PHPackages                             jason-gao/apollo-client - 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. [API Development](/categories/api)
4. /
5. jason-gao/apollo-client

ActiveLibrary[API Development](/categories/api)

jason-gao/apollo-client
=======================

apollo client for php

v0.1.0(7y ago)051MITPHPPHP &gt;=5.6

Since Oct 26Pushed 7y ago1 watchersCompare

[ Source](https://github.com/jason-gao/apollo-php-client)[ Packagist](https://packagist.org/packages/jason-gao/apollo-client)[ Docs](https://github.com/jason-gao/apollo-php-client)[ RSS](/packages/jason-gao-apollo-client/feed)WikiDiscussions master Synced 2d ago

READMEChangelog (1)DependenciesVersions (3)Used By (0)

[携程Apollo](https://github.com/ctripcorp/apollo)的PHP客户端
======================================================

[](#携程apollo的php客户端)

install
-------

[](#install)

php version &gt;= 5.6

```
$ composer require jason-gao/apollo-client

## Features
- 支持apollo配置变更的实时获取
- 支持拉取配置后自定义的回调处理

## Usage
客户端以cli的方式后台启动执行，支持apollo配置的适时获取，并将配置保存在指定的目录供应用程序读取解析

### 客户端示例代码
```php
#!/usr/bin/env php
setClientIp($clientIp);
}

ini_set('memory_limit','128M');
$pid = getmypid();
echo "start [$pid]\n";
$restart = true; //auto start if failed
do {
    $error = $apollo->start();
    if ($error) echo('error:'.$error."\n");
}while($error && $restart);
```

### 配置管理

[](#配置管理)

拉取的配置默认保存在脚本所在目录，每个namespace的配置以`apolloConfig.{$namespaceName}.php`的方式命名保存

### Docker环境客户端自启动

[](#docker环境客户端自启动)

在docker的启动脚本中加入启动代码，一般的php容器启动脚本是docker-php-entrypoint

```
if [ -f "/path/to/start.php" ]; then
    apollo_ps=$(ps -aux | grep -c "php /path/to/start.php")
    if [ $apollo_ps -eq 1 ]; then
        php /path/to/start.php &
    fi
fi
```

###  Health Score

24

—

LowBetter than 31% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity8

Limited adoption so far

Community12

Small or concentrated contributor base

Maturity48

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 88.9% 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

2602d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/dfe2039308a3330d27c5042b04fb30b92751dd44f57a766524d0e6819dd77cf7?d=identicon)[jason-gao](/maintainers/jason-gao)

---

Top Contributors

[![xiaodx12](https://avatars.githubusercontent.com/u/16207849?v=4)](https://github.com/xiaodx12 "xiaodx12 (40 commits)")[![t04041143](https://avatars.githubusercontent.com/u/3040081?v=4)](https://github.com/t04041143 "t04041143 (2 commits)")[![jason-gao](https://avatars.githubusercontent.com/u/9896574?v=4)](https://github.com/jason-gao "jason-gao (1 commits)")[![t1ger](https://avatars.githubusercontent.com/u/21078713?v=4)](https://github.com/t1ger "t1ger (1 commits)")[![ueaner](https://avatars.githubusercontent.com/u/318253?v=4)](https://github.com/ueaner "ueaner (1 commits)")

---

Tags

clientapollo

### Embed Badge

![Health badge](/badges/jason-gao-apollo-client/health.svg)

```
[![Health](https://phpackages.com/badges/jason-gao-apollo-client/health.svg)](https://phpackages.com/packages/jason-gao-apollo-client)
```

###  Alternatives

[openai-php/client

OpenAI PHP is a supercharged PHP API client that allows you to interact with the Open AI API

5.8k26.1M295](/packages/openai-php-client)[openai-php/laravel

OpenAI PHP for Laravel is a supercharged PHP API client that allows you to interact with the Open AI API

3.7k8.8M83](/packages/openai-php-laravel)[algolia/algoliasearch-client-php

API powering the features of Algolia.

69734.4M145](/packages/algolia-algoliasearch-client-php)[meilisearch/meilisearch-php

PHP wrapper for the Meilisearch API

75115.4M189](/packages/meilisearch-meilisearch-php)[multilinguals/apollo-client

apollo client for php

17758.5k4](/packages/multilinguals-apollo-client)[resend/resend-php

Resend PHP library.

596.2M36](/packages/resend-resend-php)

PHPackages © 2026

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