{"id":16119973,"url":"https://github.com/uuf6429/dnode-php-sync-client","last_synced_at":"2025-04-06T10:29:54.668Z","repository":{"id":57076270,"uuid":"88193893","full_name":"uuf6429/dnode-php-sync-client","owner":"uuf6429","description":"Minimalistic dnode client for PHP","archived":false,"fork":false,"pushed_at":"2018-01-27T17:19:12.000Z","size":25,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-04-03T11:57:31.093Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"PHP","has_issues":false,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/uuf6429.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.txt","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2017-04-13T18:19:07.000Z","updated_at":"2017-04-13T18:19:09.000Z","dependencies_parsed_at":"2022-08-24T14:55:50.221Z","dependency_job_id":null,"html_url":"https://github.com/uuf6429/dnode-php-sync-client","commit_stats":null,"previous_names":[],"tags_count":6,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/uuf6429%2Fdnode-php-sync-client","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/uuf6429%2Fdnode-php-sync-client/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/uuf6429%2Fdnode-php-sync-client/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/uuf6429%2Fdnode-php-sync-client/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/uuf6429","download_url":"https://codeload.github.com/uuf6429/dnode-php-sync-client/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247469130,"owners_count":20943926,"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-10-09T20:55:42.926Z","updated_at":"2025-04-06T10:29:54.630Z","avatar_url":"https://github.com/uuf6429.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"# DNode PHP Sync Client\n\n[![Build Status (TravisCI)](https://img.shields.io/travis/uuf6429/dnode-php-sync-client/master.svg?style=flat-square)](https://travis-ci.org/uuf6429/dnode-php-sync-client)\n[![Minimum PHP Version](https://img.shields.io/badge/php-%3E%3D%205.6-8892BF.svg?style=flat-square)](https://php.net/)\n[![License](https://img.shields.io/badge/License-BSD%203--Clause-blue.svg?style=flat-square)](https://github.com/uuf6429/dnode-php-sync-client/blob/master/LICENSE.txt)\n[![Packagist](https://img.shields.io/packagist/v/uuf6429/dnode-php-sync-client.svg?style=flat-square)](https://packagist.org/packages/uuf6429/dnode-php-sync-client)\n\n\nMinimalistic [dnode](https://github.com/substack/dnode) client for PHP, supports only synchronous calling of methods on remote server.\n\n- It can call method on remote dnode server and it can receive response.\n- It does not support any other callbacks.\n- It does not support full [dnode-protocol](https://github.com/substack/dnode-protocol) - response from remote server must not contain any callbacks or links section.\n\nLook at [dnode-php](https://github.com/bergie/dnode-php) for a more complex support of dnode protocol.\n\n\n## Table Of Contents\n\n- [DNode PHP Sync Client](#dnode-php-sync-client)\n  - [Table Of Contents](#table-of-contents)\n  - [Installation](#installation)\n  - [Usage](#usage)\n  - [Run tests](#run-tests)\n\n\n## Installation\n\nThe recommended and easiest way to install Rune is through [Composer](https://getcomposer.org/):\n\n```bash\ncomposer require uuf6429/dnode-php-sync-client \"~2.0\"\n```\n\n\n## Usage\n\nLet's first start with a simple node.js server exposing `echo` method over dnode:\n\n```javascript\nvar dnode = require('dnode');\nvar port = process.argv[2] || 8080;\n\ndnode({\n  echo: function (data, callback) {\n    callback(null, data);\n  }\n}).listen(port);\n```\n\nNow, we can call this echo method from PHP like this:\n\n```php\n\u003c?php\n\nrequire_once 'vendor/autoload.php';\n\n$dnode = new \\uuf6429\\DnodeSyncClient\\Dnode();\n$connection = $dnode-\u003econnect('localhost', 8080);\n$response = $connection-\u003ecall('echo', ['Hello, world!']);\n\nvar_dump($response);\n```\n\nResult:\n\n```php\narray(2) {\n  [0] =\u003e\n  NULL\n  [1] =\u003e\n  string(13) \"Hello, world!\"\n}\n```\n\n\n## Run tests\n\nTo run all tests, just run `./vendor/bin/phpunit` from the main directory.\n\n_Note:_ `tests/DnodeTest.php` is an integration test which needs dnode echo server running. Sources for this test server are in `tests/node` directory.\n\nThe test suite will automatically install npm dependencies and start the echo service on port 8080 when necessary.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fuuf6429%2Fdnode-php-sync-client","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fuuf6429%2Fdnode-php-sync-client","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fuuf6429%2Fdnode-php-sync-client/lists"}