{"id":15296332,"url":"https://github.com/schema31/php-couchdb-watcher","last_synced_at":"2026-02-15T15:03:46.824Z","repository":{"id":62541062,"uuid":"259286029","full_name":"Schema31/php-couchdb-watcher","owner":"Schema31","description":"A simple PHP watcher to attach callbacks to CouchDB documents changes.","archived":false,"fork":false,"pushed_at":"2020-04-28T12:48:37.000Z","size":6,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-10-04T00:57:42.251Z","etag":null,"topics":["couchdb","php7"],"latest_commit_sha":null,"homepage":"","language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Schema31.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2020-04-27T10:53:18.000Z","updated_at":"2023-01-28T02:00:30.000Z","dependencies_parsed_at":"2022-11-02T15:32:46.540Z","dependency_job_id":null,"html_url":"https://github.com/Schema31/php-couchdb-watcher","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/Schema31/php-couchdb-watcher","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Schema31%2Fphp-couchdb-watcher","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Schema31%2Fphp-couchdb-watcher/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Schema31%2Fphp-couchdb-watcher/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Schema31%2Fphp-couchdb-watcher/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Schema31","download_url":"https://codeload.github.com/Schema31/php-couchdb-watcher/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Schema31%2Fphp-couchdb-watcher/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29481924,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-15T11:35:25.641Z","status":"ssl_error","status_checked_at":"2026-02-15T11:34:57.128Z","response_time":118,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"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":["couchdb","php7"],"created_at":"2024-09-30T18:10:08.176Z","updated_at":"2026-02-15T15:03:46.807Z","avatar_url":"https://github.com/Schema31.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"# php-couchdb-watcher\n\nThis package provides a simple watcher to attach callbacks to CouchDB documents changes.\n\n### Installation\n\nThe recommended installation method is by using [composer](https://getcomposer.org/)\n\n    composer require schema31/php-couchdb-watcher\n\n### Usage\n\nThree steps are required in order to use the watcher.\n\nCreate it passing a key to save last change processed, CouchDB url and options.\n\n```php\n\u003c?php\n\nuse Schema31\\CouchDBWatcher\\Watcher;\n\n$options = [\n  'since' =\u003e 'now',  // taken into account only if store is empty, default is '0'\n  'store' =\u003e new Schema31\\CouchDBWatcher\\Store\\FileStore() // FileStore is the default one. You can provide your own object, that implements the  StoreInterface\n];\n\n$watcher = new Watcher('main_db', 'https://couch.com/db', $options);\n```\n\nThen attach all the callbacks you want.\n\n```php\n\u003c?php\n\n$watcher-\u003eaddCallback(function($change) {\n   echo $change-\u003eid.PHP_EOL;\n});\n```\nAnd just run it.\n\n```php\n\u003c?php\n\n$watcher-\u003erun();\n\n```\n\n### Error handling\n\nIf any of the defined callbacks produces an error program will exit, so you can fix it and then launch again.\nThe last change processed is saved in the store only if all the callbacks are executed without errors.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fschema31%2Fphp-couchdb-watcher","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fschema31%2Fphp-couchdb-watcher","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fschema31%2Fphp-couchdb-watcher/lists"}