{"id":19326037,"url":"https://github.com/linkorb/etcd-php","last_synced_at":"2025-10-09T15:50:56.312Z","repository":{"id":13745417,"uuid":"16439833","full_name":"linkorb/etcd-php","owner":"linkorb","description":"Etcd client library for PHP","archived":false,"fork":false,"pushed_at":"2023-11-07T16:12:42.000Z","size":63,"stargazers_count":235,"open_issues_count":4,"forks_count":43,"subscribers_count":19,"default_branch":"master","last_synced_at":"2025-04-03T19:15:49.724Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"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/linkorb.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2014-02-01T18:32:25.000Z","updated_at":"2024-12-15T08:45:27.000Z","dependencies_parsed_at":"2024-06-18T13:45:55.875Z","dependency_job_id":"1302839e-1536-421f-a64c-0807a375084f","html_url":"https://github.com/linkorb/etcd-php","commit_stats":{"total_commits":51,"total_committers":12,"mean_commits":4.25,"dds":0.5294117647058824,"last_synced_commit":"f6567efec575d7f0b52de2c7d15b5687a4d90b51"},"previous_names":[],"tags_count":9,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/linkorb%2Fetcd-php","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/linkorb%2Fetcd-php/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/linkorb%2Fetcd-php/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/linkorb%2Fetcd-php/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/linkorb","download_url":"https://codeload.github.com/linkorb/etcd-php/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248608835,"owners_count":21132792,"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":"2024-11-10T02:12:16.683Z","updated_at":"2025-10-09T15:50:51.271Z","avatar_url":"https://github.com/linkorb.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"[![Build Status](https://travis-ci.org/linkorb/etcd-php.png?branch=master)](https://travis-ci.org/linkorb/etcd-php)\n[![Latest Stable Version](https://poser.pugx.org/linkorb/etcd-php/v/stable.png)](https://packagist.org/packages/linkorb/etcd-php)\n[![Total Downloads](https://poser.pugx.org/linkorb/etcd-php/downloads.png)](https://packagist.org/packages/linkorb/etcd-php)\n[![Latest Unstable Version](https://poser.pugx.org/linkorb/etcd-php/v/unstable.png)](https://packagist.org/packages/linkorb/etcd-php) \n[![License](https://poser.pugx.org/linkorb/etcd-php/license.png)](https://packagist.org/packages/linkorb/etcd-php)\n\n# Etcd client library for PHP\n\netcd is a distributed configuration system, part of the coreos project.\n\nThis repository provides a client library for etcd for PHP applications.\n\n## Installing and running etcd\n\n```bash\ngit clone https://github.com/coreos/etcd.git\ncd etcd\n./build\n./bin/etcd\n````\n\n## Brought to you by the LinkORB Engineering team\n\nCheck out our other projects at [linkorb.com/engineering](http://www.linkorb.com/engineering).\n\nBtw, we're hiring!\n\n## Installation\n```shell\ncomposer require linkorb/etcd-php\n```\n\n## Usage\n\n### The client\n\n### Instantiate the client\n\n```php\n$client = new Client($server);\n```\n\n### Instantiate the client with custom Guzzle Client\n\n```php\n$client = Client::constructWithGuzzleClient($guzzleClient, $server);\n```\n\n### Use the client instance\n```php\n$client-\u003eset('/foo', 'fooValue');\n// Set the ttl\n$client-\u003eset('/foo', 'fooValue', 10);\n// get key value\necho $client-\u003eget('/foo');\n\n// Update value with key\n$client-\u003eupdate('/foo', 'newFooValue');\n\n// Delete key\n$client-\u003erm('/foo');\n\n// Create a directory\n$client-\u003emkdir('/fooDir');\n// Remove dir\n$client-\u003ermdir('/fooDir');    \n```\n\n### The command line tool\n\n#### Setting Key Values\n\nSet a value on the `/foo/bar` key:\n\n```bash\n$ bin/etcd-php etcd:set /foo/bar \"Hello world\"\n```\n\nSet a value on the `/foo/bar` key with a value that expires in 60 seconds:\n\n```bash\n$ bin/etcd-php etcd:set /foo/bar \"Hello world\" --ttl=60\n```\n\nCreate a new key `/foo/bar`, only if the key did not previously exist:\n\n```bash\n$ bin/etcd-php etcd:mk /foo/new_bar \"Hello world\"\n```\n\nCreate a new dir `/fooDir`, only if the key did not previously exist:\n\n```bash\n$ bin/etcd-php etcd:mkdir /fooDir\n```\n\nUpdate an existing key `/foo/bar`, only if the key already existed:\n\n```bash\n$ bin/etcd-php etcd:update /foo/bar \"Hola mundo\"\n```\n\nCreate or update a directory called `/mydir`:\n\n```bash\n$ bin/etcd-php etcd:setDir /mydir\n```\n\n\n#### Retrieving a key value\n\nGet the current value for a single key in the local etcd node:\n\n```bash\n$ bin/etcd-php etcd:get /foo/bar\n```\n\n#### Listing a directory\n\nExplore the keyspace using the `ls` command\n\n```bash\n$ bin/etcd-php etcd:ls\n/akey\n/adir\n$ bin/etcd-php etcd:ls /adir\n/adir/key1\n/adir/key2\n```\n\nAdd `-recursive` to recursively list subdirectories encountered.\n\n```bash\n$ bin/etcd-php etcd:ls --recursive\n/foo\n/foo/bar\n/foo/new_bar\n/fooDir\n```\n\n\n### Deleting a key\n\nDelete a key:\n\n```bash\n$ bin/etcd-php etcd:rm /foo/bar\n```\n\nDelete an empty directory or a key-value pair\n\n```bash\n$ bin/etcd-php etcd:rmdir /path/to/dir \n```\n\nRecursively delete a key and all child keys:\n\n```bash\n$ bin/etcd-php etcd:rmdir /path/to/dir --recursive\n```\n\n#### Export node\n\n```bash\n$ bin/etcd-php etcd:export --server=http://127.0.0.1:2379 --format=json --output=config.json /path/to/dir\n```\n\n#### Watching for changes\n\nWatch for only the next change on a key:\n\n```bash\n$ bin/etcd-php etcd:watch /foo/bar\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flinkorb%2Fetcd-php","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Flinkorb%2Fetcd-php","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flinkorb%2Fetcd-php/lists"}