PHPackages                             kubill/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. [API Development](/categories/api)
4. /
5. kubill/etcd

ActiveLibrary[API Development](/categories/api)

kubill/etcd
===========

Etcd client library for PHP

v1.6.2(5y ago)04MITPHPPHP &gt;=5.6

Since Feb 11Pushed 5y agoCompare

[ Source](https://github.com/kubill/etcd)[ Packagist](https://packagist.org/packages/kubill/etcd)[ Docs](http://github.com/kubill/etcd)[ RSS](/packages/kubill-etcd/feed)WikiDiscussions master Synced today

READMEChangelog (1)Dependencies (4)Versions (11)Used By (0)

[![Build Status](https://camo.githubusercontent.com/9e2339a38da4f19a9805f380cddb0aa368ba3ba9d72e7db5500cff5ff7d6c444/68747470733a2f2f7472617669732d63692e6f72672f6c696e6b6f72622f657463642d7068702e706e673f6272616e63683d6d6173746572)](https://travis-ci.org/linkorb/etcd-php)[![Latest Stable Version](https://camo.githubusercontent.com/b3f92847e1f9f887be1e14b8872edb6024846e817f4b075ac07595123a5cee21/68747470733a2f2f706f7365722e707567782e6f72672f6c696e6b6f72622f657463642d7068702f762f737461626c652e706e67)](https://packagist.org/packages/linkorb/etcd-php)[![Total Downloads](https://camo.githubusercontent.com/b57f6cd7228c4368898fe8cc7dc1843042a7d5bcaaf40ec82b9d28fa8bfc36d9/68747470733a2f2f706f7365722e707567782e6f72672f6c696e6b6f72622f657463642d7068702f646f776e6c6f6164732e706e67)](https://packagist.org/packages/linkorb/etcd-php)[![Latest Unstable Version](https://camo.githubusercontent.com/3dcc69dd0d51e3d5b96488d5e3a3effef03b5062ffb6cb800338bc47bd1425f3/68747470733a2f2f706f7365722e707567782e6f72672f6c696e6b6f72622f657463642d7068702f762f756e737461626c652e706e67)](https://packagist.org/packages/linkorb/etcd-php)[![License](https://camo.githubusercontent.com/fef10ab3b0387065da4d14b2cace1744fb9ea5e2b6a3a70e2bfb3c233bd827dc/68747470733a2f2f706f7365722e707567782e6f72672f6c696e6b6f72622f657463642d7068702f6c6963656e73652e706e67)](https://packagist.org/packages/linkorb/etcd-php)

Etcd client library for PHP
===========================

[](#etcd-client-library-for-php)

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

This repository provides a client library for etcd for PHP applications.

Installing and running etcd
---------------------------

[](#installing-and-running-etcd)

```
git clone https://github.com/coreos/etcd.git
cd etcd
./build
./bin/etcd
```

Brought to you by the LinkORB Engineering team
----------------------------------------------

[](#brought-to-you-by-the-linkorb-engineering-team)

Check out our other projects at [linkorb.com/engineering](http://www.linkorb.com/engineering).

Btw, we're hiring!

Usage
-----

[](#usage)

### The client

[](#the-client)

### Instantiate the client

[](#instantiate-the-client)

```
$client = new Client($server);
```

### Instantiate the client with custom Guzzle Client

[](#instantiate-the-client-with-custom-guzzle-client)

```
$client = Client::constructWithGuzzleClient($guzzleClient, $server);
```

### Use the client instance

[](#use-the-client-instance)

```
$client->set('/foo', 'fooValue');
// Set the ttl
$client->set('/foo', 'fooValue', 10);
// get key value
echo $client->get('/foo');

// Update value with key
$client->update('/foo', 'newFooValue');

// Delete key
$client->rm('/foo');

// Create a directory
$client->mkdir('/fooDir');
// Remove dir
$client->rmdir('/fooDir');
```

### The command line tool

[](#the-command-line-tool)

#### Setting Key Values

[](#setting-key-values)

Set a value on the `/foo/bar` key:

```
$ bin/etcd-php etcd:set /foo/bar "Hello world"
```

Set a value on the `/foo/bar` key with a value that expires in 60 seconds:

```
$ bin/etcd-php etcd:set /foo/bar "Hello world" --ttl=60
```

Create a new key `/foo/bar`, only if the key did not previously exist:

```
$ bin/etcd-php etcd:mk /foo/new_bar "Hello world"
```

Create a new dir `/fooDir`, only if the key did not previously exist:

```
$ bin/etcd-php etcd:mkdir /fooDir
```

Update an existing key `/foo/bar`, only if the key already existed:

```
$ bin/etcd-php etcd:update /foo/bar "Hola mundo"
```

Create or update a directory called `/mydir`:

```
$ bin/etcd-php etcd:setDir /mydir
```

#### Retrieving a key value

[](#retrieving-a-key-value)

Get the current value for a single key in the local etcd node:

```
$ bin/etcd-php etcd:get /foo/bar
```

#### Listing a directory

[](#listing-a-directory)

Explore the keyspace using the `ls` command

```
$ bin/etcd-php etcd:ls
/akey
/adir
$ bin/etcd-php etcd:ls /adir
/adir/key1
/adir/key2
```

Add `-recursive` to recursively list subdirectories encountered.

```
$ bin/etcd-php etcd:ls --recursive
/foo
/foo/bar
/foo/new_bar
/fooDir
```

### Deleting a key

[](#deleting-a-key)

Delete a key:

```
$ bin/etcd-php etcd:rm /foo/bar
```

Delete an empty directory or a key-value pair

```
$ bin/etcd-php etcd:rmdir /path/to/dir
```

Recursively delete a key and all child keys:

```
$ bin/etcd-php etcd:rmdir /path/to/dir --recursive
```

#### Export node

[](#export-node)

```
$ bin/etcd-php etcd:export --server=http://127.0.0.1:2379 --format=json --output=config.json /path/to/dir
```

#### Watching for changes

[](#watching-for-changes)

Watch for only the next change on a key:

```
$ bin/etcd-php etcd:watch /foo/bar
```

###  Health Score

27

—

LowBetter than 49% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity3

Limited adoption so far

Community14

Small or concentrated contributor base

Maturity64

Established project with proven stability

 Bus Factor2

2 contributors hold 50%+ of commits

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

Recently: every ~212 days

Total

10

Last Release

2027d ago

PHP version history (2 changes)v1.0.0PHP &gt;=5.3.0

v1.4.0PHP &gt;=5.6

### Community

Maintainers

![](https://www.gravatar.com/avatar/5bb340a8881098072494fd3a284ce0941d84832c353c8471bc3bda524762a91b?d=identicon)[kubill](/maintainers/kubill)

---

Top Contributors

[![congpeijun](https://avatars.githubusercontent.com/u/881552?v=4)](https://github.com/congpeijun "congpeijun (25 commits)")[![joostfaassen](https://avatars.githubusercontent.com/u/411113?v=4)](https://github.com/joostfaassen "joostfaassen (24 commits)")[![robberphex](https://avatars.githubusercontent.com/u/1926185?v=4)](https://github.com/robberphex "robberphex (6 commits)")[![meiweijia](https://avatars.githubusercontent.com/u/9076442?v=4)](https://github.com/meiweijia "meiweijia (2 commits)")[![LeeSaferite](https://avatars.githubusercontent.com/u/47386?v=4)](https://github.com/LeeSaferite "LeeSaferite (2 commits)")[![YKozin88](https://avatars.githubusercontent.com/u/43985094?v=4)](https://github.com/YKozin88 "YKozin88 (1 commits)")[![gfyrag](https://avatars.githubusercontent.com/u/9094799?v=4)](https://github.com/gfyrag "gfyrag (1 commits)")[![pataquets](https://avatars.githubusercontent.com/u/1286254?v=4)](https://github.com/pataquets "pataquets (1 commits)")[![sammarks](https://avatars.githubusercontent.com/u/424093?v=4)](https://github.com/sammarks "sammarks (1 commits)")[![agoosev](https://avatars.githubusercontent.com/u/4441170?v=4)](https://github.com/agoosev "agoosev (1 commits)")

---

Tags

phpapiconfigurationdistributedetcd

###  Code Quality

TestsPHPUnit

### Embed Badge

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

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

###  Alternatives

[linkorb/etcd-php

Etcd client library for PHP

243143.4k1](/packages/linkorb-etcd-php)[openai-php/laravel

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

3.7k7.6M74](/packages/openai-php-laravel)[hubspot/api-client

Hubspot API client

23414.2M16](/packages/hubspot-api-client)[theodo-group/llphant

LLPhant is a library to help you build Generative AI applications.

1.5k311.5k5](/packages/theodo-group-llphant)[resend/resend-php

Resend PHP library.

564.7M21](/packages/resend-resend-php)[checkout/checkout-sdk-php

Checkout.com SDK for PHP

553.3M7](/packages/checkout-checkout-sdk-php)

PHPackages © 2026

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