PHPackages                             activecollab/etcd - 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. activecollab/etcd

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

activecollab/etcd
=================

etcd client with minimal dependencies

1.0.4(10y ago)1415.0k6[4 PRs](https://github.com/activecollab/etcd/pulls)3MITPHPPHP &gt;=5.6.0

Since Dec 16Pushed 5y ago2 watchersCompare

[ Source](https://github.com/activecollab/etcd)[ Packagist](https://packagist.org/packages/activecollab/etcd)[ Docs](https://labs.activecollab.com)[ RSS](/packages/activecollab-etcd/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (5)Dependencies (1)Versions (6)Used By (3)

Etcd PHP Client
===============

[](#etcd-php-client)

[![Build Status](https://camo.githubusercontent.com/114e80629d0b1b9f8df1f0f710a3f56cde79d3111b68d1c10d1f86142f927af0/68747470733a2f2f7472617669732d63692e6f72672f616374697665636f6c6c61622f657463642e7376673f6272616e63683d6d6173746572)](https://travis-ci.org/activecollab/etcd)

etcd is a distributed configuration system, part of the coreos project.

This repository provides a client library for etcd for PHP applications. It is based on [linkorb/etcd-php](https://github.com/linkorb/etcd-php). To learn why we forked it, jump [here](#why-fork).

Installating etcd
-----------------

[](#installating-etcd)

To install etcd, follow instructions that etcd team posts on Releases page of the project:

Installing ActiveCollab/etcd
----------------------------

[](#installing-activecollabetcd)

Easiest way is to install it using composer:

```
{
    "require" : {
        "activecollab/etcd": "^1.0"
    }
}
```

Using Client
------------

[](#using-client)

```
use use ActiveCollab\Etcd\Client as EtcdClient;

$client = new EtcdClient('http://127.0.0.1:4001');

// Get, set, update, remove key
if (!$client->exists('/key/name')) {
    $client->set('/key/name', 'value');
}
$client->set('/key/name', 'value', 10); // Set TTL
print $client->get('/key/name');

$client->update('/key/name', 'new value');

$client->remove('/key/name');

// Working with dirs
if (!$client->dirExists('/dir/path')) {
    $client->createDir('/dir/path');
}
$client->updateDir('/dir/path', 10); // Set TTL
$client->removeDir('/dir/path');

// Get dir info
$client->dirInfo('/dir/path');

// List subdirectories
$client->listDirs('/dir/path');

// Return key value map for a given dir
$client->getKeyValueMap('/dir/path')
```

Sandbox Path
------------

[](#sandbox-path)

If you configure sandbox path in the client instance, all keys will be prefixed with that path:

```
$client = new EtcdClient('http://127.0.0.1:4001');
$client->setSandboxPath('/my/namespace');

$client->set('/key/name', 'value'); // will set /my/namespace/key/name
print $client->get('/key/name'); // will print /my/namespace/key/name
```

One more conenient method that client offers is option to call several commands in a specific sanbox, and have client revert back to the previous sandbox path when done:

```
$client = new EtcdClient('http://127.0.0.1:4001');
$client->setSandboxPath('/my/namespace');

// Path relative to the current sandbox path
$client->sandboxed('./different/namespace', function(EtcdClient &$c) {
    $c->set('new_key', 123); // Sets /my/namespace/different/namespace/new_key
});

// Absolute path
$client->sandboxed('/different/namespace', function(EtcdClient &$c) {
    $c->set('new_key', 123); // Sets /different/namespace/new_key
});

print $client->getSandboxPath(); // Prints '/my/namespace'
```

SSL
---

[](#ssl)

Client can be configured not to verify SSL peer:

```
$client = (new Client('https://127.0.0.1:4001'))->verifySslPeer(false);
```

as well as to use a custom CA file:

```
$client = (new Client('https://127.0.0.1:4001'))->verifySslPeer(true, '/path/to/ca/file');
```

Why Fork?
---------

[](#why-fork)

While [original library](https://github.com/linkorb/etcd-php) works well, it depends on two big packages: Symfony Console and Guzzle. For a feature as low level as config access, we wanted something a bit nimbler, so we removed CLI commands and refactored the original library to use PHP's curl extension.

###  Health Score

36

—

LowBetter than 82% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity33

Limited adoption so far

Community18

Small or concentrated contributor base

Maturity62

Established project with proven stability

 Bus Factor1

Top contributor holds 94.3% 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 ~6 days

Total

5

Last Release

3780d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/729914?v=4)[Ilija Studen](/maintainers/ilijastuden)[@ilijastuden](https://github.com/ilijastuden)

---

Top Contributors

[![ilijastuden](https://avatars.githubusercontent.com/u/729914?v=4)](https://github.com/ilijastuden "ilijastuden (33 commits)")[![legoktm](https://avatars.githubusercontent.com/u/81392?v=4)](https://github.com/legoktm "legoktm (2 commits)")

---

Tags

clientconfigurationetcd

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/activecollab-etcd/health.svg)

```
[![Health](https://phpackages.com/badges/activecollab-etcd/health.svg)](https://phpackages.com/packages/activecollab-etcd)
```

###  Alternatives

[symfony/options-resolver

Provides an improved replacement for the array\_replace PHP function

3.2k493.9M1.6k](/packages/symfony-options-resolver)[league/config

Define configuration arrays with strict schemas and access values with dot notation

564302.2M24](/packages/league-config)[artisaninweb/laravel-soap

A SoapClient wrapper integration for Laravel

6314.5M12](/packages/artisaninweb-laravel-soap)[josegonzalez/dotenv

dotenv file parsing for PHP

2799.8M137](/packages/josegonzalez-dotenv)[dflydev/dot-access-configuration

Given a deep data structure representing a configuration, access configuration by dot notation.

13414.5M4](/packages/dflydev-dot-access-configuration)[symfony/requirements-checker

Check Symfony requirements and give recommendations

2014.7M29](/packages/symfony-requirements-checker)

PHPackages © 2026

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