node.php,dnode-php

这个项目实现了DNode远程过程调用协议的PHP版本,使得PHP脚本可以作为分布式Node.js云的一部分。它允许Node.js调用PHP代码,反之亦然。通过Composer进行安装,并提供了与DNode原生示例兼容的PHP示例。

DNode protocol for PHP

This project implements the DNode remote procedure call protocol for PHP. The intent is to enable PHP scripts to act as part of a distributed Node.js cloud, allowing Node to call PHP code, and PHP to call Node code.

You can read more about DNode and PHP in the introductory blog post.

21cb47d7b8b6f7b96f99d072cfe85971.png

Installing

dnode-php can be installed using the Composer tool. You can either add dnode/dnode to your package dependencies, or if you want to install dnode-php as standalone, go to the main directory of this package and run:

$ wget http://getcomposer.org/composer.phar

$ php composer.phar install

You can then use the composer-generated autoloader to access the DNode classes:

require 'vendor/autoload.php';

Running the examples

After installing, you can run the DNode examples located in the examples directory. Each example contains both a client and a server.

For example:

$ php examples/simple/server.php

$ php examples/simple/client.php

n = 3300

The examples have been written to be compatible with the DNode examples, meaning that you can use any combination of PHP-to-PHP, Node-to-Node, PHP-to-Node, or Node-to-PHP as you wish.

$ node simple/client.js

n = 3300

Current limitations

Only regular, non-encrypted TCP sockets are supported

Development

dnode-php is under heavy development. If you want to participate, please send pull requests.

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值