PHPackages                             uuf6429/dnode-php-sync-client - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Utility &amp; Helpers](/categories/utility)
4. /
5. uuf6429/dnode-php-sync-client

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

uuf6429/dnode-php-sync-client
=============================

Minimalistic dnode client for PHP

2.1.0(8y ago)01.0k1BSD-3-ClausePHPPHP &gt;=5.6

Since Oct 16Pushed 8y ago1 watchersCompare

[ Source](https://github.com/uuf6429/dnode-php-sync-client)[ Packagist](https://packagist.org/packages/uuf6429/dnode-php-sync-client)[ Docs](https://github.com/uuf6429/dnode-php-sync-client)[ RSS](/packages/uuf6429-dnode-php-sync-client/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (3)Dependencies (2)Versions (6)Used By (1)

DNode PHP Sync Client
=====================

[](#dnode-php-sync-client)

[![Build Status (TravisCI)](https://camo.githubusercontent.com/2f7fc46d8cd198721242614b52e887313063e78150052b378e065ae003a3a345/68747470733a2f2f696d672e736869656c64732e696f2f7472617669732f757566363432392f646e6f64652d7068702d73796e632d636c69656e742f6d61737465722e7376673f7374796c653d666c61742d737175617265)](https://travis-ci.org/uuf6429/dnode-php-sync-client)[![Minimum PHP Version](https://camo.githubusercontent.com/86e7d829a466cacd5658a22073e27d49d39dac72cc18216ac4963ed5463c5bbc/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f7068702d253345253344253230352e362d3838393242462e7376673f7374796c653d666c61742d737175617265)](https://php.net/)[![License](https://camo.githubusercontent.com/94752c28db62ab6bf361e8ea48315b03bab6a1f0b2b67d789ac51b36c3e908fd/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f4c6963656e73652d425344253230332d2d436c617573652d626c75652e7376673f7374796c653d666c61742d737175617265)](https://github.com/uuf6429/dnode-php-sync-client/blob/master/LICENSE.txt)[![Packagist](https://camo.githubusercontent.com/6b63cf365c57ffada7f83594f998203877cf211ad0a4f85e22d4a42ec9f07286/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f757566363432392f646e6f64652d7068702d73796e632d636c69656e742e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/uuf6429/dnode-php-sync-client)

Minimalistic [dnode](https://github.com/substack/dnode) client for PHP, supports only synchronous calling of methods on remote server.

- It can call method on remote dnode server and it can receive response.
- It does not support any other callbacks.
- 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.

Look at [dnode-php](https://github.com/bergie/dnode-php) for a more complex support of dnode protocol.

Table Of Contents
-----------------

[](#table-of-contents)

- [DNode PHP Sync Client](#dnode-php-sync-client)
    - [Table Of Contents](#table-of-contents)
    - [Installation](#installation)
    - [Usage](#usage)
    - [Run tests](#run-tests)

Installation
------------

[](#installation)

The recommended and easiest way to install Rune is through [Composer](https://getcomposer.org/):

```
composer require uuf6429/dnode-php-sync-client "~2.0"
```

Usage
-----

[](#usage)

Let's first start with a simple node.js server exposing `echo` method over dnode:

```
var dnode = require('dnode');
var port = process.argv[2] || 8080;

dnode({
  echo: function (data, callback) {
    callback(null, data);
  }
}).listen(port);
```

Now, we can call this echo method from PHP like this:

```
