dev-refactor
dev-refactor https://github.com/synchrotalk/meteor-ddp-phpDDP client for PHP
MIT Licence
The Requires
The Development Requires
- synchrotalk/websocket dev-master
by synchrotalk
php meteor ddp ddpclient
DDP client for PHP
A minimalist PHP library that implements DDP client, the realtime protocol for Meteor framework., (*1)
Suppose you have declared a remote function foo
in your meteor server code :, (*3)
Meteor.methods({ foo : function (arg) { check(arg, Number); if (arg == 1) { return 42; } return "You suck"; } });
Then in your php client's code, you could just invoke foo
by executing :, (*4)
use synchrotalk\MeteorDDP\DDPClient; $client = new DDPClient('localhost', 3000); $client->connect(); $client->call("foo", array(1)); while(($a = $client->getResult("foo")) === null) {}; echo 'Result = ' . $a . PHP_EOL; $client->stop();
===>, (*5)
Result = 42
More use cases can be found in the examples folder., (*6)
This library is available via composer, the dependency manager for PHP. Please add this in your composer.json :, (*7)
"require" : { "synchrotalk/meteor-ddp-php": "0.1.0" }
and update composer to automatically retrieve the package :, (*8)
php composer.phar update
None, (*9)
0.1.0, (*10)
DDP client for PHP
MIT Licence
php meteor ddp ddpclient