gitwtfhub

wtf is etcd-php?

binwiederhier/etcd-php — explained in plain English

Analysis updated 2026-07-27 · repo last pushed 2017-03-30

PHPAudience · developerComplexity · 2/5DormantSetup · moderate

TL;DR

A PHP client library that lets PHP apps read and write configuration values stored in etcd, a shared settings system used across multiple servers.

Mindmap

mindmap
  root((repo))
    What it does
      Store key-value pairs
      Watch for changes
      Temporary values with expiry
    Use cases
      Centralize config across servers
      Database connection sharing
      Short-lived feature flags
    Tech stack
      PHP
      etcd
    Audience
      PHP developers
      DevOps teams
    Extras
      Command-line tool
      Shell scripting support

Code map

Detail Auto

An interactive map of this repo's files and how they connect — its source is parsed live in your browser. Click Visualize to build it.

filefunction / class

Why would anyone build with this?

REASON 1

Centralize configuration across multiple PHP servers so updating a setting in one place propagates everywhere.

REASON 2

Store temporary feature flags or locks that automatically expire after a set number of seconds.

REASON 3

Watch for configuration changes and have your PHP app react automatically without polling or restarting.

REASON 4

Manage etcd keys from the terminal using the bundled command-line tool for quick checks and scripting.

What's in the stack?

PHPetcd

How it stacks up

binwiederhier/etcd-phpanikchand461/anyonehereargosback/aura.sqlquery
Stars0
LanguagePHPPHPPHP
Last pushed2017-03-302023-05-28
MaintenanceDormantDormant
Setup difficultymoderateeasyeasy
Complexity2/52/52/5
Audiencedeveloperdeveloperdeveloper

Figures from each repo's GitHub metadata at analysis time.

How do you spin it up?

Difficulty · moderate Time to first run · 30min

Requires a running etcd server instance that the PHP library can connect to.

No license information was provided in the README, so usage rights are unclear.

Wtf does this do

etcd-php lets PHP applications talk to etcd, a distributed configuration system that stores settings and shares them across multiple servers. Think of etcd as a shared, centrally-managed notebook where all the servers in a project can look up configuration values, and this library is the PHP client that reads from and writes to that notebook. You use it to store key-value pairs, like putting the string "fooValue" at the key "/foo", and later retrieve that value by asking for "/foo." You can set values with an optional expiration timer, update existing keys, delete keys, and organize keys into directories. It also supports a "watch" feature that lets your application listen for changes on a key, so when someone updates a setting, your app reacts automatically without needing to poll or restart. A team running a PHP application across several servers would use this to centralize configuration. For example, if you have five web servers that all need to know the current database connection string, you store it once in etcd and each server reads it through this library. When the database moves, you update the single value in etcd, and every server picks up the new setting. You can also set temporary values that disappear after a set number of seconds, which is useful for locking or short-lived feature flags. The project also ships with a command-line tool, so you can manage keys from a terminal without writing PHP. The same operations, setting, getting, deleting, listing directories, and watching for changes, are available as shell commands, making it practical for scripting and quick checks. The README doesn't go into detail about error handling, security, or connection management. The code examples cover the core CRUD operations clearly, but anyone integrating this would likely need to look at the source for specifics on timeouts and failure behavior.

Yoink these prompts

Prompt 1
Write a PHP script using etcd-php that stores a database connection string at the key /db/config and then retrieves it, printing the value to the screen.
Prompt 2
Using the etcd-php library, set up a watch on the key /feature/new-ui so my PHP application prints a message whenever that key's value changes, without restarting the app.
Prompt 3
Create a shell script using the etcd-php command-line tool that sets a temporary key /lock/job1 with a 30-second expiration, then lists all keys under the /lock directory.
Prompt 4
Build a PHP configuration class that uses etcd-php to read settings from etcd on startup and watches for live updates, reloading values when they change.
Prompt 5
Write a PHP script that uses etcd-php to create a directory structure /app/prod and /app/staging, then store and retrieve config values under each directory.

Frequently asked questions

wtf is etcd-php?

A PHP client library that lets PHP apps read and write configuration values stored in etcd, a shared settings system used across multiple servers.

What language is etcd-php written in?

Mainly PHP. The stack also includes PHP, etcd.

Is etcd-php actively maintained?

Dormant — no commits in 2+ years (last push 2017-03-30).

What license does etcd-php use?

No license information was provided in the README, so usage rights are unclear.

How hard is etcd-php to set up?

Setup difficulty is rated moderate, with roughly 30min to a first successful run.

Who is etcd-php for?

Mainly developer.

View the repo → Decode another repo

This repo across BitVibe Labs

Don't trust strangers blindly. Verify against the repo.