processus / jsonrpcpipe
json rpc pipe
Requires
- php: >=5.3.3
- symfony/class-loader: 2.1.*
This package is not auto-updated.
Last update: 2024-09-22 03:08:48 UTC
README
又一例 json-rpc
示例:ZMQ 服务器(任务)
cd src/example-teststack/bin php runtask.php Zmq.TestStackClient
示例:ZMQ 客户端(任务)
cd src/example-teststack/bin php runtask.php Zmq.TestStackClient
示例:API 请求
// 文件:example-teststack/htdocs/api/v1/index.php
$mockEnabled = true; $mockRequest = array( 'method' => 'TestStack.Test.ping', 'params' => array(), );
use Api\V1\TestStack\Modules\GatewayModule;
$gtw = new \Api\V1\TestStack\Modules\GatewayModule(); $gtw->init(); $gtw->setIsAutoFetchRequestTextEnabled(true); $gtw->setIsAutoEmitResponseEnabled(true); $gtw->setIsDebugEnabled(true); if($mockEnabled) { $gtw->setIsAutoFetchRequestTextEnabled(false); // 不从 php://input 获取 $gtw->setRawRequestData($mockRequest); // 使用该模拟数据代替 } $gtw->run();