{"id":27158890,"url":"https://github.com/activecollab/etcd","last_synced_at":"2025-10-08T22:10:24.949Z","repository":{"id":56940230,"uuid":"48127592","full_name":"activecollab/etcd","owner":"activecollab","description":"PHP client for etcd, a distributed configuration system","archived":false,"fork":false,"pushed_at":"2020-09-10T13:29:56.000Z","size":35,"stargazers_count":14,"open_issues_count":8,"forks_count":6,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-03-30T13:03:28.405Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"https://labs.activecollab.com","language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/activecollab.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2015-12-16T18:25:35.000Z","updated_at":"2025-01-10T00:19:30.000Z","dependencies_parsed_at":"2022-08-21T06:50:31.911Z","dependency_job_id":null,"html_url":"https://github.com/activecollab/etcd","commit_stats":null,"previous_names":[],"tags_count":5,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/activecollab%2Fetcd","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/activecollab%2Fetcd/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/activecollab%2Fetcd/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/activecollab%2Fetcd/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/activecollab","download_url":"https://codeload.github.com/activecollab/etcd/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247941718,"owners_count":21022035,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2025-04-08T22:39:18.973Z","updated_at":"2025-10-08T22:10:19.892Z","avatar_url":"https://github.com/activecollab.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Etcd PHP Client\n\n[![Build Status](https://travis-ci.org/activecollab/etcd.svg?branch=master)](https://travis-ci.org/activecollab/etcd)\n\netcd is a distributed configuration system, part of the coreos project.\n\nThis 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).\n\n## Installating etcd\n\nTo install etcd, follow instructions that etcd team posts on Releases page of the project:\n\n[https://github.com/coreos/etcd/releases/](https://github.com/coreos/etcd/releases/)\n\n## Installing ActiveCollab/etcd\n\nEasiest way is to install it using composer:\n\n```json\n{\n    \"require\" : {\n        \"activecollab/etcd\": \"^1.0\"\n    }\n}\n```\n\n## Using Client\n\n```php\nuse use ActiveCollab\\Etcd\\Client as EtcdClient;\n\n$client = new EtcdClient('http://127.0.0.1:4001');\n\n// Get, set, update, remove key\nif (!$client-\u003eexists('/key/name')) {\n    $client-\u003eset('/key/name', 'value');\n}\n$client-\u003eset('/key/name', 'value', 10); // Set TTL\nprint $client-\u003eget('/key/name');\n\n$client-\u003eupdate('/key/name', 'new value');\n\n$client-\u003eremove('/key/name');\n\n// Working with dirs\nif (!$client-\u003edirExists('/dir/path')) {\n    $client-\u003ecreateDir('/dir/path');\n}\n$client-\u003eupdateDir('/dir/path', 10); // Set TTL\n$client-\u003eremoveDir('/dir/path');\n\n// Get dir info\n$client-\u003edirInfo('/dir/path');\n\n// List subdirectories\n$client-\u003elistDirs('/dir/path');\n\n// Return key value map for a given dir\n$client-\u003egetKeyValueMap('/dir/path')\n```\n\n## Sandbox Path\n\nIf you configure sandbox path in the client instance, all keys will be prefixed with that path:\n\n```php\n$client = new EtcdClient('http://127.0.0.1:4001');\n$client-\u003esetSandboxPath('/my/namespace');\n\n$client-\u003eset('/key/name', 'value'); // will set /my/namespace/key/name\nprint $client-\u003eget('/key/name'); // will print /my/namespace/key/name\n```\n\nOne 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:\n\n```php\n$client = new EtcdClient('http://127.0.0.1:4001');\n$client-\u003esetSandboxPath('/my/namespace');\n\n// Path relative to the current sandbox path\n$client-\u003esandboxed('./different/namespace', function(EtcdClient \u0026$c) {\n    $c-\u003eset('new_key', 123); // Sets /my/namespace/different/namespace/new_key\n});\n\n// Absolute path\n$client-\u003esandboxed('/different/namespace', function(EtcdClient \u0026$c) {\n    $c-\u003eset('new_key', 123); // Sets /different/namespace/new_key\n});\n\nprint $client-\u003egetSandboxPath(); // Prints '/my/namespace'\n```\n\n## SSL\n\nClient can be configured not to verify SSL peer:\n\n```php\n$client = (new Client('https://127.0.0.1:4001'))-\u003everifySslPeer(false);\n```\n\nas well as to use a custom CA file:\n\n```php\n$client = (new Client('https://127.0.0.1:4001'))-\u003everifySslPeer(true, '/path/to/ca/file');\n```\n\n## Why Fork?\n\nWhile [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.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Factivecollab%2Fetcd","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Factivecollab%2Fetcd","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Factivecollab%2Fetcd/lists"}