zyzo/meteor-ddp-php 问题修复 & 功能扩展

解决BUG、新增功能、兼容多环境部署,快速响应你的开发需求

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

zyzo/meteor-ddp-php

最新稳定版本:1.2.0

Composer 安装命令:

composer require zyzo/meteor-ddp-php

包简介

DDP client for PHP

README 文档

README

A minimalist PHP library that implements DDP client, the realtime protocol for Meteor framework.

Join the chat at https://gitter.im/zyzo/meteor-ddp-php

How to use

Suppose you have declared a remote function foo in your meteor server code :

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 :

use zyzo\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();

===>

Result = 42

More use cases can be found in the examples folder.

How to install

This library is available via composer, the dependency manager for PHP. Please add this in your composer.json :

"require" : {
    "zyzo/meteor-ddp-php": "1.2.0"
}

and update composer to automatically retrieve the package :

php composer.phar update

Run tests

cd tests
// install composer.phar in this folder
php composer.phar update
php [filename].php

统计信息

  • 总下载量: 754
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 48
  • 点击次数: 1
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 47
  • Watchers: 5
  • Forks: 7
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2015-03-28