PHPackages                             arunfung/php-apollo - 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. arunfung/php-apollo

ActiveLibrary

arunfung/php-apollo
===================

a apollo client for php.

v0.0.3(6y ago)119MITPHPPHP ~7.1CI failing

Since Dec 13Pushed 6y ago1 watchersCompare

[ Source](https://github.com/arunfung/php-apollo)[ Packagist](https://packagist.org/packages/arunfung/php-apollo)[ RSS](/packages/arunfung-php-apollo/feed)WikiDiscussions master Synced 4d ago

READMEChangelogDependencies (3)Versions (4)Used By (0)

[![Build Status](https://camo.githubusercontent.com/68a6609ad8be2d3529994f89c657da704cb3e297b7dd3f97b9c0c6afdb9ee867/68747470733a2f2f7472617669732d63692e636f6d2f6172756e66756e672f7068702d61706f6c6c6f2e7376673f6272616e63683d6d6173746572)](https://travis-ci.com/arunfung/php-apollo)[![Total Downloads](https://camo.githubusercontent.com/ce32192ece8e1e53f0e763e7ddfd8cb854eb59e3b70d05410a02402b1c4d649d/68747470733a2f2f706f7365722e707567782e6f72672f6172756e66756e672f7068702d61706f6c6c6f2f646f776e6c6f616473)](https://packagist.org/packages/arunfung/php-apollo)[![Latest Stable Version](https://camo.githubusercontent.com/1676f0bdac8ba1d622a5e233710746a64e94be57b35db52671e9b913f1ebb8e1/68747470733a2f2f706f7365722e707567782e6f72672f6172756e66756e672f7068702d61706f6c6c6f2f762f737461626c65)](https://packagist.org/packages/arunfung/php-apollo)[![License](https://camo.githubusercontent.com/0c069479fcb25066535d72b31993f482eec3411d5e9ecf935feb15374f4c0102/68747470733a2f2f706f7365722e707567782e6f72672f6172756e66756e672f7068702d61706f6c6c6f2f6c6963656e7365)](https://packagist.org/packages/arunfung/php-apollo)

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

[](#携程-apollo-配置中心-php-客户端)

### 介绍

[](#介绍)

Apollo 配置中心 PHP client

#### 环境依赖

[](#环境依赖)

- php version &gt;= 7.1

### 安装

[](#安装)

通过 composer 安装:

```
composer require arunfung/php-apollo
```

### 使用

[](#使用)

```
require 'vendor/autoload.php';

use ArunFung\PhpApollo\ApolloClient;

// apollo 服务地址
$server = '';
// apollo 后台配置的 APP ID
$app_id = 0;
// apollo 后台配置的命名空间
$namespaces = [
    "application",
    "datasource",
];

// 实例化 Apollo Client
$testApolloClient = new ApolloClient($server,$app_id,$namespaces);
// 模板文件夹
$testApolloClient->setEnvExamplePath(__DIR__);
// 模板文件名
$testApolloClient->setEnvExample('.env.example');
// env 配置文件夹
$testApolloClient->setEnvPath(__DIR__);
// env 文件名
$testApolloClient->setEnv('.env');

// 拉取 Apollo 的配置写入本地配置文件（适合定时或者单次触发拉取配置）
$testApolloClient->pullConfigs();

// 开启应用感知配置更新并写入本地配置文件
$testApolloClient->start();
```

##### 本地缓存管理

[](#本地缓存管理)

```
// 配置默认缓存目录 /var/www/php-apollo-cache
// 也可以自定义缓存目录
$cache_path = '/data/apollo';
$testApolloClient->setCachePath($cache_path);
```

###  Health Score

22

—

LowBetter than 22% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity8

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity44

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

Total

3

Last Release

2341d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/13562592?v=4)[Arun Fung](/maintainers/ArunFung)[@arunfung](https://github.com/arunfung)

---

Top Contributors

[![arunfung](https://avatars.githubusercontent.com/u/13562592?v=4)](https://github.com/arunfung "arunfung (11 commits)")

---

Tags

apolloapollo-clientphpphp-apollo-clientphpapolloapollo-clientphp-apollo

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/arunfung-php-apollo/health.svg)

```
[![Health](https://phpackages.com/badges/arunfung-php-apollo/health.svg)](https://phpackages.com/packages/arunfung-php-apollo)
```

###  Alternatives

[mailchimp/transactional

458.9M16](/packages/mailchimp-transactional)[apollo-sdk/config

complete implementation of Ctrip Apollo read configuration interface

2242.6k4](/packages/apollo-sdk-config)

PHPackages © 2026

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