php-JsonRPCJson-RPC 的 PHP 扩展
JsonRPC 2.0 Client and Server
=============================
轻量级 Json-RPC 2.0 客户端和服务端的php扩展,基于 multi_curl + epoll的并发客户端,依据[jsonrpc](http://www.jsonrpc.org/)协议规范。
服务端:
$server = new Jsonrpc_Server(); // style one function variable $add1 = function($a, $b){ return $a + $b; }; $server->register('addition1', $add1); // style two function string function add2($a, $b){ return $a + $b; } $server->register('addition2', 'add2'); // style three function closure $server->register('addition3', function ($a, $b) { return $a + $b; }); //style four class method string class A { static public function add($a, $b) { return $a + $b; } } $server->register('addition4', 'A::add'); echo $server->execute(); //output >>> //{"jsonrpc":"2.0","id":null,"error":{"code":-32700,"message":"Parse error"}}
客户端:
$client = new Jsonrpc_Client(1); $client->call('http://localhost/server.php', 'addition1', array(3,5)); $client->call('http://localhost/server.php', 'addition2', array(10,20)); $client->call('http://localhost/server.php', 'addition3', array(2,8)); $client->call('http://localhost/server.php', 'addition4', array(6,15)); /* ... */ $result = $client->execute(); var_dump($result); //output >>> /* array(2) { [0]=> array(3) { ["jsonrpc"]=> string(3) "2.0" ["id"]=> int(110507766) ["result"]=> int(8) } [1]=> array(3) { ["jsonrpc"]=> string(3) "2.0" ["id"]=> int(1559316299) ["result"]=> int(30) } ... } */
评论
php-JsonRPCJson-RPC 的 PHP 扩展
JsonRPC2.0ClientandServer=============================轻量级Json-RPC2.0客户端和服务端的php扩展,基于multi_curl+epoll
php-JsonRPCJson-RPC 的 PHP 扩展
0
opencc4phpOpenCC 的 PHP 扩展
opencc4php 是OpenCC的PHP扩展,能很智能的完成简繁体转换。支持 PHP 版本: 5
opencc4phpOpenCC 的 PHP 扩展
0
Jsonnet-PHPJsonnet 的 PHP 扩展
JsonNet-PHP是GoogleJsonnet 对 PHP的支持扩展.pecl: http://pecl.php.net/package/jsonnetgithub: https://github
Jsonnet-PHPJsonnet 的 PHP 扩展
0
openccppOpenCC 的 PHP 扩展
openccpp是基于OpenCC开发的PHP扩展.opencc是一个汉字繁简体互转的开源c++库.它具有转换准确率高,速度快的特点.可说是当前汉字繁简体互转方面的佼佼者.依据opencc官方的简介,
openccppOpenCC 的 PHP 扩展
0
opencc4phpOpenCC 的 PHP 扩展
opencc4php是OpenCC的PHP扩展,能很智能的完成简繁体转换。支持PHP版本:5.3-7.1转换效果:你干什么不干我事=>你幹什麼不干我事地区词汇转换效果:我鼠标哪儿去了=>我
opencc4phpOpenCC 的 PHP 扩展
0
phdfsHDFS 的 PHP 扩展
Phdfs是hadoophdfs的php扩展。用于便捷的操作HDFS。<?php try{ $obj=newphdfs(“127.0.0.1“,”9000“); $obj->
phdfsHDFS 的 PHP 扩展
0