{"id":24016340,"url":"https://github.com/decodelabs/deliverance","last_synced_at":"2025-04-15T14:07:31.344Z","repository":{"id":56964537,"uuid":"356274634","full_name":"decodelabs/deliverance","owner":"decodelabs","description":"Shared data transfer interfaces for PHP","archived":false,"fork":false,"pushed_at":"2025-04-14T08:44:33.000Z","size":104,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"develop","last_synced_at":"2025-04-14T09:44:59.781Z","etag":null,"topics":["data-transfer","input-output","multiplex","php"],"latest_commit_sha":null,"homepage":"","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/decodelabs.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","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,"zenodo":null}},"created_at":"2021-04-09T13:08:13.000Z","updated_at":"2025-04-14T08:44:36.000Z","dependencies_parsed_at":"2023-01-31T19:25:12.812Z","dependency_job_id":"8ffe7bcd-5fe7-43e5-b8cb-ed4cacd71dac","html_url":"https://github.com/decodelabs/deliverance","commit_stats":{"total_commits":51,"total_committers":1,"mean_commits":51.0,"dds":0.0,"last_synced_commit":"9091f6c78edcc2700e79b3041dd4a22f734be52c"},"previous_names":[],"tags_count":19,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/decodelabs%2Fdeliverance","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/decodelabs%2Fdeliverance/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/decodelabs%2Fdeliverance/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/decodelabs%2Fdeliverance/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/decodelabs","download_url":"https://codeload.github.com/decodelabs/deliverance/tar.gz/refs/heads/develop","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248859905,"owners_count":21173339,"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":["data-transfer","input-output","multiplex","php"],"created_at":"2025-01-08T08:48:58.910Z","updated_at":"2025-04-15T14:07:31.336Z","avatar_url":"https://github.com/decodelabs.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Deliverance\n\n[![PHP from Packagist](https://img.shields.io/packagist/php-v/decodelabs/deliverance?style=flat)](https://packagist.org/packages/decodelabs/deliverance)\n[![Latest Version](https://img.shields.io/packagist/v/decodelabs/deliverance.svg?style=flat)](https://packagist.org/packages/decodelabs/deliverance)\n[![Total Downloads](https://img.shields.io/packagist/dt/decodelabs/deliverance.svg?style=flat)](https://packagist.org/packages/decodelabs/deliverance)\n[![GitHub Workflow Status](https://img.shields.io/github/actions/workflow/status/decodelabs/deliverance/integrate.yml?branch=develop)](https://github.com/decodelabs/deliverance/actions/workflows/integrate.yml)\n[![PHPStan](https://img.shields.io/badge/PHPStan-enabled-44CC11.svg?longCache=true\u0026style=flat)](https://github.com/phpstan/phpstan)\n[![License](https://img.shields.io/packagist/l/decodelabs/deliverance?style=flat)](https://packagist.org/packages/decodelabs/deliverance)\n\n### Shared data transfer interfaces for PHP\n\nDeliverance is a middleware library intended to be used by other framework systems that need to manage multiplex IO operations.\n\n---\n\n## Installation\n\nInstall via Composer:\n\n```bash\ncomposer require decodelabs/deliverance\n```\n\n## Usage\n\n### Channels\n\nChannels represent simple in / out handlers and can be written to and read from:\n\n```php\nuse DecodeLabs\\Deliverance;\n\n$stream = Deliverance::openStream('path/to/file');\n$stream-\u003ewriteLine('Hello world');\n\n$stream = Deliverance::openCliOutputStream(); // Same as new Deliverance\\Channel\\Stream(STDOUT);\n\n$buffer = Deliverance::newBuffer();\n$buffer-\u003ewrite('Some text to buffer');\necho $buffer-\u003eread(6); // \"Some t\"\n```\n\n\n### IO Broker\n\nChannels can be grouped together and managed by an \u003ccode\u003eIO Broker\u003c/code\u003e -\n\n```php\nuse DecodeLabs\\Deliverance;\n\n// Create a CLI IO handler\n$broker = Deliverance::newBroker()\n    -\u003eaddInputProvider(Deliverance::openStream(STDIN))\n    -\u003eaddOutputReceiver(Deliverance::openStream(STDOUT))\n    -\u003eaddErrorReceiver(Deliverance::openStream(STDERR));\n\n// Shortcut to the above:\n$broker = Deliverance::newCliBroker();\n\n\n// Read line from CLI\n$broker-\u003esetReadBlocking(true);\n$text = $broker-\u003ereadLine();\n\n// Write it back to output\n$broker-\u003ewriteLine('INPUT: '.$text);\n```\n\nOnce grouped, the Channels in an IO broker can be used as the interface between many different information sources; see [Systemic Unix process launcher](https://github.com/decodelabs/systemic/blob/develop/src/Systemic/Process/Launcher/Unix.php) for an example of an IO Broker managing input and output with \u003ccode\u003eproc_open()\u003c/code\u003e.\n\n\n## Licensing\nDeliverance is licensed under the MIT License. See [LICENSE](./LICENSE) for the full license text.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdecodelabs%2Fdeliverance","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdecodelabs%2Fdeliverance","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdecodelabs%2Fdeliverance/lists"}