dev-master
9999999-devyii2 extension for thrift
BSD-3-Clause
The Requires
by tengpao
extension yii2 thrift
yii2 extension for thrift
yii2 extension for thrift, (*1)
The preferred way to install this extension is through composer , Either run, (*2)
composer require --prefer-dist tengpao/yii2-thrift "*"
or add, (*3)
"tengpao/yii2-thrift": "*"
to the require section of your composer.json
file., (*4)
在配置文件中components中增加配置:, (*5)
'thrift' => [ 'class' => 'tengpao\thrift\ThriftClient' 'idService' => [ 'defineName' => 'shared', 'clientName' => '\tutorial\CalculatorClient' ], ]
调用:, (*6)
\Yii::$app->thrift->idService->method();
如果不想在配置文件中全局配置,可以使用, (*7)
$thrift = \Yii::createObject([ 'class' => 'tengpao\thrift\ThriftClient' 'idService' => [ 'defineName' => 'shared', 'clientName' => '\tutorial\CalculatorClient' ], ]); $thrift->idService->method();
注,如果不是通过composer安装的需要添加相关别名指向, (*8)
QQ交流群: 325914002, (*9)
yii2 extension for thrift
BSD-3-Clause
extension yii2 thrift