AbleCloud PHP SDK
1.8.x
PHP SDK of AbleCloud API
|
Public 成员函数 | |
__construct ($developerId, $accessKey, $secretKey, $majorDomain, $runtimeMode, $routerAddress) | |
getDeveloper () | |
getMajorDomain () | |
getRouterAddress () | |
isProductionMode () | |
setHandset ($name, $version='', $id='', $osName='') | |
setClientAddress ($clientIP) | |
addExtHttpHeader ($header, $value) | |
getExtHttpHeaders () | |
getTraceId () | |
setTraceId ($traceId) | |
静态 Public 成员函数 | |
static | newTraceId () |
访问AbleCloud服务时的环境信息。
ACContext::__construct | ( | $developerId, | |
$accessKey, | |||
$secretKey, | |||
$majorDomain, | |||
$runtimeMode, | |||
$routerAddress | |||
) |
构造函数。
$developerId | int AbleCloud开发者帐号ID。 |
$accessKey | string 开发者的Access Key。 |
$secretKey | string 开发者的Secret Key。 |
$majorDomain | string 本地服务对应的主域的名字。 |
$runtimeMode | string 运行模式:test(测试模式),production(生产模式)。 |
$routerAddress | string AbleCloud远程服务的入口地址。 |
ACContext::addExtHttpHeader | ( | $header, | |
$value | |||
) |
为发给AbleCloud云端的HTTP请求配置自定义的HTTP Header。
$header | string 是要配置的HTTP Header的名字。 |
$value | string 是$header对应的值。 |
ACContext::getDeveloper | ( | ) |
取AbleCloud开发者信息。
ACContext::getExtHttpHeaders | ( | ) |
取自定义的HTTP Header信息。
ACContext::getMajorDomain | ( | ) |
取本地服务对应的主域的名字。
ACContext::getRouterAddress | ( | ) |
取AbleCloud远程服务的访问入口地址。
ACContext::getTraceId | ( | ) |
ACContext::isProductionMode | ( | ) |
检查是否配置为生产环境。
|
static |
ACContext::setClientAddress | ( | $clientIP | ) |
显示设置请求中携带的客户端的IP地址。
$clientIP | string IP地址。本方法不检查该参数的值的格式,需要调用者保证参数的有效性。 |
ACContext::setHandset | ( | $name, | |
$version = '' , |
|||
$id = '' , |
|||
$osName = '' |
|||
) |
设置用户控制设备时所使用的终端工具的信息。
$name | string 是终端工具所使用的应用的名字,如'weixin'(表示微信终端)等。 |
$version | string 是终端工具所使用的应用的版本信息。缺省值为空字符串。 |
$id | string 是终端工具的ID,用于标识该工具。缺省值为空字符串。 |
$osName | string 是终端工具所使用的操作系统的名字,如android,ios等。 |
ACContext::setTraceId | ( | $traceId | ) |
设置Trace-Id。
$traceId | string 是符合RFC 4122 - Section 4.4规范的UUID的十六进制表示形式,用来作为请求的Trace-Id。 |