diff --git a/extend/aliyun-php-sdk-afs/ChangeLog.txt b/extend/aliyun-php-sdk-afs/ChangeLog.txt new file mode 100644 index 0000000..776a541 --- /dev/null +++ b/extend/aliyun-php-sdk-afs/ChangeLog.txt @@ -0,0 +1,3 @@ +2018-02-02 Version: 1.0.0 +1, this version is new of captcha management and nvc analyze + diff --git a/extend/aliyun-php-sdk-afs/afs/Request/V20180112/AnalyzeNvcRequest.php b/extend/aliyun-php-sdk-afs/afs/Request/V20180112/AnalyzeNvcRequest.php new file mode 100644 index 0000000..1b77d7c --- /dev/null +++ b/extend/aliyun-php-sdk-afs/afs/Request/V20180112/AnalyzeNvcRequest.php @@ -0,0 +1,74 @@ +setMethod("POST"); + } + + private $resourceOwnerId; + + private $sourceIp; + + private $data; + + private $scoreJsonStr; + + public function getResourceOwnerId() { + return $this->resourceOwnerId; + } + + public function setResourceOwnerId($resourceOwnerId) { + $this->resourceOwnerId = $resourceOwnerId; + $this->queryParameters["ResourceOwnerId"]=$resourceOwnerId; + } + + public function getSourceIp() { + return $this->sourceIp; + } + + public function setSourceIp($sourceIp) { + $this->sourceIp = $sourceIp; + $this->queryParameters["SourceIp"]=$sourceIp; + } + + public function getData() { + return $this->data; + } + + public function setData($data) { + $this->data = $data; + $this->queryParameters["Data"]=$data; + } + + public function getScoreJsonStr() { + return $this->scoreJsonStr; + } + + public function setScoreJsonStr($scoreJsonStr) { + $this->scoreJsonStr = $scoreJsonStr; + $this->queryParameters["ScoreJsonStr"]=$scoreJsonStr; + } + +} \ No newline at end of file diff --git a/extend/aliyun-php-sdk-afs/afs/Request/V20180112/AuthenticateSigRequest.php b/extend/aliyun-php-sdk-afs/afs/Request/V20180112/AuthenticateSigRequest.php new file mode 100644 index 0000000..b0bf55d --- /dev/null +++ b/extend/aliyun-php-sdk-afs/afs/Request/V20180112/AuthenticateSigRequest.php @@ -0,0 +1,118 @@ +setMethod("POST"); + } + + private $sig; + + private $resourceOwnerId; + + private $remoteIp; + + private $sourceIp; + + private $appKey; + + private $sessionId; + + private $token; + + private $scene; + + public function getSig() { + return $this->sig; + } + + public function setSig($sig) { + $this->sig = $sig; + $this->queryParameters["Sig"]=$sig; + } + + public function getResourceOwnerId() { + return $this->resourceOwnerId; + } + + public function setResourceOwnerId($resourceOwnerId) { + $this->resourceOwnerId = $resourceOwnerId; + $this->queryParameters["ResourceOwnerId"]=$resourceOwnerId; + } + + public function getRemoteIp() { + return $this->remoteIp; + } + + public function setRemoteIp($remoteIp) { + $this->remoteIp = $remoteIp; + $this->queryParameters["RemoteIp"]=$remoteIp; + } + + public function getSourceIp() { + return $this->sourceIp; + } + + public function setSourceIp($sourceIp) { + $this->sourceIp = $sourceIp; + $this->queryParameters["SourceIp"]=$sourceIp; + } + + public function getAppKey() { + return $this->appKey; + } + + public function setAppKey($appKey) { + $this->appKey = $appKey; + $this->queryParameters["AppKey"]=$appKey; + } + + public function getSessionId() { + return $this->sessionId; + } + + public function setSessionId($sessionId) { + $this->sessionId = $sessionId; + $this->queryParameters["SessionId"]=$sessionId; + } + + public function getToken() { + return $this->token; + } + + public function setToken($token) { + $this->token = $token; + $this->queryParameters["Token"]=$token; + } + + public function getScene() { + return $this->scene; + } + + public function setScene($scene) { + $this->scene = $scene; + $this->queryParameters["Scene"]=$scene; + } + +} \ No newline at end of file diff --git a/extend/aliyun-php-sdk-afs/afs/Request/V20180112/ConfigurationStyleRequest.php b/extend/aliyun-php-sdk-afs/afs/Request/V20180112/ConfigurationStyleRequest.php new file mode 100644 index 0000000..a1f436d --- /dev/null +++ b/extend/aliyun-php-sdk-afs/afs/Request/V20180112/ConfigurationStyleRequest.php @@ -0,0 +1,85 @@ +setMethod("POST"); + } + + private $resourceOwnerId; + + private $sourceIp; + + private $configurationMethod; + + private $applyType; + + private $scene; + + public function getResourceOwnerId() { + return $this->resourceOwnerId; + } + + public function setResourceOwnerId($resourceOwnerId) { + $this->resourceOwnerId = $resourceOwnerId; + $this->queryParameters["ResourceOwnerId"]=$resourceOwnerId; + } + + public function getSourceIp() { + return $this->sourceIp; + } + + public function setSourceIp($sourceIp) { + $this->sourceIp = $sourceIp; + $this->queryParameters["SourceIp"]=$sourceIp; + } + + public function getConfigurationMethod() { + return $this->configurationMethod; + } + + public function setConfigurationMethod($configurationMethod) { + $this->configurationMethod = $configurationMethod; + $this->queryParameters["ConfigurationMethod"]=$configurationMethod; + } + + public function getApplyType() { + return $this->applyType; + } + + public function setApplyType($applyType) { + $this->applyType = $applyType; + $this->queryParameters["ApplyType"]=$applyType; + } + + public function getScene() { + return $this->scene; + } + + public function setScene($scene) { + $this->scene = $scene; + $this->queryParameters["Scene"]=$scene; + } + +} \ No newline at end of file diff --git a/extend/aliyun-php-sdk-afs/afs/Request/V20180112/CreateConfigurationRequest.php b/extend/aliyun-php-sdk-afs/afs/Request/V20180112/CreateConfigurationRequest.php new file mode 100644 index 0000000..49403c2 --- /dev/null +++ b/extend/aliyun-php-sdk-afs/afs/Request/V20180112/CreateConfigurationRequest.php @@ -0,0 +1,107 @@ +setMethod("POST"); + } + + private $resourceOwnerId; + + private $sourceIp; + + private $configurationName; + + private $maxPV; + + private $configurationMethod; + + private $applyType; + + private $scene; + + public function getResourceOwnerId() { + return $this->resourceOwnerId; + } + + public function setResourceOwnerId($resourceOwnerId) { + $this->resourceOwnerId = $resourceOwnerId; + $this->queryParameters["ResourceOwnerId"]=$resourceOwnerId; + } + + public function getSourceIp() { + return $this->sourceIp; + } + + public function setSourceIp($sourceIp) { + $this->sourceIp = $sourceIp; + $this->queryParameters["SourceIp"]=$sourceIp; + } + + public function getConfigurationName() { + return $this->configurationName; + } + + public function setConfigurationName($configurationName) { + $this->configurationName = $configurationName; + $this->queryParameters["ConfigurationName"]=$configurationName; + } + + public function getMaxPV() { + return $this->maxPV; + } + + public function setMaxPV($maxPV) { + $this->maxPV = $maxPV; + $this->queryParameters["MaxPV"]=$maxPV; + } + + public function getConfigurationMethod() { + return $this->configurationMethod; + } + + public function setConfigurationMethod($configurationMethod) { + $this->configurationMethod = $configurationMethod; + $this->queryParameters["ConfigurationMethod"]=$configurationMethod; + } + + public function getApplyType() { + return $this->applyType; + } + + public function setApplyType($applyType) { + $this->applyType = $applyType; + $this->queryParameters["ApplyType"]=$applyType; + } + + public function getScene() { + return $this->scene; + } + + public function setScene($scene) { + $this->scene = $scene; + $this->queryParameters["Scene"]=$scene; + } + +} \ No newline at end of file diff --git a/extend/aliyun-php-sdk-afs/afs/Request/V20180112/DescribeCaptchaDayRequest.php b/extend/aliyun-php-sdk-afs/afs/Request/V20180112/DescribeCaptchaDayRequest.php new file mode 100644 index 0000000..e127149 --- /dev/null +++ b/extend/aliyun-php-sdk-afs/afs/Request/V20180112/DescribeCaptchaDayRequest.php @@ -0,0 +1,85 @@ +setMethod("POST"); + } + + private $resourceOwnerId; + + private $sourceIp; + + private $configName; + + private $time; + + private $type; + + public function getResourceOwnerId() { + return $this->resourceOwnerId; + } + + public function setResourceOwnerId($resourceOwnerId) { + $this->resourceOwnerId = $resourceOwnerId; + $this->queryParameters["ResourceOwnerId"]=$resourceOwnerId; + } + + public function getSourceIp() { + return $this->sourceIp; + } + + public function setSourceIp($sourceIp) { + $this->sourceIp = $sourceIp; + $this->queryParameters["SourceIp"]=$sourceIp; + } + + public function getConfigName() { + return $this->configName; + } + + public function setConfigName($configName) { + $this->configName = $configName; + $this->queryParameters["ConfigName"]=$configName; + } + + public function getTime() { + return $this->time; + } + + public function setTime($time) { + $this->time = $time; + $this->queryParameters["Time"]=$time; + } + + public function getType() { + return $this->type; + } + + public function setType($type) { + $this->type = $type; + $this->queryParameters["Type"]=$type; + } + +} \ No newline at end of file diff --git a/extend/aliyun-php-sdk-afs/afs/Request/V20180112/DescribeCaptchaIpCityRequest.php b/extend/aliyun-php-sdk-afs/afs/Request/V20180112/DescribeCaptchaIpCityRequest.php new file mode 100644 index 0000000..243284c --- /dev/null +++ b/extend/aliyun-php-sdk-afs/afs/Request/V20180112/DescribeCaptchaIpCityRequest.php @@ -0,0 +1,85 @@ +setMethod("POST"); + } + + private $resourceOwnerId; + + private $sourceIp; + + private $configName; + + private $time; + + private $type; + + public function getResourceOwnerId() { + return $this->resourceOwnerId; + } + + public function setResourceOwnerId($resourceOwnerId) { + $this->resourceOwnerId = $resourceOwnerId; + $this->queryParameters["ResourceOwnerId"]=$resourceOwnerId; + } + + public function getSourceIp() { + return $this->sourceIp; + } + + public function setSourceIp($sourceIp) { + $this->sourceIp = $sourceIp; + $this->queryParameters["SourceIp"]=$sourceIp; + } + + public function getConfigName() { + return $this->configName; + } + + public function setConfigName($configName) { + $this->configName = $configName; + $this->queryParameters["ConfigName"]=$configName; + } + + public function getTime() { + return $this->time; + } + + public function setTime($time) { + $this->time = $time; + $this->queryParameters["Time"]=$time; + } + + public function getType() { + return $this->type; + } + + public function setType($type) { + $this->type = $type; + $this->queryParameters["Type"]=$type; + } + +} \ No newline at end of file diff --git a/extend/aliyun-php-sdk-afs/afs/Request/V20180112/DescribeCaptchaMinRequest.php b/extend/aliyun-php-sdk-afs/afs/Request/V20180112/DescribeCaptchaMinRequest.php new file mode 100644 index 0000000..800f174 --- /dev/null +++ b/extend/aliyun-php-sdk-afs/afs/Request/V20180112/DescribeCaptchaMinRequest.php @@ -0,0 +1,85 @@ +setMethod("POST"); + } + + private $resourceOwnerId; + + private $sourceIp; + + private $configName; + + private $time; + + private $type; + + public function getResourceOwnerId() { + return $this->resourceOwnerId; + } + + public function setResourceOwnerId($resourceOwnerId) { + $this->resourceOwnerId = $resourceOwnerId; + $this->queryParameters["ResourceOwnerId"]=$resourceOwnerId; + } + + public function getSourceIp() { + return $this->sourceIp; + } + + public function setSourceIp($sourceIp) { + $this->sourceIp = $sourceIp; + $this->queryParameters["SourceIp"]=$sourceIp; + } + + public function getConfigName() { + return $this->configName; + } + + public function setConfigName($configName) { + $this->configName = $configName; + $this->queryParameters["ConfigName"]=$configName; + } + + public function getTime() { + return $this->time; + } + + public function setTime($time) { + $this->time = $time; + $this->queryParameters["Time"]=$time; + } + + public function getType() { + return $this->type; + } + + public function setType($type) { + $this->type = $type; + $this->queryParameters["Type"]=$type; + } + +} \ No newline at end of file diff --git a/extend/aliyun-php-sdk-afs/afs/Request/V20180112/DescribeCaptchaRiskRequest.php b/extend/aliyun-php-sdk-afs/afs/Request/V20180112/DescribeCaptchaRiskRequest.php new file mode 100644 index 0000000..aa11123 --- /dev/null +++ b/extend/aliyun-php-sdk-afs/afs/Request/V20180112/DescribeCaptchaRiskRequest.php @@ -0,0 +1,74 @@ +setMethod("POST"); + } + + private $resourceOwnerId; + + private $sourceIp; + + private $configName; + + private $time; + + public function getResourceOwnerId() { + return $this->resourceOwnerId; + } + + public function setResourceOwnerId($resourceOwnerId) { + $this->resourceOwnerId = $resourceOwnerId; + $this->queryParameters["ResourceOwnerId"]=$resourceOwnerId; + } + + public function getSourceIp() { + return $this->sourceIp; + } + + public function setSourceIp($sourceIp) { + $this->sourceIp = $sourceIp; + $this->queryParameters["SourceIp"]=$sourceIp; + } + + public function getConfigName() { + return $this->configName; + } + + public function setConfigName($configName) { + $this->configName = $configName; + $this->queryParameters["ConfigName"]=$configName; + } + + public function getTime() { + return $this->time; + } + + public function setTime($time) { + $this->time = $time; + $this->queryParameters["Time"]=$time; + } + +} \ No newline at end of file diff --git a/extend/aliyun-php-sdk-afs/afs/Request/V20180112/DescribeConfigNameRequest.php b/extend/aliyun-php-sdk-afs/afs/Request/V20180112/DescribeConfigNameRequest.php new file mode 100644 index 0000000..4ef6a6d --- /dev/null +++ b/extend/aliyun-php-sdk-afs/afs/Request/V20180112/DescribeConfigNameRequest.php @@ -0,0 +1,52 @@ +setMethod("POST"); + } + + private $resourceOwnerId; + + private $sourceIp; + + public function getResourceOwnerId() { + return $this->resourceOwnerId; + } + + public function setResourceOwnerId($resourceOwnerId) { + $this->resourceOwnerId = $resourceOwnerId; + $this->queryParameters["ResourceOwnerId"]=$resourceOwnerId; + } + + public function getSourceIp() { + return $this->sourceIp; + } + + public function setSourceIp($sourceIp) { + $this->sourceIp = $sourceIp; + $this->queryParameters["SourceIp"]=$sourceIp; + } + +} \ No newline at end of file diff --git a/extend/aliyun-php-sdk-afs/afs/Request/V20180112/DescribeEarlyWarningRequest.php b/extend/aliyun-php-sdk-afs/afs/Request/V20180112/DescribeEarlyWarningRequest.php new file mode 100644 index 0000000..3e84528 --- /dev/null +++ b/extend/aliyun-php-sdk-afs/afs/Request/V20180112/DescribeEarlyWarningRequest.php @@ -0,0 +1,52 @@ +setMethod("POST"); + } + + private $resourceOwnerId; + + private $sourceIp; + + public function getResourceOwnerId() { + return $this->resourceOwnerId; + } + + public function setResourceOwnerId($resourceOwnerId) { + $this->resourceOwnerId = $resourceOwnerId; + $this->queryParameters["ResourceOwnerId"]=$resourceOwnerId; + } + + public function getSourceIp() { + return $this->sourceIp; + } + + public function setSourceIp($sourceIp) { + $this->sourceIp = $sourceIp; + $this->queryParameters["SourceIp"]=$sourceIp; + } + +} \ No newline at end of file diff --git a/extend/aliyun-php-sdk-afs/afs/Request/V20180112/DescribePersonMachineListRequest.php b/extend/aliyun-php-sdk-afs/afs/Request/V20180112/DescribePersonMachineListRequest.php new file mode 100644 index 0000000..5c43b3f --- /dev/null +++ b/extend/aliyun-php-sdk-afs/afs/Request/V20180112/DescribePersonMachineListRequest.php @@ -0,0 +1,52 @@ +setMethod("POST"); + } + + private $resourceOwnerId; + + private $sourceIp; + + public function getResourceOwnerId() { + return $this->resourceOwnerId; + } + + public function setResourceOwnerId($resourceOwnerId) { + $this->resourceOwnerId = $resourceOwnerId; + $this->queryParameters["ResourceOwnerId"]=$resourceOwnerId; + } + + public function getSourceIp() { + return $this->sourceIp; + } + + public function setSourceIp($sourceIp) { + $this->sourceIp = $sourceIp; + $this->queryParameters["SourceIp"]=$sourceIp; + } + +} \ No newline at end of file diff --git a/extend/aliyun-php-sdk-afs/afs/Request/V20180112/SetEarlyWarningRequest.php b/extend/aliyun-php-sdk-afs/afs/Request/V20180112/SetEarlyWarningRequest.php new file mode 100644 index 0000000..f734db0 --- /dev/null +++ b/extend/aliyun-php-sdk-afs/afs/Request/V20180112/SetEarlyWarningRequest.php @@ -0,0 +1,129 @@ +setMethod("POST"); + } + + private $timeEnd; + + private $resourceOwnerId; + + private $warnOpen; + + private $sourceIp; + + private $channel; + + private $title; + + private $timeOpen; + + private $timeBegin; + + private $frequency; + + public function getTimeEnd() { + return $this->timeEnd; + } + + public function setTimeEnd($timeEnd) { + $this->timeEnd = $timeEnd; + $this->queryParameters["TimeEnd"]=$timeEnd; + } + + public function getResourceOwnerId() { + return $this->resourceOwnerId; + } + + public function setResourceOwnerId($resourceOwnerId) { + $this->resourceOwnerId = $resourceOwnerId; + $this->queryParameters["ResourceOwnerId"]=$resourceOwnerId; + } + + public function getWarnOpen() { + return $this->warnOpen; + } + + public function setWarnOpen($warnOpen) { + $this->warnOpen = $warnOpen; + $this->queryParameters["WarnOpen"]=$warnOpen; + } + + public function getSourceIp() { + return $this->sourceIp; + } + + public function setSourceIp($sourceIp) { + $this->sourceIp = $sourceIp; + $this->queryParameters["SourceIp"]=$sourceIp; + } + + public function getChannel() { + return $this->channel; + } + + public function setChannel($channel) { + $this->channel = $channel; + $this->queryParameters["Channel"]=$channel; + } + + public function getTitle() { + return $this->title; + } + + public function setTitle($title) { + $this->title = $title; + $this->queryParameters["Title"]=$title; + } + + public function getTimeOpen() { + return $this->timeOpen; + } + + public function setTimeOpen($timeOpen) { + $this->timeOpen = $timeOpen; + $this->queryParameters["TimeOpen"]=$timeOpen; + } + + public function getTimeBegin() { + return $this->timeBegin; + } + + public function setTimeBegin($timeBegin) { + $this->timeBegin = $timeBegin; + $this->queryParameters["TimeBegin"]=$timeBegin; + } + + public function getFrequency() { + return $this->frequency; + } + + public function setFrequency($frequency) { + $this->frequency = $frequency; + $this->queryParameters["Frequency"]=$frequency; + } + +} \ No newline at end of file diff --git a/extend/aliyun-php-sdk-core/AcsRequest.php b/extend/aliyun-php-sdk-core/AcsRequest.php new file mode 100644 index 0000000..e1a553e --- /dev/null +++ b/extend/aliyun-php-sdk-core/AcsRequest.php @@ -0,0 +1,154 @@ +headers["x-sdk-client"] = "php/2.0.0"; + $this->product = $product; + $this->version = $version; + $this->actionName = $actionName; + + $this->locationServiceCode = $locationServiceCode; + $this->locationEndpointType = $locationEndpointType; + } + + public abstract function composeUrl($iSigner, $credential, $domain); + + public function getVersion() + { + return $this->version; + } + + public function setVersion($version) + { + $this->version = $version; + } + + public function getProduct() + { + return $this->product; + } + + public function setProduct($product) + { + $this->product = $product; + } + + public function getActionName() + { + return $this->actionName; + } + + public function setActionName($actionName) + { + $this->actionName = $actionName; + } + + public function getAcceptFormat() + { + return $this->acceptFormat; + } + + public function setAcceptFormat($acceptFormat) + { + $this->acceptFormat = $acceptFormat; + } + + public function getQueryParameters() + { + return $this->queryParameters; + } + + public function getHeaders() + { + return $this->headers; + } + + public function getMethod() + { + return $this->method; + } + + public function setMethod($method) + { + $this->method = $method; + } + + public function getProtocol() + { + return $this->protocolType; + } + + public function setProtocol($protocol) + { + $this->protocolType = $protocol; + } + + public function getRegionId() + { + return $this->regionId; + } + public function setRegionId($region) + { + $this->regionId = $region; + } + + public function getContent() + { + return $this->content; + } + + public function setContent($content) + { + $this->content = $content; + } + + + public function addHeader($headerKey, $headerValue) + { + $this->headers[$headerKey] = $headerValue; + } + + public function getLocationServiceCode() + { + return $this->locationServiceCode; + } + + public function getLocationEndpointType() + { + return $this->locationEndpointType; + } +} \ No newline at end of file diff --git a/extend/aliyun-php-sdk-core/AcsResponse.php b/extend/aliyun-php-sdk-core/AcsResponse.php new file mode 100644 index 0000000..bda087b --- /dev/null +++ b/extend/aliyun-php-sdk-core/AcsResponse.php @@ -0,0 +1,44 @@ +code; + } + + public function setCode($code) + { + $this->code = $code; + } + + public function getMessage() + { + return $this->message; + } + + public function setMessage($message) + { + $this->message = $message; + } +} diff --git a/extend/aliyun-php-sdk-core/Auth/Credential.php b/extend/aliyun-php-sdk-core/Auth/Credential.php new file mode 100644 index 0000000..67b282f --- /dev/null +++ b/extend/aliyun-php-sdk-core/Auth/Credential.php @@ -0,0 +1,94 @@ +accessKeyId = $accessKeyId; + $this->accessSecret = $accessSecret; + $this->securityToken = $securityToken; + $this->refreshDate = date($this->dateTimeFormat); + } + + public function isExpired() + { + if ($this->expiredDate == null) { + return false; + } + if (strtotime($this->expiredDate)>date($this->dateTimeFormat)) { + return false; + } + return true; + } + + public function getRefreshDate() + { + return $this->refreshDate; + } + + public function getExpiredDate() + { + return $this->expiredDate; + } + + public function setExpiredDate($expiredHours) + { + if ($expiredHours>0) { + return $this->expiredDate = date($this->dateTimeFormat, strtotime("+".$expiredHours." hour")); + } + } + + public function getAccessKeyId() + { + return $this->accessKeyId; + } + + public function setAccessKeyId($accessKeyId) + { + $this->accessKeyId = $accessKeyId; + } + + public function getAccessSecret() + { + return $this->accessSecret; + } + + public function setAccessSecret($accessSecret) + { + $this->accessSecret = $accessSecret; + } + + public function getSecurityToken() + { + return $this->securityToken; + } + + public function setSecurityToken($securityToken) + { + $this->securityToken = $securityToken; + } +} diff --git a/extend/aliyun-php-sdk-core/Auth/ISigner.php b/extend/aliyun-php-sdk-core/Auth/ISigner.php new file mode 100644 index 0000000..451f6ff --- /dev/null +++ b/extend/aliyun-php-sdk-core/Auth/ISigner.php @@ -0,0 +1,27 @@ +iClientProfile = $iClientProfile; + $this->__urlTestFlag__ = false; + $this->locationService = new LocationService($this->iClientProfile); + } + + public function getAcsResponse($request, $iSigner = null, $credential = null, $autoRetry = true, $maxRetryNumber = 3) + { + $httpResponse = $this->doActionImpl($request, $iSigner, $credential, $autoRetry, $maxRetryNumber); + $respObject = $this->parseAcsResponse($httpResponse->getBody(), $request->getAcceptFormat()); + if (false == $httpResponse->isSuccess()) { + $this->buildApiException($respObject, $httpResponse->getStatus()); + } + return $respObject; + } + + private function doActionImpl($request, $iSigner = null, $credential = null, $autoRetry = true, $maxRetryNumber = 3) + { + if (null == $this->iClientProfile && (null == $iSigner || null == $credential + || null == $request->getRegionId() || null == $request->getAcceptFormat())) { + throw new ClientException("No active profile found.", "SDK.InvalidProfile"); + } + if (null == $iSigner) { + $iSigner = $this->iClientProfile->getSigner(); + } + if (null == $credential) { + $credential = $this->iClientProfile->getCredential(); + } + $request = $this->prepareRequest($request); + + // Get the domain from the Location Service by speicified `ServiceCode` and `RegionId`. + $domain = null; + if (null != $request->getLocationServiceCode()) + { + $domain = $this->locationService->findProductDomain($request->getRegionId(), $request->getLocationServiceCode(), $request->getLocationEndpointType(), $request->getProduct()); + } + if ($domain == null) + { + $domain = EndpointProvider::findProductDomain($request->getRegionId(), $request->getProduct()); + } + + if (null == $domain) { + throw new ClientException("Can not find endpoint to access.", "SDK.InvalidRegionId"); + } + $requestUrl = $request->composeUrl($iSigner, $credential, $domain); + + if ($this->__urlTestFlag__) { + throw new ClientException($requestUrl, "URLTestFlagIsSet"); + } + + if (count($request->getDomainParameter())>0) { + $httpResponse = HttpHelper::curl($requestUrl, $request->getMethod(), $request->getDomainParameter(), $request->getHeaders()); + } else { + $httpResponse = HttpHelper::curl($requestUrl, $request->getMethod(), $request->getContent(), $request->getHeaders()); + } + + $retryTimes = 1; + while (500 <= $httpResponse->getStatus() && $autoRetry && $retryTimes < $maxRetryNumber) { + $requestUrl = $request->composeUrl($iSigner, $credential, $domain); + + if (count($request->getDomainParameter())>0) { + $httpResponse = HttpHelper::curl($requestUrl, $request->getDomainParameter(), $request->getHeaders()); + } else { + $httpResponse = HttpHelper::curl($requestUrl, $request->getMethod(), $request->getContent(), $request->getHeaders()); + } + $retryTimes ++; + } + return $httpResponse; + } + + public function doAction($request, $iSigner = null, $credential = null, $autoRetry = true, $maxRetryNumber = 3) + { + trigger_error("doAction() is deprecated. Please use getAcsResponse() instead.", E_USER_NOTICE); + return $this->doActionImpl($request, $iSigner, $credential, $autoRetry, $maxRetryNumber); + } + + private function prepareRequest($request) + { + if (null == $request->getRegionId()) { + $request->setRegionId($this->iClientProfile->getRegionId()); + } + if (null == $request->getAcceptFormat()) { + $request->setAcceptFormat($this->iClientProfile->getFormat()); + } + if (null == $request->getMethod()) { + $request->setMethod("GET"); + } + return $request; + } + + + private function buildApiException($respObject, $httpStatus) + { + throw new ServerException($respObject->Message, $respObject->Code, $httpStatus, $respObject->RequestId); + } + + private function parseAcsResponse($body, $format) + { + if ("JSON" == $format) { + $respObject = json_decode($body); + } elseif ("XML" == $format) { + $respObject = @simplexml_load_string($body); + } elseif ("RAW" == $format) { + $respObject = $body; + } + return $respObject; + } +} diff --git a/extend/aliyun-php-sdk-core/Exception/ClientException.php b/extend/aliyun-php-sdk-core/Exception/ClientException.php new file mode 100644 index 0000000..b5b5fe1 --- /dev/null +++ b/extend/aliyun-php-sdk-core/Exception/ClientException.php @@ -0,0 +1,63 @@ +errorMessage = $errorMessage; + $this->errorCode = $errorCode; + $this->setErrorType("Client"); + } + + private $errorCode; + private $errorMessage; + private $errorType; + + public function getErrorCode() + { + return $this->errorCode; + } + + public function setErrorCode($errorCode) + { + $this->errorCode = $errorCode; + } + + public function getErrorMessage() + { + return $this->errorMessage; + } + + public function setErrorMessage($errorMessage) + { + $this->errorMessage = $errorMessage; + } + + public function getErrorType() + { + return $this->errorType; + } + + public function setErrorType($errorType) + { + $this->errorType = $errorType; + } +} diff --git a/extend/aliyun-php-sdk-core/Exception/ServerException.php b/extend/aliyun-php-sdk-core/Exception/ServerException.php new file mode 100644 index 0000000..a392654 --- /dev/null +++ b/extend/aliyun-php-sdk-core/Exception/ServerException.php @@ -0,0 +1,44 @@ +setErrorMessage($errorMessage); + $this->setErrorType("Server"); + $this->httpStatus = $httpStatus; + $this->requestId = $requestId; + } + + public function getHttpStatus() + { + return $this->httpStatus; + } + + public function getRequestId() + { + return $this->requestId; + } +} diff --git a/extend/aliyun-php-sdk-core/Http/HttpHelper.php b/extend/aliyun-php-sdk-core/Http/HttpHelper.php new file mode 100644 index 0000000..397d098 --- /dev/null +++ b/extend/aliyun-php-sdk-core/Http/HttpHelper.php @@ -0,0 +1,80 @@ + 5 && strtolower(substr($url, 0, 5)) == "https") { + curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false); + curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, false); + } + if (is_array($headers) && 0 < count($headers)) { + $httpHeaders =self::getHttpHearders($headers); + curl_setopt($ch, CURLOPT_HTTPHEADER, $httpHeaders); + } + $httpResponse = new HttpResponse(); + $httpResponse->setBody(curl_exec($ch)); + $httpResponse->setStatus(curl_getinfo($ch, CURLINFO_HTTP_CODE)); + if (curl_errno($ch)) { + throw new ClientException("Server unreachable: Errno: " . curl_errno($ch) . " " . curl_error($ch), "SDK.ServerUnreachable"); + } + curl_close($ch); + return $httpResponse; + } + public static function getPostHttpBody($postFildes) + { + $content = ""; + foreach ($postFildes as $apiParamKey => $apiParamValue) { + $content .= "$apiParamKey=" . urlencode($apiParamValue) . "&"; + } + return substr($content, 0, -1); + } + public static function getHttpHearders($headers) + { + $httpHeader = array(); + foreach ($headers as $key => $value) { + array_push($httpHeader, $key.":".$value); + } + return $httpHeader; + } +} diff --git a/extend/aliyun-php-sdk-core/Http/HttpResponse.php b/extend/aliyun-php-sdk-core/Http/HttpResponse.php new file mode 100644 index 0000000..ccbcc4a --- /dev/null +++ b/extend/aliyun-php-sdk-core/Http/HttpResponse.php @@ -0,0 +1,52 @@ +body; + } + + public function setBody($body) + { + $this->body = $body; + } + + public function getStatus() + { + return $this->status; + } + + public function setStatus($status) + { + $this->status = $status; + } + + public function isSuccess() + { + if (200 <= $this->status && 300 > $this->status) { + return true; + } + return false; + } +} diff --git a/extend/aliyun-php-sdk-core/IAcsClient.php b/extend/aliyun-php-sdk-core/IAcsClient.php new file mode 100644 index 0000000..cd4dc93 --- /dev/null +++ b/extend/aliyun-php-sdk-core/IAcsClient.php @@ -0,0 +1,23 @@ + $endpoint) + { + if($endpoint->getName() == $endpointName) + { + return $endpoint; + } + } + } + + private static function addEndpoint_($endpointName,$regionId, $product, $domain) + { + $regionIds = array($regionId); + $productsDomains = array(new ProductDomain($product, $domain)); + $endpoint = new Endpoint($endpointName, $regionIds, $productsDomains); + array_push(self::$endpoints, $endpoint); + } + + private static function updateEndpoint($regionId, $product, $domain, $endpoint) + { + $regionIds = $endpoint->getRegionIds(); + if(!in_array($regionId,$regionIds)) + { + array_push($regionIds, $regionId); + $endpoint->setRegionIds($regionIds); + } + + $productDomains = $endpoint->getProductDomains(); + if (null == self::findProductDomainAndUpdate($productDomains, $product, $domain)) { + array_push($productDomains, new ProductDomain($product, $domain)); + } + + $endpoint->setProductDomains($productDomains); + } + + private static function findProductDomainAndUpdate($productDomains, $product, $domain) + { + foreach ($productDomains as $key => $productDomain) { + if ($productDomain->getProductName() == $product) { + $productDomain->setDomainName($domain); + return $productDomain; + } + } + return null; + } +} diff --git a/extend/aliyun-php-sdk-core/Profile/IClientProfile.php b/extend/aliyun-php-sdk-core/Profile/IClientProfile.php new file mode 100644 index 0000000..99bc1fc --- /dev/null +++ b/extend/aliyun-php-sdk-core/Profile/IClientProfile.php @@ -0,0 +1,29 @@ +name = $name; + $this->regionIds = $regionIds; + $this->productDomains = $productDomains; + } + + public function getName() + { + return $this->name; + } + + public function setName($name) + { + $this->name = $name; + } + + public function getRegionIds() + { + return $this->regionIds; + } + + public function setRegionIds($regionIds) + { + $this->regionIds = $regionIds; + } + + public function getProductDomains() + { + return $this->productDomains; + } + + public function setProductDomains($productDomains) + { + $this->productDomains = $productDomains; + } +} diff --git a/extend/aliyun-php-sdk-core/Regions/EndpointConfig.php b/extend/aliyun-php-sdk-core/Regions/EndpointConfig.php new file mode 100644 index 0000000..bd5e110 --- /dev/null +++ b/extend/aliyun-php-sdk-core/Regions/EndpointConfig.php @@ -0,0 +1,65 @@ + $endpoint) { + if (in_array($regionId, $endpoint->getRegionIds())) { + return self::findProductDomainByProduct($endpoint->getProductDomains(), $product); + } + } + return null; + } + + private static function findProductDomainByProduct($productDomains, $product) + { + if (null == $productDomains) { + return null; + } + foreach ($productDomains as $key => $productDomain) { + if ($product == $productDomain->getProductName()) { + return $productDomain->getDomainName(); + } + } + return null; + } + + + public static function getEndpoints() + { + return self::$endpoints; + } + + public static function setEndpoints($endpoints) + { + self::$endpoints = $endpoints; + } +} diff --git a/extend/aliyun-php-sdk-core/Regions/LocationService.php b/extend/aliyun-php-sdk-core/Regions/LocationService.php new file mode 100644 index 0000000..dd9f713 --- /dev/null +++ b/extend/aliyun-php-sdk-core/Regions/LocationService.php @@ -0,0 +1,120 @@ +queryParameters["Id"] = $id; + $this->queryParameters["ServiceCode"] = $serviceCode; + $this->queryParameters["Type"] = $endPointType; + $this->setRegionId(LOCATION_SERVICE_REGION); + + $this->setAcceptFormat("JSON"); + } +} + +class LocationService +{ + private $clientProfile; + public static $cache = array(); + public static $lastClearTimePerProduct = array(); + public static $serviceDomain = LOCATION_SERVICE_DOMAIN; + + function __construct($clientProfile) { + $this->clientProfile = $clientProfile; + } + + public function findProductDomain($regionId, $serviceCode, $endPointType, $product) + { + $key = $regionId.'#'.$product; + @$domain = self::$cache[$key]; + if ($domain == null || $this->checkCacheIsExpire($key) == true) + { + $domain = $this->findProductDomainFromLocationService($regionId, $serviceCode, $endPointType); + self::$cache[$key] = $domain; + } + + return $domain; + } + + public static function addEndPoint($regionId, $product, $domain) + { + $key = $regionId.'#'.$product; + self::$cache[$key] = $domain; + $lastClearTime = mktime(0, 0, 0, 1, 1, 2999); + self::$lastClearTimePerProduct[$key] = $lastClearTime; + } + + public static function modifyServiceDomain($domain) + { + self::$serviceDomain = $domain; + } + + private function checkCacheIsExpire($key) + { + $lastClearTime = self::$lastClearTimePerProduct[$key]; + if ($lastClearTime == null) + { + $lastClearTime = time(); + self::$lastClearTimePerProduct[$key] = $lastClearTime; + } + + $now = time(); + $elapsedTime = $now - $lastClearTime; + + if ($elapsedTime > CACHE_EXPIRE_TIME) + { + $lastClearTime = time(); + self::$lastClearTimePerProduct[$key] = $lastClearTime; + return true; + } + + return false; + } + + private function findProductDomainFromLocationService($regionId, $serviceCode, $endPointType) + { + $request = new DescribeEndpointRequest($regionId, $serviceCode, $endPointType); + + $signer = $this->clientProfile->getSigner(); + $credential = $this->clientProfile->getCredential(); + + $requestUrl = $request->composeUrl($signer, $credential, self::$serviceDomain); + + $httpResponse = HttpHelper::curl($requestUrl, $request->getMethod(), null, $request->getHeaders()); + + if (!$httpResponse->isSuccess()) + { + return null; + } + + $respObj = json_decode($httpResponse->getBody()); + return $respObj->Endpoints->Endpoint[0]->Endpoint; + } +} \ No newline at end of file diff --git a/extend/aliyun-php-sdk-core/Regions/ProductDomain.php b/extend/aliyun-php-sdk-core/Regions/ProductDomain.php new file mode 100644 index 0000000..8cebc57 --- /dev/null +++ b/extend/aliyun-php-sdk-core/Regions/ProductDomain.php @@ -0,0 +1,47 @@ +productName = $product; + $this->domainName = $domain; + } + + public function getProductName() + { + return $this->productName; + } + public function setProductName($productName) + { + $this->productName = $productName; + } + public function getDomainName() + { + return $this->domainName; + } + public function setDomainName($domainName) + { + $this->domainName = $domainName; + } +} diff --git a/extend/aliyun-php-sdk-core/Regions/endpoints.xml b/extend/aliyun-php-sdk-core/Regions/endpoints.xml new file mode 100644 index 0000000..a63b2df --- /dev/null +++ b/extend/aliyun-php-sdk-core/Regions/endpoints.xml @@ -0,0 +1,1349 @@ + + + + jp-fudao-1 + + Ecsecs-cn-hangzhou.aliyuncs.com + + + + me-east-1 + + Rdsrds.me-east-1.aliyuncs.com + Ecsecs.me-east-1.aliyuncs.com + Vpcvpc.me-east-1.aliyuncs.com + Kmskms.me-east-1.aliyuncs.com + Cmsmetrics.cn-hangzhou.aliyuncs.com + Slbslb.me-east-1.aliyuncs.com + + + + us-east-1 + + CScs.aliyuncs.com + Pushcloudpush.aliyuncs.com + COScos.aliyuncs.com + Essess.aliyuncs.com + Ace-opsace-ops.cn-hangzhou.aliyuncs.com + Billingbilling.aliyuncs.com + Dqsdqs.aliyuncs.com + Ddsmongodb.aliyuncs.com + Emremr.aliyuncs.com + Smssms.aliyuncs.com + Jaqjaq.aliyuncs.com + HPChpc.aliyuncs.com + Locationlocation.aliyuncs.com + ChargingServicechargingservice.aliyuncs.com + Msgmsg-inner.aliyuncs.com + Commondrivercommon.driver.aliyuncs.com + R-kvstorer-kvstore-cn-hangzhou.aliyuncs.com + Bssbss.aliyuncs.com + Workorderworkorder.aliyuncs.com + Ocsm-kvstore.aliyuncs.com + Yundunyundun-cn-hangzhou.aliyuncs.com + Ubsms-innerubsms-inner.aliyuncs.com + Dmdm.aliyuncs.com + Greengreen.aliyuncs.com + Riskrisk-cn-hangzhou.aliyuncs.com + oceanbaseoceanbase.aliyuncs.com + Mscmsc-inner.aliyuncs.com + Yundunhsmyundunhsm.aliyuncs.com + Iotiot.aliyuncs.com + jaqjaq.aliyuncs.com + Omsoms.aliyuncs.com + livelive.aliyuncs.com + Ecsecs-cn-hangzhou.aliyuncs.com + Ubsmsubsms.aliyuncs.com + Vpcvpc.aliyuncs.com + Alertalert.aliyuncs.com + Aceace.cn-hangzhou.aliyuncs.com + AMSams.aliyuncs.com + ROSros.aliyuncs.com + PTSpts.aliyuncs.com + Qualitycheckqualitycheck.aliyuncs.com + M-kvstorem-kvstore.aliyuncs.com + HighDDosyd-highddos-cn-hangzhou.aliyuncs.com + CmsSiteMonitorsitemonitor.aliyuncs.com + Rdsrds.aliyuncs.com + BatchComputebatchCompute.aliyuncs.com + CFcf.aliyuncs.com + Drdsdrds.aliyuncs.com + Acsacs.aliyun-inc.com + Httpdnshttpdns-api.aliyuncs.com + Location-innerlocation-inner.aliyuncs.com + Aasaas.aliyuncs.com + Stssts.aliyuncs.com + Dtsdts.aliyuncs.com + Drcdrc.aliyuncs.com + Vpc-innervpc-inner.aliyuncs.com + Cmsmetrics.cn-hangzhou.aliyuncs.com + Slbslb.aliyuncs.com + Crmcrm-cn-hangzhou.aliyuncs.com + Domaindomain.aliyuncs.com + Otsots-pop.aliyuncs.com + Ossoss-cn-hangzhou.aliyuncs.com + Ramram.aliyuncs.com + Salessales.cn-hangzhou.aliyuncs.com + OssAdminoss-admin.aliyuncs.com + Alidnsalidns.aliyuncs.com + Onsons.aliyuncs.com + Cdncdn.aliyuncs.com + YundunDdosinner-yundun-ddos.cn-hangzhou.aliyuncs.com + + + + ap-northeast-1 + + Rdsrds.ap-northeast-1.aliyuncs.com + Kmskms.ap-northeast-1.aliyuncs.com + Vpcvpc.ap-northeast-1.aliyuncs.com + Ecsecs.ap-northeast-1.aliyuncs.com + Cmsmetrics.ap-northeast-1.aliyuncs.com + Kvstorer-kvstore.ap-northeast-1.aliyuncs.com + Slbslb.ap-northeast-1.aliyuncs.com + + + + cn-hangzhou-bj-b01 + + Ecsecs-cn-hangzhou.aliyuncs.com + + + + cn-hongkong + + Pushcloudpush.aliyuncs.com + COScos.aliyuncs.com + Onsons.aliyuncs.com + Essess.aliyuncs.com + Ace-opsace-ops.cn-hangzhou.aliyuncs.com + Billingbilling.aliyuncs.com + Dqsdqs.aliyuncs.com + Ddsmongodb.aliyuncs.com + Emremr.aliyuncs.com + Smssms.aliyuncs.com + Jaqjaq.aliyuncs.com + CScs.aliyuncs.com + Kmskms.cn-hongkong.aliyuncs.com + Locationlocation.aliyuncs.com + Msgmsg-inner.aliyuncs.com + ChargingServicechargingservice.aliyuncs.com + R-kvstorer-kvstore-cn-hangzhou.aliyuncs.com + Alertalert.aliyuncs.com + Mscmsc-inner.aliyuncs.com + Drcdrc.aliyuncs.com + Yundunyundun-cn-hangzhou.aliyuncs.com + Ubsms-innerubsms-inner.aliyuncs.com + Ocsm-kvstore.aliyuncs.com + Dmdm.aliyuncs.com + Riskrisk-cn-hangzhou.aliyuncs.com + oceanbaseoceanbase.aliyuncs.com + Workorderworkorder.aliyuncs.com + Yundunhsmyundunhsm.aliyuncs.com + Iotiot.aliyuncs.com + HPChpc.aliyuncs.com + jaqjaq.aliyuncs.com + Omsoms.aliyuncs.com + livelive.aliyuncs.com + Ecsecs-cn-hangzhou.aliyuncs.com + M-kvstorem-kvstore.aliyuncs.com + Vpcvpc.aliyuncs.com + BatchComputebatchCompute.aliyuncs.com + AMSams.aliyuncs.com + ROSros.aliyuncs.com + PTSpts.aliyuncs.com + Qualitycheckqualitycheck.aliyuncs.com + Bssbss.aliyuncs.com + Ubsmsubsms.aliyuncs.com + CloudAPIapigateway.cn-hongkong.aliyuncs.com + Stssts.aliyuncs.com + CmsSiteMonitorsitemonitor.aliyuncs.com + Aceace.cn-hangzhou.aliyuncs.com + Mtsmts.cn-hongkong.aliyuncs.com + Location-innerlocation-inner.aliyuncs.com + CFcf.aliyuncs.com + Acsacs.aliyun-inc.com + Httpdnshttpdns-api.aliyuncs.com + Greengreen.aliyuncs.com + Aasaas.aliyuncs.com + Alidnsalidns.aliyuncs.com + Dtsdts.aliyuncs.com + HighDDosyd-highddos-cn-hangzhou.aliyuncs.com + Vpc-innervpc-inner.aliyuncs.com + Cmsmetrics.cn-hangzhou.aliyuncs.com + Slbslb.aliyuncs.com + Commondrivercommon.driver.aliyuncs.com + Domaindomain.aliyuncs.com + Otsots-pop.aliyuncs.com + Cdncdn.aliyuncs.com + Ramram.aliyuncs.com + Drdsdrds.aliyuncs.com + Rdsrds.aliyuncs.com + Crmcrm-cn-hangzhou.aliyuncs.com + OssAdminoss-admin.aliyuncs.com + Salessales.cn-hangzhou.aliyuncs.com + YundunDdosinner-yundun-ddos.cn-hangzhou.aliyuncs.com + Ossoss-cn-hongkong.aliyuncs.com + + + + cn-beijing-nu16-b01 + + Ecsecs-cn-hangzhou.aliyuncs.com + + + + cn-beijing-am13-c01 + + Ecsecs-cn-hangzhou.aliyuncs.com + Vpcvpc.aliyuncs.com + + + + in-west-antgroup-1 + + Ecsecs-cn-hangzhou.aliyuncs.com + + + + cn-guizhou-gov + + Ecsecs-cn-hangzhou.aliyuncs.com + Vpcvpc.aliyuncs.com + + + + in-west-antgroup-2 + + Ecsecs-cn-hangzhou.aliyuncs.com + + + + cn-qingdao-cm9 + + CScs.aliyuncs.com + Riskrisk-cn-hangzhou.aliyuncs.com + COScos.aliyuncs.com + Essess.aliyuncs.com + Billingbilling.aliyuncs.com + Dqsdqs.aliyuncs.com + Ddsmongodb.aliyuncs.com + Alidnsalidns.aliyuncs.com + Smssms.aliyuncs.com + Drdsdrds.aliyuncs.com + HPChpc.aliyuncs.com + Locationlocation.aliyuncs.com + Msgmsg-inner.aliyuncs.com + ChargingServicechargingservice.aliyuncs.com + Ocsm-kvstore.aliyuncs.com + Alertalert.aliyuncs.com + Mscmsc-inner.aliyuncs.com + HighDDosyd-highddos-cn-hangzhou.aliyuncs.com + R-kvstorer-kvstore-cn-hangzhou.aliyuncs.com + Yundunyundun-cn-hangzhou.aliyuncs.com + Ubsms-innerubsms-inner.aliyuncs.com + Dmdm.aliyuncs.com + Greengreen.aliyuncs.com + YundunDdosinner-yundun-ddos.cn-hangzhou.aliyuncs.com + oceanbaseoceanbase.aliyuncs.com + Workorderworkorder.aliyuncs.com + Yundunhsmyundunhsm.aliyuncs.com + Iotiot.aliyuncs.com + jaqjaq.aliyuncs.com + Omsoms.aliyuncs.com + livelive.aliyuncs.com + Ecsecs-cn-hangzhou.aliyuncs.com + Ubsmsubsms.aliyuncs.com + CmsSiteMonitorsitemonitor.aliyuncs.com + AMSams.aliyuncs.com + Crmcrm-cn-hangzhou.aliyuncs.com + PTSpts.aliyuncs.com + Qualitycheckqualitycheck.aliyuncs.com + Bssbss.aliyuncs.com + M-kvstorem-kvstore.aliyuncs.com + Aceace.cn-hangzhou.aliyuncs.com + Mtsmts.cn-qingdao.aliyuncs.com + CFcf.aliyuncs.com + Httpdnshttpdns-api.aliyuncs.com + Location-innerlocation-inner.aliyuncs.com + Aasaas.aliyuncs.com + Stssts.aliyuncs.com + Dtsdts.aliyuncs.com + Emremr.aliyuncs.com + Drcdrc.aliyuncs.com + Pushcloudpush.aliyuncs.com + Cmsmetrics.aliyuncs.com + Slbslb.aliyuncs.com + Commondrivercommon.driver.aliyuncs.com + Domaindomain.aliyuncs.com + Otsots-pop.aliyuncs.com + ROSros.aliyuncs.com + Ossoss-cn-hangzhou.aliyuncs.com + Ramram.aliyuncs.com + Salessales.cn-hangzhou.aliyuncs.com + Rdsrds.aliyuncs.com + OssAdminoss-admin.aliyuncs.com + Onsons.aliyuncs.com + Cdncdn.aliyuncs.com + + + + tw-snowcloud-kaohsiung + + Ecsecs-cn-hangzhou.aliyuncs.com + + + + cn-shanghai-finance-1 + + Kmskms.cn-shanghai-finance-1.aliyuncs.com + Ecsecs-cn-hangzhou.aliyuncs.com + Vpcvpc.aliyuncs.com + Rdsrds.aliyuncs.com + + + + cn-guizhou + + Ecsecs-cn-hangzhou.aliyuncs.com + Vpcvpc.aliyuncs.com + + + + cn-qingdao-finance + + Ossoss-cn-qdjbp-a.aliyuncs.com + + + + cn-beijing-gov-1 + + Ossoss-cn-haidian-a.aliyuncs.com + Rdsrds.aliyuncs.com + + + + cn-shanghai + + ARMSarms.cn-shanghai.aliyuncs.com + Riskrisk-cn-hangzhou.aliyuncs.com + COScos.aliyuncs.com + HPChpc.aliyuncs.com + Billingbilling.aliyuncs.com + Dqsdqs.aliyuncs.com + Drcdrc.aliyuncs.com + Alidnsalidns.aliyuncs.com + Smssms.aliyuncs.com + Drdsdrds.aliyuncs.com + CScs.aliyuncs.com + Kmskms.cn-shanghai.aliyuncs.com + Locationlocation.aliyuncs.com + Msgmsg-inner.aliyuncs.com + ChargingServicechargingservice.aliyuncs.com + Ocsm-kvstore.aliyuncs.com + Alertalert.aliyuncs.com + Mscmsc-inner.aliyuncs.com + R-kvstorer-kvstore-cn-hangzhou.aliyuncs.com + Yundunyundun-cn-hangzhou.aliyuncs.com + Ubsms-innerubsms-inner.aliyuncs.com + Dmdm.aliyuncs.com + Greengreen.cn-shanghai.aliyuncs.com + Commondrivercommon.driver.aliyuncs.com + oceanbaseoceanbase.aliyuncs.com + Workorderworkorder.aliyuncs.com + Yundunhsmyundunhsm.aliyuncs.com + Iotiot.cn-shanghai.aliyuncs.com + Bssbss.aliyuncs.com + Omsoms.aliyuncs.com + Ubsmsubsms.aliyuncs.com + livelive.aliyuncs.com + Ecsecs-cn-hangzhou.aliyuncs.com + Ace-opsace-ops.cn-hangzhou.aliyuncs.com + CmsSiteMonitorsitemonitor.aliyuncs.com + BatchComputebatchCompute.aliyuncs.com + AMSams.aliyuncs.com + ROSros.aliyuncs.com + PTSpts.aliyuncs.com + Qualitycheckqualitycheck.aliyuncs.com + M-kvstorem-kvstore.aliyuncs.com + Apigatewayapigateway.cn-shanghai.aliyuncs.com + CloudAPIapigateway.cn-shanghai.aliyuncs.com + Stssts.aliyuncs.com + Vpcvpc.aliyuncs.com + Aceace.cn-hangzhou.aliyuncs.com + Mtsmts.cn-shanghai.aliyuncs.com + Ddsmongodb.aliyuncs.com + CFcf.aliyuncs.com + Acsacs.aliyun-inc.com + Httpdnshttpdns-api.aliyuncs.com + Pushcloudpush.aliyuncs.com + Location-innerlocation-inner.aliyuncs.com + Aasaas.aliyuncs.com + Emremr.aliyuncs.com + Dtsdts.aliyuncs.com + HighDDosyd-highddos-cn-hangzhou.aliyuncs.com + Jaqjaq.aliyuncs.com + Cmsmetrics.cn-hangzhou.aliyuncs.com + Slbslb.aliyuncs.com + Crmcrm-cn-hangzhou.aliyuncs.com + Domaindomain.aliyuncs.com + Otsots-pop.aliyuncs.com + jaqjaq.aliyuncs.com + Cdncdn.aliyuncs.com + Ramram.aliyuncs.com + Salessales.cn-hangzhou.aliyuncs.com + Vpc-innervpc-inner.aliyuncs.com + Rdsrds.aliyuncs.com + OssAdminoss-admin.aliyuncs.com + Onsons.aliyuncs.com + Essess.aliyuncs.com + Ossoss-cn-shanghai.aliyuncs.com + YundunDdosinner-yundun-ddos.cn-hangzhou.aliyuncs.com + vodvod.cn-shanghai.aliyuncs.com + + + + cn-shenzhen-inner + + Riskrisk-cn-hangzhou.aliyuncs.com + COScos.aliyuncs.com + Onsons.aliyuncs.com + Essess.aliyuncs.com + Billingbilling.aliyuncs.com + Dqsdqs.aliyuncs.com + Ddsmongodb.aliyuncs.com + Alidnsalidns.aliyuncs.com + Smssms.aliyuncs.com + Salessales.cn-hangzhou.aliyuncs.com + HPChpc.aliyuncs.com + Locationlocation.aliyuncs.com + Msgmsg-inner.aliyuncs.com + ChargingServicechargingservice.aliyuncs.com + Ocsm-kvstore.aliyuncs.com + jaqjaq.aliyuncs.com + Mscmsc-inner.aliyuncs.com + HighDDosyd-highddos-cn-hangzhou.aliyuncs.com + R-kvstorer-kvstore-cn-hangzhou.aliyuncs.com + Bssbss.aliyuncs.com + Ubsms-innerubsms-inner.aliyuncs.com + Dmdm.aliyuncs.com + Commondrivercommon.driver.aliyuncs.com + oceanbaseoceanbase.aliyuncs.com + Workorderworkorder.aliyuncs.com + Yundunhsmyundunhsm.aliyuncs.com + Iotiot.aliyuncs.com + Alertalert.aliyuncs.com + Omsoms.aliyuncs.com + livelive.aliyuncs.com + Ecsecs-cn-hangzhou.aliyuncs.com + Ubsmsubsms.aliyuncs.com + CmsSiteMonitorsitemonitor.aliyuncs.com + AMSams.aliyuncs.com + Crmcrm-cn-hangzhou.aliyuncs.com + PTSpts.aliyuncs.com + Qualitycheckqualitycheck.aliyuncs.com + M-kvstorem-kvstore.aliyuncs.com + Stssts.aliyuncs.com + Aceace.cn-hangzhou.aliyuncs.com + Mtsmts.cn-shenzhen.aliyuncs.com + CFcf.aliyuncs.com + Httpdnshttpdns-api.aliyuncs.com + Greengreen.aliyuncs.com + Aasaas.aliyuncs.com + Emremr.aliyuncs.com + CScs.aliyuncs.com + Drcdrc.aliyuncs.com + Pushcloudpush.aliyuncs.com + Cmsmetrics.aliyuncs.com + Slbslb.aliyuncs.com + YundunDdosinner-yundun-ddos.cn-hangzhou.aliyuncs.com + Dtsdts.aliyuncs.com + Domaindomain.aliyuncs.com + Otsots-pop.aliyuncs.com + ROSros.aliyuncs.com + Cdncdn.aliyuncs.com + Ramram.aliyuncs.com + Drdsdrds.aliyuncs.com + Rdsrds.aliyuncs.com + OssAdminoss-admin.aliyuncs.com + Location-innerlocation-inner.aliyuncs.com + Yundunyundun-cn-hangzhou.aliyuncs.com + Ossoss-cn-hangzhou.aliyuncs.com + + + + cn-fujian + + Ecsecs-cn-hangzhou.aliyuncs.com + Rdsrds.aliyuncs.com + + + + in-mumbai-alipay + + Ecsecs-cn-hangzhou.aliyuncs.com + + + + us-west-1 + + CScs.aliyuncs.com + COScos.aliyuncs.com + Essess.aliyuncs.com + Ace-opsace-ops.cn-hangzhou.aliyuncs.com + Billingbilling.aliyuncs.com + Dqsdqs.aliyuncs.com + Ddsmongodb.aliyuncs.com + Stssts.aliyuncs.com + Smssms.aliyuncs.com + Jaqjaq.aliyuncs.com + Pushcloudpush.aliyuncs.com + Alidnsalidns.aliyuncs.com + Locationlocation.aliyuncs.com + Msgmsg-inner.aliyuncs.com + ChargingServicechargingservice.aliyuncs.com + Ocsm-kvstore.aliyuncs.com + Bssbss.aliyuncs.com + Mscmsc-inner.aliyuncs.com + R-kvstorer-kvstore-cn-hangzhou.aliyuncs.com + Yundunyundun-cn-hangzhou.aliyuncs.com + Ubsms-innerubsms-inner.aliyuncs.com + Dmdm.aliyuncs.com + Greengreen.aliyuncs.com + Riskrisk-cn-hangzhou.aliyuncs.com + oceanbaseoceanbase.aliyuncs.com + Workorderworkorder.aliyuncs.com + Yundunhsmyundunhsm.aliyuncs.com + Iotiot.us-west-1.aliyuncs.com + Alertalert.aliyuncs.com + Omsoms.aliyuncs.com + livelive.aliyuncs.com + Ecsecs-cn-hangzhou.aliyuncs.com + M-kvstorem-kvstore.aliyuncs.com + Vpcvpc.aliyuncs.com + BatchComputebatchCompute.aliyuncs.com + Aceace.cn-hangzhou.aliyuncs.com + AMSams.aliyuncs.com + ROSros.aliyuncs.com + PTSpts.aliyuncs.com + Qualitycheckqualitycheck.aliyuncs.com + Ubsmsubsms.aliyuncs.com + HighDDosyd-highddos-cn-hangzhou.aliyuncs.com + CmsSiteMonitorsitemonitor.aliyuncs.com + Rdsrds.aliyuncs.com + Mtsmts.us-west-1.aliyuncs.com + CFcf.aliyuncs.com + Acsacs.aliyun-inc.com + Httpdnshttpdns-api.aliyuncs.com + Location-innerlocation-inner.aliyuncs.com + Aasaas.aliyuncs.com + Emremr.aliyuncs.com + HPChpc.aliyuncs.com + Drcdrc.aliyuncs.com + Vpc-innervpc-inner.aliyuncs.com + Cmsmetrics.cn-hangzhou.aliyuncs.com + Slbslb.aliyuncs.com + Crmcrm-cn-hangzhou.aliyuncs.com + Dtsdts.aliyuncs.com + Domaindomain.aliyuncs.com + Otsots-pop.aliyuncs.com + Commondrivercommon.driver.aliyuncs.com + jaqjaq.aliyuncs.com + Cdncdn.aliyuncs.com + Ramram.aliyuncs.com + Drdsdrds.aliyuncs.com + OssAdminoss-admin.aliyuncs.com + Salessales.cn-hangzhou.aliyuncs.com + Onsons.aliyuncs.com + Ossoss-us-west-1.aliyuncs.com + YundunDdosinner-yundun-ddos.cn-hangzhou.aliyuncs.com + + + + cn-shanghai-inner + + CScs.aliyuncs.com + COScos.aliyuncs.com + Essess.aliyuncs.com + Billingbilling.aliyuncs.com + Dqsdqs.aliyuncs.com + Ddsmongodb.aliyuncs.com + Emremr.aliyuncs.com + Smssms.aliyuncs.com + Drdsdrds.aliyuncs.com + HPChpc.aliyuncs.com + Locationlocation.aliyuncs.com + ChargingServicechargingservice.aliyuncs.com + Msgmsg-inner.aliyuncs.com + Commondrivercommon.driver.aliyuncs.com + R-kvstorer-kvstore-cn-hangzhou.aliyuncs.com + jaqjaq.aliyuncs.com + Mscmsc-inner.aliyuncs.com + Ocsm-kvstore.aliyuncs.com + Yundunyundun-cn-hangzhou.aliyuncs.com + Ubsms-innerubsms-inner.aliyuncs.com + Dmdm.aliyuncs.com + Greengreen.aliyuncs.com + Riskrisk-cn-hangzhou.aliyuncs.com + oceanbaseoceanbase.aliyuncs.com + Workorderworkorder.aliyuncs.com + Yundunhsmyundunhsm.aliyuncs.com + Iotiot.aliyuncs.com + Bssbss.aliyuncs.com + Omsoms.aliyuncs.com + livelive.aliyuncs.com + Ecsecs-cn-hangzhou.aliyuncs.com + M-kvstorem-kvstore.aliyuncs.com + CmsSiteMonitorsitemonitor.aliyuncs.com + Alertalert.aliyuncs.com + Aceace.cn-hangzhou.aliyuncs.com + AMSams.aliyuncs.com + ROSros.aliyuncs.com + PTSpts.aliyuncs.com + Qualitycheckqualitycheck.aliyuncs.com + Ubsmsubsms.aliyuncs.com + HighDDosyd-highddos-cn-hangzhou.aliyuncs.com + Rdsrds.aliyuncs.com + Mtsmts.cn-shanghai.aliyuncs.com + CFcf.aliyuncs.com + Httpdnshttpdns-api.aliyuncs.com + Location-innerlocation-inner.aliyuncs.com + Aasaas.aliyuncs.com + Stssts.aliyuncs.com + Dtsdts.aliyuncs.com + Drcdrc.aliyuncs.com + Pushcloudpush.aliyuncs.com + Cmsmetrics.aliyuncs.com + Slbslb.aliyuncs.com + YundunDdosinner-yundun-ddos.cn-hangzhou.aliyuncs.com + Domaindomain.aliyuncs.com + Otsots-pop.aliyuncs.com + Ossoss-cn-hangzhou.aliyuncs.com + Ramram.aliyuncs.com + Salessales.cn-hangzhou.aliyuncs.com + Crmcrm-cn-hangzhou.aliyuncs.com + OssAdminoss-admin.aliyuncs.com + Alidnsalidns.aliyuncs.com + Onsons.aliyuncs.com + Cdncdn.aliyuncs.com + + + + cn-anhui-gov-1 + + Ecsecs-cn-hangzhou.aliyuncs.com + + + + cn-hangzhou-finance + + Ossoss-cn-hzjbp-b-console.aliyuncs.com + + + + cn-hangzhou + + ARMSarms.cn-hangzhou.aliyuncs.com + CScs.aliyuncs.com + COScos.aliyuncs.com + Essess.aliyuncs.com + Ace-opsace-ops.cn-hangzhou.aliyuncs.com + Billingbilling.aliyuncs.com + Dqsdqs.aliyuncs.com + Ddsmongodb.aliyuncs.com + Stssts.aliyuncs.com + Smssms.aliyuncs.com + Msgmsg-inner.aliyuncs.com + Jaqjaq.aliyuncs.com + Pushcloudpush.aliyuncs.com + Livelive.aliyuncs.com + Kmskms.cn-hangzhou.aliyuncs.com + Locationlocation.aliyuncs.com + Hpchpc.aliyuncs.com + ChargingServicechargingservice.aliyuncs.com + R-kvstorer-kvstore-cn-hangzhou.aliyuncs.com + Alertalert.aliyuncs.com + Mscmsc-inner.aliyuncs.com + Drcdrc.aliyuncs.com + Yundunyundun-cn-hangzhou.aliyuncs.com + Ubsms-innerubsms-inner.aliyuncs.com + Ocsm-kvstore.aliyuncs.com + Dmdm.aliyuncs.com + Greengreen.cn-hangzhou.aliyuncs.com + Commondrivercommon.driver.aliyuncs.com + oceanbaseoceanbase.aliyuncs.com + Workorderworkorder.aliyuncs.com + Yundunhsmyundunhsm.aliyuncs.com + Iotiot.aliyuncs.com + jaqjaq.aliyuncs.com + Omsoms.aliyuncs.com + livelive.aliyuncs.com + Ecsecs-cn-hangzhou.aliyuncs.com + M-kvstorem-kvstore.aliyuncs.com + Vpcvpc.aliyuncs.com + BatchComputebatchCompute.aliyuncs.com + Domaindomain.aliyuncs.com + AMSams.aliyuncs.com + ROSros.aliyuncs.com + PTSpts.aliyuncs.com + Qualitycheckqualitycheck.aliyuncs.com + Ubsmsubsms.aliyuncs.com + Apigatewayapigateway.cn-hangzhou.aliyuncs.com + CloudAPIapigateway.cn-hangzhou.aliyuncs.com + CmsSiteMonitorsitemonitor.aliyuncs.com + Aceace.cn-hangzhou.aliyuncs.com + Mtsmts.cn-hangzhou.aliyuncs.com + Oascn-hangzhou.oas.aliyuncs.com + CFcf.aliyuncs.com + Acsacs.aliyun-inc.com + Httpdnshttpdns-api.aliyuncs.com + Location-innerlocation-inner.aliyuncs.com + Aasaas.aliyuncs.com + Alidnsalidns.aliyuncs.com + HPChpc.aliyuncs.com + Emremr.aliyuncs.com + HighDDosyd-highddos-cn-hangzhou.aliyuncs.com + Vpc-innervpc-inner.aliyuncs.com + Cmsmetrics.cn-hangzhou.aliyuncs.com + Slbslb.aliyuncs.com + Riskrisk-cn-hangzhou.aliyuncs.com + Dtsdts.aliyuncs.com + Bssbss.aliyuncs.com + Otsots-pop.aliyuncs.com + Cdncdn.aliyuncs.com + Ramram.aliyuncs.com + Drdsdrds.aliyuncs.com + Rdsrds.aliyuncs.com + Crmcrm-cn-hangzhou.aliyuncs.com + OssAdminoss-admin.aliyuncs.com + Salessales.cn-hangzhou.aliyuncs.com + Onsons.aliyuncs.com + Ossoss-cn-hangzhou.aliyuncs.com + YundunDdosinner-yundun-ddos.cn-hangzhou.aliyuncs.com + + + + cn-beijing-inner + + Riskrisk-cn-hangzhou.aliyuncs.com + COScos.aliyuncs.com + HPChpc.aliyuncs.com + Billingbilling.aliyuncs.com + Dqsdqs.aliyuncs.com + Ddsmongodb.aliyuncs.com + Emremr.aliyuncs.com + Smssms.aliyuncs.com + Drdsdrds.aliyuncs.com + CScs.aliyuncs.com + Locationlocation.aliyuncs.com + ChargingServicechargingservice.aliyuncs.com + Msgmsg-inner.aliyuncs.com + Essess.aliyuncs.com + R-kvstorer-kvstore-cn-hangzhou.aliyuncs.com + Bssbss.aliyuncs.com + Workorderworkorder.aliyuncs.com + Drcdrc.aliyuncs.com + Yundunyundun-cn-hangzhou.aliyuncs.com + Ubsms-innerubsms-inner.aliyuncs.com + Ocsm-kvstore.aliyuncs.com + Dmdm.aliyuncs.com + YundunDdosinner-yundun-ddos.cn-hangzhou.aliyuncs.com + oceanbaseoceanbase.aliyuncs.com + Mscmsc-inner.aliyuncs.com + Yundunhsmyundunhsm.aliyuncs.com + Iotiot.aliyuncs.com + jaqjaq.aliyuncs.com + Omsoms.aliyuncs.com + M-kvstorem-kvstore.aliyuncs.com + livelive.aliyuncs.com + Ecsecs-cn-hangzhou.aliyuncs.com + Alertalert.aliyuncs.com + CmsSiteMonitorsitemonitor.aliyuncs.com + Aceace.cn-hangzhou.aliyuncs.com + AMSams.aliyuncs.com + Otsots-pop.aliyuncs.com + PTSpts.aliyuncs.com + Qualitycheckqualitycheck.aliyuncs.com + Ubsmsubsms.aliyuncs.com + Stssts.aliyuncs.com + Rdsrds.aliyuncs.com + Mtsmts.cn-beijing.aliyuncs.com + Location-innerlocation-inner.aliyuncs.com + CFcf.aliyuncs.com + Httpdnshttpdns-api.aliyuncs.com + Greengreen.aliyuncs.com + Aasaas.aliyuncs.com + Alidnsalidns.aliyuncs.com + Pushcloudpush.aliyuncs.com + HighDDosyd-highddos-cn-hangzhou.aliyuncs.com + Cmsmetrics.aliyuncs.com + Slbslb.aliyuncs.com + Commondrivercommon.driver.aliyuncs.com + Dtsdts.aliyuncs.com + Domaindomain.aliyuncs.com + ROSros.aliyuncs.com + Ossoss-cn-hangzhou.aliyuncs.com + Ramram.aliyuncs.com + Salessales.cn-hangzhou.aliyuncs.com + Crmcrm-cn-hangzhou.aliyuncs.com + OssAdminoss-admin.aliyuncs.com + Onsons.aliyuncs.com + Cdncdn.aliyuncs.com + + + + cn-haidian-cm12-c01 + + Ecsecs-cn-hangzhou.aliyuncs.com + Vpcvpc.aliyuncs.com + Rdsrds.aliyuncs.com + + + + cn-anhui-gov + + Ecsecs-cn-hangzhou.aliyuncs.com + Vpcvpc.aliyuncs.com + + + + cn-shenzhen + + ARMSarms.cn-shenzhen.aliyuncs.com + CScs.aliyuncs.com + COScos.aliyuncs.com + Onsons.aliyuncs.com + Essess.aliyuncs.com + Dqsdqs.aliyuncs.com + Ddsmongodb.aliyuncs.com + Alidnsalidns.aliyuncs.com + Smssms.aliyuncs.com + Jaqjaq.aliyuncs.com + Pushcloudpush.aliyuncs.com + Kmskms.cn-shenzhen.aliyuncs.com + Locationlocation.aliyuncs.com + Ocsm-kvstore.aliyuncs.com + Alertalert.aliyuncs.com + Drcdrc.aliyuncs.com + R-kvstorer-kvstore-cn-hangzhou.aliyuncs.com + Yundunyundun-cn-hangzhou.aliyuncs.com + Ubsms-innerubsms-inner.aliyuncs.com + Dmdm.aliyuncs.com + Commondrivercommon.driver.aliyuncs.com + oceanbaseoceanbase.aliyuncs.com + Iotiot.aliyuncs.com + HPChpc.aliyuncs.com + Bssbss.aliyuncs.com + Omsoms.aliyuncs.com + Ubsmsubsms.aliyuncs.com + livelive.aliyuncs.com + Ecsecs-cn-hangzhou.aliyuncs.com + M-kvstorem-kvstore.aliyuncs.com + CmsSiteMonitorsitemonitor.aliyuncs.com + BatchComputebatchcompute.cn-shenzhen.aliyuncs.com + Aceace.cn-hangzhou.aliyuncs.com + ROSros.aliyuncs.com + PTSpts.aliyuncs.com + Ace-opsace-ops.cn-hangzhou.aliyuncs.com + Apigatewayapigateway.cn-shenzhen.aliyuncs.com + CloudAPIapigateway.cn-shenzhen.aliyuncs.com + Stssts.aliyuncs.com + Vpcvpc.aliyuncs.com + Rdsrds.aliyuncs.com + Mtsmts.cn-shenzhen.aliyuncs.com + Oascn-shenzhen.oas.aliyuncs.com + CFcf.aliyuncs.com + Acsacs.aliyun-inc.com + Crmcrm-cn-hangzhou.aliyuncs.com + Location-innerlocation-inner.aliyuncs.com + Aasaas.aliyuncs.com + Emremr.aliyuncs.com + Dtsdts.aliyuncs.com + HighDDosyd-highddos-cn-hangzhou.aliyuncs.com + Vpc-innervpc-inner.aliyuncs.com + Cmsmetrics.cn-hangzhou.aliyuncs.com + Slbslb.aliyuncs.com + Riskrisk-cn-hangzhou.aliyuncs.com + Domaindomain.aliyuncs.com + Otsots-pop.aliyuncs.com + jaqjaq.aliyuncs.com + Cdncdn.aliyuncs.com + Ramram.aliyuncs.com + Drdsdrds.aliyuncs.com + OssAdminoss-admin.aliyuncs.com + Greengreen.aliyuncs.com + Httpdnshttpdns-api.aliyuncs.com + Ossoss-cn-shenzhen.aliyuncs.com + + + + ap-southeast-2 + + Rdsrds.ap-southeast-2.aliyuncs.com + Kmskms.ap-southeast-2.aliyuncs.com + Vpcvpc.ap-southeast-2.aliyuncs.com + Ecsecs.ap-southeast-2.aliyuncs.com + Cmsmetrics.cn-hangzhou.aliyuncs.com + Slbslb.ap-southeast-2.aliyuncs.com + + + + cn-qingdao + + CScs.aliyuncs.com + COScos.aliyuncs.com + HPChpc.aliyuncs.com + Dqsdqs.aliyuncs.com + Ddsmongodb.aliyuncs.com + Emremr.cn-qingdao.aliyuncs.com + Smssms.aliyuncs.com + Jaqjaq.aliyuncs.com + Dtsdts.aliyuncs.com + Locationlocation.aliyuncs.com + Essess.aliyuncs.com + R-kvstorer-kvstore-cn-hangzhou.aliyuncs.com + Alertalert.aliyuncs.com + Drcdrc.aliyuncs.com + Yundunyundun-cn-hangzhou.aliyuncs.com + Ubsms-innerubsms-inner.cn-qingdao.aliyuncs.com + Ocsm-kvstore.aliyuncs.com + Dmdm.aliyuncs.com + Riskrisk-cn-hangzhou.aliyuncs.com + oceanbaseoceanbase.aliyuncs.com + Iotiot.aliyuncs.com + Bssbss.aliyuncs.com + Omsoms.aliyuncs.com + Ubsmsubsms.cn-qingdao.aliyuncs.com + livelive.aliyuncs.com + Ecsecs-cn-hangzhou.aliyuncs.com + M-kvstorem-kvstore.aliyuncs.com + CmsSiteMonitorsitemonitor.aliyuncs.com + BatchComputebatchcompute.cn-qingdao.aliyuncs.com + Aceace.cn-hangzhou.aliyuncs.com + Otsots-pop.aliyuncs.com + PTSpts.aliyuncs.com + Ace-opsace-ops.cn-hangzhou.aliyuncs.com + Apigatewayapigateway.cn-qingdao.aliyuncs.com + CloudAPIapigateway.cn-qingdao.aliyuncs.com + Stssts.aliyuncs.com + Rdsrds.aliyuncs.com + Mtsmts.cn-qingdao.aliyuncs.com + Location-innerlocation-inner.aliyuncs.com + CFcf.aliyuncs.com + Acsacs.aliyun-inc.com + Httpdnshttpdns-api.aliyuncs.com + Greengreen.aliyuncs.com + Aasaas.aliyuncs.com + Alidnsalidns.aliyuncs.com + Pushcloudpush.aliyuncs.com + HighDDosyd-highddos-cn-hangzhou.aliyuncs.com + Vpc-innervpc-inner.aliyuncs.com + Cmsmetrics.cn-hangzhou.aliyuncs.com + Slbslb.aliyuncs.com + Commondrivercommon.driver.aliyuncs.com + Domaindomain.aliyuncs.com + ROSros.aliyuncs.com + jaqjaq.aliyuncs.com + Cdncdn.aliyuncs.com + Ramram.aliyuncs.com + Drdsdrds.aliyuncs.com + Crmcrm-cn-hangzhou.aliyuncs.com + OssAdminoss-admin.aliyuncs.com + Onsons.aliyuncs.com + Ossoss-cn-qingdao.aliyuncs.com + + + + cn-shenzhen-su18-b02 + + Ecsecs-cn-hangzhou.aliyuncs.com + + + + cn-shenzhen-su18-b03 + + Ecsecs-cn-hangzhou.aliyuncs.com + + + + cn-shenzhen-su18-b01 + + Ecsecs-cn-hangzhou.aliyuncs.com + + + + ap-southeast-antgroup-1 + + Ecsecs-cn-hangzhou.aliyuncs.com + + + + oss-cn-bjzwy + + Ossoss-cn-bjzwy.aliyuncs.com + + + + cn-henan-am12001 + + Ecsecs-cn-hangzhou.aliyuncs.com + Vpcvpc.aliyuncs.com + + + + cn-beijing + + ARMSarms.cn-beijing.aliyuncs.com + CScs.aliyuncs.com + COScos.aliyuncs.com + Jaqjaq.aliyuncs.com + Essess.aliyuncs.com + Billingbilling.aliyuncs.com + Dqsdqs.aliyuncs.com + Ddsmongodb.aliyuncs.com + Stssts.aliyuncs.com + Smssms.aliyuncs.com + Msgmsg-inner.aliyuncs.com + Salessales.cn-hangzhou.aliyuncs.com + HPChpc.aliyuncs.com + Oascn-beijing.oas.aliyuncs.com + Locationlocation.aliyuncs.com + Onsons.aliyuncs.com + ChargingServicechargingservice.aliyuncs.com + Hpchpc.aliyuncs.com + Commondrivercommon.driver.aliyuncs.com + Ocsm-kvstore.aliyuncs.com + jaqjaq.aliyuncs.com + Workorderworkorder.aliyuncs.com + R-kvstorer-kvstore-cn-hangzhou.aliyuncs.com + Bssbss.aliyuncs.com + Ubsms-innerubsms-inner.aliyuncs.com + Dmdm.aliyuncs.com + Riskrisk-cn-hangzhou.aliyuncs.com + oceanbaseoceanbase.aliyuncs.com + Mscmsc-inner.aliyuncs.com + Yundunhsmyundunhsm.aliyuncs.com + Iotiot.aliyuncs.com + Alertalert.aliyuncs.com + Omsoms.aliyuncs.com + Ubsmsubsms.aliyuncs.com + livelive.aliyuncs.com + Ecsecs-cn-hangzhou.aliyuncs.com + Ace-opsace-ops.cn-hangzhou.aliyuncs.com + Vpcvpc.aliyuncs.com + BatchComputebatchCompute.aliyuncs.com + AMSams.aliyuncs.com + ROSros.aliyuncs.com + PTSpts.aliyuncs.com + M-kvstorem-kvstore.aliyuncs.com + Apigatewayapigateway.cn-beijing.aliyuncs.com + CloudAPIapigateway.cn-beijing.aliyuncs.com + Kmskms.cn-beijing.aliyuncs.com + HighDDosyd-highddos-cn-hangzhou.aliyuncs.com + CmsSiteMonitorsitemonitor.aliyuncs.com + Aceace.cn-hangzhou.aliyuncs.com + Mtsmts.cn-beijing.aliyuncs.com + CFcf.aliyuncs.com + Acsacs.aliyun-inc.com + Httpdnshttpdns-api.aliyuncs.com + Location-innerlocation-inner.aliyuncs.com + Aasaas.aliyuncs.com + Emremr.aliyuncs.com + Dtsdts.aliyuncs.com + Drcdrc.aliyuncs.com + Pushcloudpush.aliyuncs.com + Cmsmetrics.cn-hangzhou.aliyuncs.com + Slbslb.aliyuncs.com + Crmcrm-cn-hangzhou.aliyuncs.com + Domaindomain.aliyuncs.com + Otsots-pop.aliyuncs.com + Ossoss-cn-beijing.aliyuncs.com + Ramram.aliyuncs.com + Drdsdrds.aliyuncs.com + Vpc-innervpc-inner.aliyuncs.com + Rdsrds.aliyuncs.com + OssAdminoss-admin.aliyuncs.com + Alidnsalidns.aliyuncs.com + Greengreen.aliyuncs.com + Yundunyundun-cn-hangzhou.aliyuncs.com + Cdncdn.aliyuncs.com + YundunDdosinner-yundun-ddos.cn-hangzhou.aliyuncs.com + vodvod.cn-beijing.aliyuncs.com + + + + cn-hangzhou-d + + CScs.aliyuncs.com + COScos.aliyuncs.com + Essess.aliyuncs.com + Billingbilling.aliyuncs.com + Dqsdqs.aliyuncs.com + Ddsmongodb.aliyuncs.com + Emremr.aliyuncs.com + Smssms.aliyuncs.com + Salessales.cn-hangzhou.aliyuncs.com + Dtsdts.aliyuncs.com + Locationlocation.aliyuncs.com + Msgmsg-inner.aliyuncs.com + ChargingServicechargingservice.aliyuncs.com + R-kvstorer-kvstore-cn-hangzhou.aliyuncs.com + Bssbss.aliyuncs.com + Mscmsc-inner.aliyuncs.com + Ocsm-kvstore.aliyuncs.com + Yundunyundun-cn-hangzhou.aliyuncs.com + Ubsms-innerubsms-inner.aliyuncs.com + Dmdm.aliyuncs.com + Riskrisk-cn-hangzhou.aliyuncs.com + oceanbaseoceanbase.aliyuncs.com + Workorderworkorder.aliyuncs.com + Alidnsalidns.aliyuncs.com + Iotiot.aliyuncs.com + HPChpc.aliyuncs.com + jaqjaq.aliyuncs.com + Omsoms.aliyuncs.com + livelive.aliyuncs.com + Ecsecs-cn-hangzhou.aliyuncs.com + M-kvstorem-kvstore.aliyuncs.com + CmsSiteMonitorsitemonitor.aliyuncs.com + Alertalert.aliyuncs.com + Aceace.cn-hangzhou.aliyuncs.com + AMSams.aliyuncs.com + Otsots-pop.aliyuncs.com + PTSpts.aliyuncs.com + Qualitycheckqualitycheck.aliyuncs.com + Ubsmsubsms.aliyuncs.com + Rdsrds.aliyuncs.com + Mtsmts.cn-hangzhou.aliyuncs.com + Location-innerlocation-inner.aliyuncs.com + CFcf.aliyuncs.com + Httpdnshttpdns-api.aliyuncs.com + Greengreen.aliyuncs.com + Aasaas.aliyuncs.com + Stssts.aliyuncs.com + Pushcloudpush.aliyuncs.com + HighDDosyd-highddos-cn-hangzhou.aliyuncs.com + Cmsmetrics.aliyuncs.com + Slbslb.aliyuncs.com + YundunDdosinner-yundun-ddos.cn-hangzhou.aliyuncs.com + Domaindomain.aliyuncs.com + Commondrivercommon.driver.aliyuncs.com + ROSros.aliyuncs.com + Cdncdn.aliyuncs.com + Ramram.aliyuncs.com + Drdsdrds.aliyuncs.com + Crmcrm-cn-hangzhou.aliyuncs.com + OssAdminoss-admin.aliyuncs.com + Onsons.aliyuncs.com + Yundunhsmyundunhsm.aliyuncs.com + Drcdrc.aliyuncs.com + Ossoss-cn-hangzhou.aliyuncs.com + + + + cn-gansu-am6 + + Ecsecs-cn-hangzhou.aliyuncs.com + Vpcvpc.aliyuncs.com + Rdsrds.aliyuncs.com + + + + cn-ningxiazhongwei + + Ecsecs-cn-hangzhou.aliyuncs.com + Vpcvpc.aliyuncs.com + + + + cn-shanghai-et2-b01 + + CScs.aliyuncs.com + Riskrisk-cn-hangzhou.aliyuncs.com + COScos.aliyuncs.com + Onsons.aliyuncs.com + Essess.aliyuncs.com + Billingbilling.aliyuncs.com + Dqsdqs.aliyuncs.com + Ddsmongodb.aliyuncs.com + Alidnsalidns.aliyuncs.com + Smssms.aliyuncs.com + Jaqjaq.aliyuncs.com + Dtsdts.aliyuncs.com + Locationlocation.aliyuncs.com + Msgmsg-inner.aliyuncs.com + ChargingServicechargingservice.aliyuncs.com + Ocsm-kvstore.aliyuncs.com + Bssbss.aliyuncs.com + Mscmsc-inner.aliyuncs.com + R-kvstorer-kvstore-cn-hangzhou.aliyuncs.com + Yundunyundun-cn-hangzhou.aliyuncs.com + Ubsms-innerubsms-inner.aliyuncs.com + Dmdm.aliyuncs.com + Commondrivercommon.driver.aliyuncs.com + oceanbaseoceanbase.aliyuncs.com + Workorderworkorder.aliyuncs.com + Yundunhsmyundunhsm.aliyuncs.com + Iotiot.aliyuncs.com + jaqjaq.aliyuncs.com + Omsoms.aliyuncs.com + Ubsmsubsms.aliyuncs.com + livelive.aliyuncs.com + Ecsecs-cn-hangzhou.aliyuncs.com + Ace-opsace-ops.cn-hangzhou.aliyuncs.com + CmsSiteMonitorsitemonitor.aliyuncs.com + BatchComputebatchCompute.aliyuncs.com + Aceace.cn-hangzhou.aliyuncs.com + AMSams.aliyuncs.com + Otsots-pop.aliyuncs.com + PTSpts.aliyuncs.com + Qualitycheckqualitycheck.aliyuncs.com + M-kvstorem-kvstore.aliyuncs.com + Rdsrds.aliyuncs.com + Mtsmts.cn-hangzhou.aliyuncs.com + CFcf.aliyuncs.com + Acsacs.aliyun-inc.com + Httpdnshttpdns-api.aliyuncs.com + Location-innerlocation-inner.aliyuncs.com + Aasaas.aliyuncs.com + Stssts.aliyuncs.com + HPChpc.aliyuncs.com + Emremr.aliyuncs.com + HighDDosyd-highddos-cn-hangzhou.aliyuncs.com + Pushcloudpush.aliyuncs.com + Cmsmetrics.aliyuncs.com + Slbslb.aliyuncs.com + Crmcrm-cn-hangzhou.aliyuncs.com + Alertalert.aliyuncs.com + Domaindomain.aliyuncs.com + ROSros.aliyuncs.com + Cdncdn.aliyuncs.com + Ramram.aliyuncs.com + Drdsdrds.aliyuncs.com + Vpc-innervpc-inner.aliyuncs.com + OssAdminoss-admin.aliyuncs.com + Salessales.cn-hangzhou.aliyuncs.com + Greengreen.aliyuncs.com + Drcdrc.aliyuncs.com + Ossoss-cn-hangzhou.aliyuncs.com + YundunDdosinner-yundun-ddos.cn-hangzhou.aliyuncs.com + + + + cn-ningxia-am7-c01 + + Ecsecs-cn-hangzhou.aliyuncs.com + Vpcvpc.aliyuncs.com + + + + cn-shenzhen-finance-1 + + Kmskms.cn-shenzhen-finance-1.aliyuncs.com + Ecsecs-cn-hangzhou.aliyuncs.com + Rdsrds.aliyuncs.com + Vpcvpc.aliyuncs.com + + + + ap-southeast-1 + + CScs.aliyuncs.com + Riskrisk-cn-hangzhou.aliyuncs.com + COScos.aliyuncs.com + Essess.aliyuncs.com + Billingbilling.aliyuncs.com + Dqsdqs.aliyuncs.com + Ddsmongodb.aliyuncs.com + Alidnsalidns.aliyuncs.com + Smssms.aliyuncs.com + Drdsdrds.aliyuncs.com + Dtsdts.aliyuncs.com + Kmskms.ap-southeast-1.aliyuncs.com + Locationlocation.aliyuncs.com + Msgmsg-inner.aliyuncs.com + ChargingServicechargingservice.aliyuncs.com + R-kvstorer-kvstore-cn-hangzhou.aliyuncs.com + Alertalert.aliyuncs.com + Mscmsc-inner.aliyuncs.com + HighDDosyd-highddos-cn-hangzhou.aliyuncs.com + Yundunyundun-cn-hangzhou.aliyuncs.com + Ubsms-innerubsms-inner.aliyuncs.com + Ocsm-kvstore.aliyuncs.com + Dmdm.aliyuncs.com + Greengreen.aliyuncs.com + Commondrivercommon.driver.aliyuncs.com + oceanbaseoceanbase.aliyuncs.com + Workorderworkorder.aliyuncs.com + Yundunhsmyundunhsm.aliyuncs.com + Iotiot.ap-southeast-1.aliyuncs.com + HPChpc.aliyuncs.com + jaqjaq.aliyuncs.com + Omsoms.aliyuncs.com + livelive.aliyuncs.com + Ecsecs-cn-hangzhou.aliyuncs.com + M-kvstorem-kvstore.aliyuncs.com + Vpcvpc.aliyuncs.com + BatchComputebatchCompute.aliyuncs.com + AMSams.aliyuncs.com + ROSros.aliyuncs.com + PTSpts.aliyuncs.com + Qualitycheckqualitycheck.aliyuncs.com + Bssbss.aliyuncs.com + Ubsmsubsms.aliyuncs.com + Apigatewayapigateway.ap-southeast-1.aliyuncs.com + CloudAPIapigateway.ap-southeast-1.aliyuncs.com + Stssts.aliyuncs.com + CmsSiteMonitorsitemonitor.aliyuncs.com + Aceace.cn-hangzhou.aliyuncs.com + Mtsmts.ap-southeast-1.aliyuncs.com + CFcf.aliyuncs.com + Crmcrm-cn-hangzhou.aliyuncs.com + Location-innerlocation-inner.aliyuncs.com + Aasaas.aliyuncs.com + Emremr.aliyuncs.com + Httpdnshttpdns-api.aliyuncs.com + Drcdrc.aliyuncs.com + Pushcloudpush.aliyuncs.com + Cmsmetrics.cn-hangzhou.aliyuncs.com + Slbslb.aliyuncs.com + YundunDdosinner-yundun-ddos.cn-hangzhou.aliyuncs.com + Domaindomain.aliyuncs.com + Otsots-pop.aliyuncs.com + Cdncdn.aliyuncs.com + Ramram.aliyuncs.com + Salessales.cn-hangzhou.aliyuncs.com + Rdsrds.aliyuncs.com + OssAdminoss-admin.aliyuncs.com + Onsons.aliyuncs.com + Ossoss-ap-southeast-1.aliyuncs.com + + + + cn-shenzhen-st4-d01 + + Ecsecs-cn-hangzhou.aliyuncs.com + + + + eu-central-1 + + Rdsrds.eu-central-1.aliyuncs.com + Ecsecs.eu-central-1.aliyuncs.com + Vpcvpc.eu-central-1.aliyuncs.com + Kmskms.eu-central-1.aliyuncs.com + Cmsmetrics.cn-hangzhou.aliyuncs.com + Slbslb.eu-central-1.aliyuncs.com + + + + cn-zhangjiakou + + Rdsrds.cn-zhangjiakou.aliyuncs.com + Ecsecs.cn-zhangjiakou.aliyuncs.com + Vpcvpc.cn-zhangjiakou.aliyuncs.com + Cmsmetrics.cn-hangzhou.aliyuncs.com + Slbslb.cn-zhangjiakou.aliyuncs.com + + + diff --git a/extend/aliyun-php-sdk-core/RoaAcsRequest.php b/extend/aliyun-php-sdk-core/RoaAcsRequest.php new file mode 100644 index 0000000..724f29a --- /dev/null +++ b/extend/aliyun-php-sdk-core/RoaAcsRequest.php @@ -0,0 +1,206 @@ +setVersion($version); + $this->initialize(); + } + + private function initialize() + { + $this->setMethod("RAW"); + } + + public function composeUrl($iSigner, $credential, $domain) + { + $this->prepareHeader($iSigner, $credential); + + $signString = $this->getMethod().self::$headerSeparator; + if (isset($this->headers["Accept"])) { + $signString = $signString.$this->headers["Accept"]; + } + $signString = $signString.self::$headerSeparator; + + if (isset($this->headers["Content-MD5"])) { + $signString = $signString.$this->headers["Content-MD5"]; + } + $signString = $signString.self::$headerSeparator; + + if (isset($this->headers["Content-Type"])) { + $signString = $signString.$this->headers["Content-Type"]; + } + $signString = $signString.self::$headerSeparator; + + if (isset($this->headers["Date"])) { + $signString = $signString.$this->headers["Date"]; + } + $signString = $signString.self::$headerSeparator; + + $uri = $this->replaceOccupiedParameters(); + $signString = $signString.$this->buildCanonicalHeaders(); + $queryString = $this->buildQueryString($uri); + $signString .= $queryString; + $this->headers["Authorization"] = "acs ".$credential->getAccessKeyId().":" + .$iSigner->signString($signString, $credential->getAccessSecret()); + $requestUrl = $this->getProtocol()."://".$domain.$queryString; + return $requestUrl; + } + + private function prepareHeader($iSigner, $credential) + { + $this->headers["Date"] = gmdate($this->dateTimeFormat); + if (null == $this->acceptFormat) { + $this->acceptFormat = "RAW"; + } + $this->headers["Accept"] = $this->formatToAccept($this->getAcceptFormat()); + $this->headers["x-acs-signature-method"] = $iSigner->getSignatureMethod(); + $this->headers["x-acs-signature-version"] = $iSigner->getSignatureVersion(); + $this->headers["x-acs-region-id"] = $this->regionId; + $content = $this->getDomainParameter(); + if ($content != null) { + $this->headers["Content-MD5"] = base64_encode(md5(json_encode($content), true)); + } + $this->headers["Content-Type"] = "application/octet-stream;charset=utf-8"; + if ($credential->getSecurityToken() != null) { + $this->headers["x-acs-security-token"] = $credential->getSecurityToken(); + } + } + + private function replaceOccupiedParameters() + { + $result = $this->uriPattern; + foreach ($this->pathParameters as $pathParameterKey => $apiParameterValue) { + $target = "[".$pathParameterKey."]"; + $result = str_replace($target, $apiParameterValue, $result); + } + return $result; + } + + private function buildCanonicalHeaders() + { + $sortMap = array(); + foreach ($this->headers as $headerKey => $headerValue) { + $key = strtolower($headerKey); + if (strpos($key, "x-acs-") === 0) { + $sortMap[$key] = $headerValue; + } + } + ksort($sortMap); + $headerString = ""; + foreach ($sortMap as $sortMapKey => $sortMapValue) { + $headerString = $headerString.$sortMapKey.":".$sortMapValue.self::$headerSeparator; + } + return $headerString; + } + + private function splitSubResource($uri) + { + $queIndex = strpos($uri, "?"); + $uriParts = array(); + if (null != $queIndex) { + array_push($uriParts, substr($uri, 0, $queIndex)); + array_push($uriParts, substr($uri, $queIndex+1)); + } else { + array_push($uriParts, $uri); + } + return $uriParts; + } + + private function buildQueryString($uri) + { + $uriParts = $this->splitSubResource($uri); + $sortMap = $this->queryParameters; + if (isset($uriParts[1])) { + $sortMap[$uriParts[1]] = null; + } + $queryString = $uriParts[0]; + if (count($uriParts)) { + $queryString = $queryString."?"; + } + ksort($sortMap); + foreach ($sortMap as $sortMapKey => $sortMapValue) { + $queryString = $queryString.$sortMapKey; + if (isset($sortMapValue)) { + $queryString = $queryString."=".$sortMapValue; + } + $queryString = $queryString.self::$querySeprator; + } + if (0 < count($sortMap)) { + $queryString = substr($queryString, 0, strlen($queryString)-1); + } + return $queryString; + } + + private function formatToAccept($acceptFormat) + { + if ($acceptFormat == "JSON") { + return "application/json"; + } elseif ($acceptFormat == "XML") { + return "application/xml"; + } + return "application/octet-stream"; + } + + public function getPathParameters() + { + return $this->pathParameters; + } + + public function putPathParameter($name, $value) + { + $this->pathParameters[$name] = $value; + } + + public function getDomainParameter() + { + return $this->domainParameters; + } + + public function putDomainParameters($name, $value) + { + $this->domainParameters[$name] = $value; + } + + public function getUriPattern() + { + return $this->uriPattern; + } + + public function setUriPattern($uriPattern) + { + return $this->uriPattern = $uriPattern; + } + + public function setVersion($version) + { + $this->version = $version; + $this->headers["x-acs-version"] = $version; + } +} diff --git a/extend/aliyun-php-sdk-core/RpcAcsRequest.php b/extend/aliyun-php-sdk-core/RpcAcsRequest.php new file mode 100644 index 0000000..a5318f8 --- /dev/null +++ b/extend/aliyun-php-sdk-core/RpcAcsRequest.php @@ -0,0 +1,116 @@ +initialize(); + } + + private function initialize() + { + $this->setMethod("GET"); + $this->setAcceptFormat("JSON"); + } + + private function prepareValue($value) + { + if (is_bool($value)) { + if ($value) { + return "true"; + } else { + return "false"; + } + } else { + return $value; + } + } + + public function composeUrl($iSigner, $credential, $domain) + { + $apiParams = parent::getQueryParameters(); + foreach ($apiParams as $key => $value) { + $apiParams[$key] = $this->prepareValue($value); + } + $apiParams["RegionId"] = $this->getRegionId(); + $apiParams["AccessKeyId"] = $credential->getAccessKeyId(); + $apiParams["Format"] = $this->getAcceptFormat(); + $apiParams["SignatureMethod"] = $iSigner->getSignatureMethod(); + $apiParams["SignatureVersion"] = $iSigner->getSignatureVersion(); + $apiParams["SignatureNonce"] = md5(uniqid(mt_rand(), true)); + $apiParams["Timestamp"] = gmdate($this->dateTimeFormat); + $apiParams["Action"] = $this->getActionName(); + $apiParams["Version"] = $this->getVersion(); + if ($credential->getSecurityToken() != null) { + $apiParams["SecurityToken"] = $credential->getSecurityToken(); + } + $apiParams["Signature"] = $this->computeSignature($apiParams, $credential->getAccessSecret(), $iSigner); + if (parent::getMethod() == "POST") { + $requestUrl = $this->getProtocol()."://". $domain . "/"; + foreach ($apiParams as $apiParamKey => $apiParamValue) { + $this->putDomainParameters($apiParamKey, $apiParamValue); + } + return $requestUrl; + } else { + $requestUrl = $this->getProtocol()."://". $domain . "/?"; + + foreach ($apiParams as $apiParamKey => $apiParamValue) { + $requestUrl .= "$apiParamKey=" . urlencode($apiParamValue) . "&"; + } + return substr($requestUrl, 0, -1); + } + } + + private function computeSignature($parameters, $accessKeySecret, $iSigner) + { + ksort($parameters); + $canonicalizedQueryString = ''; + foreach ($parameters as $key => $value) { + $canonicalizedQueryString .= '&' . $this->percentEncode($key). '=' . $this->percentEncode($value); + } + $stringToSign = parent::getMethod().'&%2F&' . $this->percentencode(substr($canonicalizedQueryString, 1)); + $signature = $iSigner->signString($stringToSign, $accessKeySecret."&"); + + return $signature; + } + + protected function percentEncode($str) + { + $res = urlencode($str); + $res = preg_replace('/\+/', '%20', $res); + $res = preg_replace('/\*/', '%2A', $res); + $res = preg_replace('/%7E/', '~', $res); + return $res; + } + + public function getDomainParameter() + { + return $this->domainParameters; + } + + public function putDomainParameters($name, $value) + { + $this->domainParameters[$name] = $value; + } +} diff --git a/extend/aliyun-php-sdk-core/UnitTest/Auth/CredentialTest.php b/extend/aliyun-php-sdk-core/UnitTest/Auth/CredentialTest.php new file mode 100644 index 0000000..5144140 --- /dev/null +++ b/extend/aliyun-php-sdk-core/UnitTest/Auth/CredentialTest.php @@ -0,0 +1,35 @@ +assertEquals("accessKeyId", $credential->getAccessKeyId()); + $this->assertEquals("accessSecret", $credential->getAccessSecret()); + $this->assertNotNull($credential->getRefreshDate()); + + $dateNow = date("Y-m-d\TH:i:s\Z"); + $credential->setExpiredDate(1); + $this->assertNotNull($credential->getExpiredDate()); + $this->assertTrue($credential->getExpiredDate() > $dateNow); + } +} diff --git a/extend/aliyun-php-sdk-core/UnitTest/Auth/ShaHmac1SignerTest.php b/extend/aliyun-php-sdk-core/UnitTest/Auth/ShaHmac1SignerTest.php new file mode 100644 index 0000000..129dac7 --- /dev/null +++ b/extend/aliyun-php-sdk-core/UnitTest/Auth/ShaHmac1SignerTest.php @@ -0,0 +1,28 @@ +assertEquals("33nmIV5/p6kG/64eLXNljJ5vw84=", $signer->signString("this is a ShaHmac1 test.", "accessSecret")); + } +} diff --git a/extend/aliyun-php-sdk-core/UnitTest/Auth/ShaHmac256SignerTest.php b/extend/aliyun-php-sdk-core/UnitTest/Auth/ShaHmac256SignerTest.php new file mode 100644 index 0000000..09fbb29 --- /dev/null +++ b/extend/aliyun-php-sdk-core/UnitTest/Auth/ShaHmac256SignerTest.php @@ -0,0 +1,30 @@ +assertEquals("TpF1lE/avV9EHGWGg9Vo/QTd2bLRwFCk9jjo56uRbCo=", + $signer->signString("this is a ShaHmac256 test.", "accessSecret")); + } +} diff --git a/extend/aliyun-php-sdk-core/UnitTest/BaseTest.php b/extend/aliyun-php-sdk-core/UnitTest/BaseTest.php new file mode 100644 index 0000000..fff5243 --- /dev/null +++ b/extend/aliyun-php-sdk-core/UnitTest/BaseTest.php @@ -0,0 +1,40 @@ +client = new DefaultAcsClient($iClientProfile); + } + + public function getProperty($propertyKey) + { + $accessKey = ""; + $accessSecret = ""; + $iClientProfile = DefaultProfile::getProfile("cn-hangzhou", "AccessKey", "AccessSecret"); + } +} diff --git a/extend/aliyun-php-sdk-core/UnitTest/BatchCompute/ListImagesRequest.php b/extend/aliyun-php-sdk-core/UnitTest/BatchCompute/ListImagesRequest.php new file mode 100644 index 0000000..98d4ccd --- /dev/null +++ b/extend/aliyun-php-sdk-core/UnitTest/BatchCompute/ListImagesRequest.php @@ -0,0 +1,30 @@ +setUriPattern("/images"); + $this->setMethod("GET"); + } +} diff --git a/extend/aliyun-php-sdk-core/UnitTest/DefaultAcsClientTest.php b/extend/aliyun-php-sdk-core/UnitTest/DefaultAcsClientTest.php new file mode 100644 index 0000000..a981d62 --- /dev/null +++ b/extend/aliyun-php-sdk-core/UnitTest/DefaultAcsClientTest.php @@ -0,0 +1,42 @@ +client->doAction($request); + + $this->assertNotNull($response->RequestId); + $this->assertNotNull($response->Regions->Region[0]->LocalName); + $this->assertNotNull($response->Regions->Region[0]->RegionId); + } + + public function testDoActionROA() + { + $request = new BC\ListImagesRequest(); + $response = $this->client->doAction($request); + $this->assertNotNull($response); + } +} diff --git a/extend/aliyun-php-sdk-core/UnitTest/Ecs/Rquest/DescribeRegionsRequest.php b/extend/aliyun-php-sdk-core/UnitTest/Ecs/Rquest/DescribeRegionsRequest.php new file mode 100644 index 0000000..a3463a1 --- /dev/null +++ b/extend/aliyun-php-sdk-core/UnitTest/Ecs/Rquest/DescribeRegionsRequest.php @@ -0,0 +1,80 @@ +ownerId; + } + + public function setOwnerId($ownerId) + { + $this->ownerId = $ownerId; + $this->queryParameters["OwnerId"]=$ownerId; + } + + public function getResourceOwnerAccount() + { + return $this->resourceOwnerAccount; + } + + public function setResourceOwnerAccount($resourceOwnerAccount) + { + $this->resourceOwnerAccount = $resourceOwnerAccount; + $this->queryParameters["ResourceOwnerAccount"]=$resourceOwnerAccount; + } + + public function getResourceOwnerId() + { + return $this->resourceOwnerId; + } + + public function setResourceOwnerId($resourceOwnerId) + { + $this->resourceOwnerId = $resourceOwnerId; + $this->queryParameters["ResourceOwnerId"]=$resourceOwnerId; + } + + public function getOwnerAccount() + { + return $this->ownerAccount; + } + + public function setOwnerAccount($ownerAccount) + { + $this->ownerAccount = $ownerAccount; + $this->queryParameters["OwnerAccount"]=$ownerAccount; + } +} diff --git a/extend/aliyun-php-sdk-core/UnitTest/Ft/InteTest.php b/extend/aliyun-php-sdk-core/UnitTest/Ft/InteTest.php new file mode 100644 index 0000000..fa4261e --- /dev/null +++ b/extend/aliyun-php-sdk-core/UnitTest/Ft/InteTest.php @@ -0,0 +1,35 @@ +", + "", + "" +); + +DefaultProfile::addEndpoint("cn-hangzhou", "cn-hangzhou", "Ft", "ft.aliyuncs.com"); + +$client = new DefaultAcsClient($clientProfile); +# 创建 API 请求并设置参数 +$request = new TestRpcApiRequest(); +$request->setQueryParam("conan"); +# 发起请求并处理返回 +$response = $client->getAcsResponse($request); +print_r($response); + +# 创建 API 请求并设置参数 +$request = new TestRoaApiRequest(); +$request->setQueryParam("conan"); +# 发起请求并处理返回 +$response = $client->getAcsResponse($request); +print_r($response); \ No newline at end of file diff --git a/extend/aliyun-php-sdk-core/UnitTest/Ft/TestRoaApiRequest.php b/extend/aliyun-php-sdk-core/UnitTest/Ft/TestRoaApiRequest.php new file mode 100644 index 0000000..55ba9d7 --- /dev/null +++ b/extend/aliyun-php-sdk-core/UnitTest/Ft/TestRoaApiRequest.php @@ -0,0 +1,57 @@ +setUriPattern("/web/cloudapi"); + $this->setMethod("GET"); + } + + private $queryParam; + + private $bodyParam; + + private $headerParam; + + public function getQueryParam() + { + return $this->queryParam; + } + + public function setQueryParam($queryParam) + { + $this->queryParam = $queryParam; + $this->queryParameters["QueryParam"]=$queryParam; + } + + public function getBodyParam() + { + return $this->bodyParam; + } + + public function setBodyParam($bodyParam) + { + $this->bodyParam = $bodyParam; + $this->queryParameters["BodyParam"]=$bodyParam; + } + + public function getHeaderParam() + { + return $this->headerParam; + } + + public function setHeaderParam($headerParam) + { + $this->headerParam = $headerParam; + $this->headerParam["HeaderParam"]=$headerParam; + } +} \ No newline at end of file diff --git a/extend/aliyun-php-sdk-core/UnitTest/Ft/TestRpcApiRequest.php b/extend/aliyun-php-sdk-core/UnitTest/Ft/TestRpcApiRequest.php new file mode 100644 index 0000000..1ca5520 --- /dev/null +++ b/extend/aliyun-php-sdk-core/UnitTest/Ft/TestRpcApiRequest.php @@ -0,0 +1,42 @@ +queryParam; + } + + public function setQueryParam($queryParam) + { + $this->queryParam = $queryParam; + $this->queryParameters["QueryParam"]=$queryParam; + } + + public function getBodyParam() + { + return $this->bodyParam; + } + + public function setBodyParam($bodyParam) + { + $this->bodyParam = $bodyParam; + $this->queryParameters["BodyParam"]=$bodyParam; + } +} \ No newline at end of file diff --git a/extend/aliyun-php-sdk-core/UnitTest/Http/HttpHelperTest.php b/extend/aliyun-php-sdk-core/UnitTest/Http/HttpHelperTest.php new file mode 100644 index 0000000..5570d16 --- /dev/null +++ b/extend/aliyun-php-sdk-core/UnitTest/Http/HttpHelperTest.php @@ -0,0 +1,29 @@ +assertEquals(400, $httpResponse->getStatus()); + $this->assertNotNull($httpResponse->getBody()); + } +} diff --git a/extend/aliyun-php-sdk-core/UnitTest/Profile/DefaultProfileTest.php b/extend/aliyun-php-sdk-core/UnitTest/Profile/DefaultProfileTest.php new file mode 100644 index 0000000..2836d12 --- /dev/null +++ b/extend/aliyun-php-sdk-core/UnitTest/Profile/DefaultProfileTest.php @@ -0,0 +1,60 @@ +assertEquals("cn-hangzhou", $profile->getRegionId()); + $this->assertEquals("accessId", $profile->getCredential()->getAccessKeyId()); + $this->assertEquals("accessSecret", $profile->getCredential()->getAccessSecret()); + } + + public function testAddEndpoint() + { + $profile = DefaultProfile::getProfile("cn-hangzhou", "accessId", "accessSecret"); + $profile->addEndpoint("cn-hangzhou", "cn-hangzhou", "TestProduct", "testproduct.aliyuncs.com"); + $endpoints = $profile->getEndpoints(); + foreach ($endpoints as $key => $endpoint) { + if ("cn-hangzhou" == $endpoint->getName()) { + $regionIds = $endpoint->getRegionIds(); + $this->assertContains("cn-hangzhou", $regionIds); + + $productDomains= $endpoint->getProductDomains(); + $this->assertNotNull($productDomains); + $productDomain = $this->getProductDomain($productDomains); + $this->assertNotNull($productDomain); + $this->assertEquals("TestProduct", $productDomain->getProductName()); + $this->assertEquals("testproduct.aliyuncs.com", $productDomain->getDomainName()); + } + } + } + + private function getProductDomain($productDomains) + { + foreach ($productDomains as $productDomain) { + if ($productDomain->getProductName() == "TestProduct") { + return $productDomain; + } + } + return null; + } +} diff --git a/extend/aliyun-php-sdk-core/UnitTest/Regions/EndPointByLocationTest.php b/extend/aliyun-php-sdk-core/UnitTest/Regions/EndPointByLocationTest.php new file mode 100644 index 0000000..e592200 --- /dev/null +++ b/extend/aliyun-php-sdk-core/UnitTest/Regions/EndPointByLocationTest.php @@ -0,0 +1,46 @@ +clientProfile = DefaultProfile::getProfile( + "cn-shanghai", # 您的 Region ID + "", # 您的 Access Key ID + "" # 您的 Access Key Secret + ); + + $this->locationService = new LocationService($this->clientProfile); + } + + public function testFindProductDomain() + { + $this->initClient(); + $domain = $this->locationService->findProductDomain("cn-shanghai", "apigateway", "openAPI", "CloudAPI"); + $this->assertEquals("apigateway.cn-shanghai.aliyuncs.com", $domain); + } + + public function testFindProductDomainWithAddEndPoint() + { + DefaultProfile::addEndpoint("cn-shanghai", "cn-shanghai", "CloudAPI", "apigateway.cn-shanghai123.aliyuncs.com"); + $this->initClient(); + $domain = $this->locationService->findProductDomain("cn-shanghai", "apigateway", "openAPI", "CloudAPI"); + $this->assertEquals("apigateway.cn-shanghai123.aliyuncs.com", $domain); + } + +} diff --git a/extend/aliyun-php-sdk-core/UnitTest/Regions/EndpointProviderTest.php b/extend/aliyun-php-sdk-core/UnitTest/Regions/EndpointProviderTest.php new file mode 100644 index 0000000..c6e0fcf --- /dev/null +++ b/extend/aliyun-php-sdk-core/UnitTest/Regions/EndpointProviderTest.php @@ -0,0 +1,28 @@ +assertEquals("ecs.aliyuncs.com", EndpointProvider::findProductDomain("cn-hangzhou", "Ecs")); + } +} diff --git a/extend/aliyunoss/.coveralls.yml b/extend/aliyunoss/.coveralls.yml new file mode 100644 index 0000000..850cc59 --- /dev/null +++ b/extend/aliyunoss/.coveralls.yml @@ -0,0 +1,2 @@ +coverage_clover: coverage.xml +json_path: coverage.json diff --git a/extend/aliyunoss/.gitignore b/extend/aliyunoss/.gitignore new file mode 100644 index 0000000..7cdb514 --- /dev/null +++ b/extend/aliyunoss/.gitignore @@ -0,0 +1,8 @@ +vendor +composer.lock +doc +output +.idea +.buildpath +.project +.settings diff --git a/extend/aliyunoss/.travis.yml b/extend/aliyunoss/.travis.yml new file mode 100644 index 0000000..0b40ba2 --- /dev/null +++ b/extend/aliyunoss/.travis.yml @@ -0,0 +1,21 @@ +language: php +php: + - 7.1 + - 7.0 + - 5.6 + - 5.5 + - 5.4 +install: + - composer self-update + - composer install --no-interaction +script: + - php vendor/bin/phpunit +after_success: + - php vendor/bin/coveralls -v +env: + global: + - secure: SzmQ854lQmhV6ZkAG7lQNTY3CkazrXnDSb6VMwPU/sdaLGxPO159AW3fJS5d0sO/XN1P8x5WNkoA4i9soDlLBRibEEISNUM/2EMnpszsRymZ9o97PrS2IgORXTUL/OF+rpATzyNVB2p+2l9hBLiGf17exMSA5iOeY7W6E+VKPGi8TFykgbGUnLKU0h1hV3rzmtfGjOXcSpvYU/hxeZD/J/+6m5Gic9b/pNS+AbfTj7Y7Ru9tNsnyUP29V/vtEYtpQir3ZxQiSiUv9idybgGnJBOMYydJofb/mpFYHhYLSWqtMKGNLpeawmqs4z8S1Tvx5U5uzW5+h/mpzhvBaFlWGpm8t89BQxun5LVX5NiYCrV7TqaLitGp1cSpMjMDnrnSTNzk1exVz+rWZZcWS7yB9ULYA681GA8StXWk167qB7Y30iK1dFK3+2mDN2cEY+qLs8+bupDowQ4eOM+eqfhxX8F8+ouKcKomETsjiIwL+CUsIe6wjvnYFWb1YlRhbsI75bblHApflohnt6gVSJ78ZPqID+u2oUMjmIWXLTnRR2Y2tgEW8uqHeIoQ8BBntLdQDmv0BO4FpnGQIwrUUwQYeNzEM0DOr3hWZhyDR6Xvl+9H0l52xjANaSqpuTZfC3zmeFTG7kIjydvxNePRrony6XAawL9BvI7aKWuVF6YVjPM= + - secure: nEhsU8aUQqsAJeuger+boh51oTpeo4YNG7vUWbKxdwVDIrcLb+l7r7RvTlxU7mt8IZTWwicgri18mh+Wi04BwX4ulBA1SCs8jPbL51KEo5izoDGGtLSd2fuPHdslYSrwagrvq90EPnDT/7fHWn/TAoT+rueZzjNyCu5IGSgL3GnXaUThsJ82NMePL2YRdP4Q1qmtZPRFBOkOQ6F0heuV8fw8sLyTO3txaCQum9YneGxrWxOl/E8zB0qtlnPwLE8ogaHZMQh2/jThmTbI5UqwRTxV4f0qoD5eJYH+j0fslsSAjsg/HPnSuVcnccK3zSU+s2sV4dPCcISzECJvZEObwipfxOGhdqt5gMcxHhn8qVsbT97iIh106pG/BJCDgQd2EeVW8WfCi6cCuCKIMipvVkMypkmjQHWU1XaqPzILl7g5diW9Ctp2C4Akq5dYdrdu8IrnVK1ShtkQVaWU+S/Bht8VU5gYP7olPW/GdTz7sceU1NOIC4NPXqmWKbfavR98U5dkHMLMvzABYL1Q87h+KhPD1c14NUyw3YENUW7REiF/X5lERRm5H0kJ/1JqAa+AgeHQEGmPVuZV2s/na4b0S1479QRVmSM/6ZzXQpU+Y8jCRfETpUFA4S331369kirHgCqDlxyIntuEKrzivD02/O+5C3eJ0WHRz6QsN2/R4qg= + - secure: ZTvzNXEZP4efl+a/3VGMmdabfUQp83v5/lecMns039Ro7UuZYPdtbPtpPnpjaTI6Htd22A4Rva5BU/3JCQJAyQvpbKNn5sGou2SmfQu3o0SyhggSB7gWjYAf707aW1j4bHYfP8IjDS5NjuVk3AqXeNSUuLRUXRmwSOB0lSYiRhiTJY+pUdBl382Hx4NbhIU/gmOzRoJCs7coTip8IURXYEHPi5dnDWluajxI+TgNXFccSgEleeQDJajYgXmpLb2EhSj8piipOnVgaCEE5bh5fbp32024Qq38SGHKcbfnwj2IInpZpZESJknRKoqAlFjdOJhork82dBcvAr5JxCBZKx5IuwXcTjxkQ6tRtBeqhPLPFuX3MQ8WrtU+wniPM0RCH/VoFkUKO7JGQDwmoi2AKago4PsuDs4P6Y6CeuOVpcso731GwwMNhIJcyrJJivXprQNEGsEw+9wLjU1qNYs6IIA3S/gPzFrNbdX5Wf8vxt0vLpgYvBNtPnLMejMtknuyfVzf5iKuVVoGPDTEz+ajs06+jfoPfm/4sLTaLghuVH7Adm74OpF769JQNnQYKwJuu4bNlcbLJChulCEMBOx7myqo/9O6RCTuqzHaGmVWNot4RGqRFHgJGl/JJf0WpAVitbhbRH3kGoyKb6jFM74CJbPsE7OORlJLDC3cdD3C8Pk= + - secure: Qr5NR4CVzBKCQgRgMH0x772TPJ1+brx3UCvtRNu8fi4j3p8bz+HDMjBaBDSFmEB09nunLI55/8mj88/5GXmnpFs8+CPTkcW+QZOcxg3cxpI4SNmxoB12/ZawlFHAqSUaRRE7RUWVkY3KL8tIGjEZcFyUBQ1DVNX3OMpiKs3NLtHa7oUIknyBxdSokm4kpLhSXYe7WmO0vhuZbMZE0S1EISToiBS6AdhGUEbTLJ/vNsIDY07fu6+Vh3HxVbyUFPqUZGlkZpQ+2xMJ3kiqPBMrXtRF/IhhPjORDil6Ns9SQ8/AAlaCddvYvRaT4Pjv2/aX+t3l28qI1qmryPtWXpce5UXecWGYqdRpSJc6Y/pEt4m4FeeGoEFWnSPGIs7FRmeiis8q2rojGZ18i4vI/k4iHmqEBnTlMp3SWnRb9L1adJ8ZAWln8aC88gkQXm67w7+1CxLycerbYj9H1ugqHENuHcxv4uHUcZgEENX3EWatu8i9+K2IUuU/2zcmpu7qtsziYcoyW8DOOmYpJfXGMLtmF9+pqp/Tp6i0tltFSEfmY3N8o7xvv3enLvFHsjL+3ElFdd1blUPSrvZJHgA9M3lJ+QF1RJZCpJqgPlQ0XOZK1Bf4P46zpEj01wKaK4JQrkLPRXhbBOuIJn5O6WlFJyPX4+SaBfwTzb4AvM4aUg2TgTg= + - secure: Inw5ftA8fxvhMHRZwoZzATxn4WICJsCq7ZX4y2gI+b/8u0JQIsbLgY9WTYV+XdSxOoNwuVa1oUxEWI0aDORtXKC3XaIXXKrwndag0zxS77JEYwWvQsjM7BhEbF7MF7MYk8rRXpn6mbfGAT/NfqEOx91RCY8UKeMzD0oPkpkBnJ9Ekuod6JBBq+7j3v4mYUItA8pxvw7b4Pdd4z2xzjgOwNhJYMOCpts50DWZI+WXj0HvTYaMXe5mJJtORK5lsr0a9cbsBqAzE6l+3zGI8XkgHn130ux5XH3DE7hZBeti3ZNaO3d2Vv+496/1EObG0rSFk+z3dmNKqjMz4nh3bYIkdLMegwmgCWs2mvQhkwYhzmnPRHVSERrgZjSWnuKn2PKnBar6tui9KaLNgpo2j3jWpwMLJ3bGAfE5JtMppxAxNqj/q+YB2UZo7Mn7EDjkTDjgxCuazTJwWqH7xxCOykWPABBI17P3JaOXQJEK39LavpfSMm3kdmU0ocpUs7FniLuFm6xL71VxY1wHG10yskczEcFHZ3iyIyGM+xum4vbt5y6Yg+zfdExYQsbrxHDDZ3HbHY3tEU0WhM55vrC42NIXRWqXqJ8OAxpl4nivfx96eoBAThiUU9xXtZmh7WRFVYsstoGtxZwfk5+bi+oeVO9kih4xabwbgHgL9BTc1TR1C4U= diff --git a/extend/aliyunoss/Aliconfig.php b/extend/aliyunoss/Aliconfig.php new file mode 100644 index 0000000..e1de3d0 --- /dev/null +++ b/extend/aliyunoss/Aliconfig.php @@ -0,0 +1,16 @@ +getMessage() . "\n"); + return null; + } + return $ossClient; + } + + public static function getBucketName() + { + return self::bucket; + } + + /** + * A tool function which creates a bucket and exists the process if there are exceptions + */ + public static function createBucket() + { + $ossClient = self::getOssClient(); + if (is_null($ossClient)) exit(1); + $bucket = self::getBucketName(); + $acl = OssClient::OSS_ACL_TYPE_PUBLIC_READ; + try { + $ossClient->createBucket($bucket, $acl); + } catch (OssException $e) { + + $message = $e->getMessage(); + if (\OSS\Core\OssUtil::startsWith($message, 'http status: 403')) { + echo "Please Check your AccessKeyId and AccessKeySecret" . "\n"; + exit(0); + } elseif (strpos($message, "BucketAlreadyExists") !== false) { + echo "Bucket already exists. Please check whether the bucket belongs to you, or it was visited with correct endpoint. " . "\n"; + exit(0); + } + printf(__FUNCTION__ . ": FAILED\n"); + printf($e->getMessage() . "\n"); + return; + } + print(__FUNCTION__ . ": OK" . "\n"); + } + + public static function println($message) + { + if (!empty($message)) { + echo strval($message) . "\n"; + } + } +} + +# Common::createBucket(); diff --git a/extend/aliyunoss/callback.php b/extend/aliyunoss/callback.php new file mode 100644 index 0000000..94dcedf --- /dev/null +++ b/extend/aliyunoss/callback.php @@ -0,0 +1,72 @@ +false,'data'=>'']); + exit; +} +// 4.获取回调body +$body = file_get_contents('php://input'); +// 5.拼接待签名字符串 +$authStr = ''; +$path = $_SERVER['REQUEST_URI']; +$pos = strpos($path, '?'); +if ($pos === false){ + $authStr = urldecode($path)."\n".$body; +}else{ + $authStr = urldecode(substr($path, 0, $pos)).substr($path, $pos, strlen($path) - $pos)."\n".$body; +} + +// 6.验证签名 +$ok = openssl_verify($authStr, $authorization, $pubKey, OPENSSL_ALGO_MD5); +if ($ok == 1){ + header("Content-Type: application/json"); + $body=urldecode($body); + $body=explode('&', $body); + $maps=[]; + foreach ($body as $item){ + $item=explode('=',$item); + $key=$item[0]; + $val=$item[1]; + $maps[$key]=$val; + } + $data = array("status"=>true,'data'=>$maps); +}else{ + $data = array("status"=>false,'data'=>$body); +} +echo json_encode($data); + +?> + + + diff --git a/extend/fdd/FddApi.php b/extend/fdd/FddApi.php new file mode 100644 index 0000000..8a1b29b --- /dev/null +++ b/extend/fdd/FddApi.php @@ -0,0 +1,1357 @@ +IsOpenIDSet()) + throw new FddException("缺少必填参数-open_id"); + if (!$param->IsAccountTypeSet()) + throw new FddException("缺少必填参数-account_type"); + $encArr = $param->GetValues(); + $encKey = array_keys($encArr); + array_multisort($encKey); + $enc = [ + 'md5' => [], + 'sha1'=>$encKey + ]; + + $param->SetApp_id(FddConfig::AppId); + $param->SetTimestamp(date('YmdHis')); + if (!$param->IsVSet()){ + $param->SetV('2.0'); + } + $param->SetMsg_digest($des::GeneralDigest($param,$enc)); + $input = $param->GetValues(); + + $res = self::https_request($url,$input); + return $res; + + }catch (FddException $e){ + + return ['result'=>'error','code'=>2001,'msg'=>$e->errorMessage()]; + } + + } + + /** + * + * 合同模板传输接口 + * app_id、timestamp、msg_digest、v 、template_id 必填参数 + * file、doc_url 选填参数 + * @param FddTemplate $param + * @param int $timeOut + * @throws FddException + * @return 成功时返回,其他抛异常 + */ + public static function UploadTemplate(FddTemplate $param, $timeOut = 6) + { + //合同模板传输接口 地址 + $url = FddConfig::FddServer.'/uploadtemplate.api'; + try{ + //参数处理 + if (!$param->IsTemplate_idSet()) + throw new FddException("缺少必填参数-template_id"); + if (!$param->IsFileSet() && !$param->IsDoc_urlSet()) + throw new FddException("缺少必填参数-file、doc_url 二选一"); + $param->SetApp_id(FddConfig::AppId); + $param->SetTimestamp(date('YmdHis')); + if (!$param->IsVSet()){ + $param->SetV('2.0'); + } + //实例化3DES类 + $des = new FddEncryption(); + //设置加密串 + $enc = [ + 'md5' => [], + 'sha1'=> ['template_id'] + ]; + $param->SetMsg_digest($des::GeneralDigest($param,$enc)); + $input = $param->GetValues(); + + $res = self::https_request($url,$input); + + return $res; + }catch (FddException $e){ + + return ['result'=>'error','code'=>2001,'msg'=>$e->errorMessage()]; + } + + } + + /** + * + * 合同文档传输接口 + * app_id、timestamp、msg_digest、v 、contract_id、doc_type 、doc_title必填参数 + * file、doc_url 选填参数 + * @param FddTemplate $param + * @param int $timeOut + * @throws FddException + * @return 成功时返回,其他抛异常 + */ + public static function Uploaddocs(FddTemplate $param, $timeOut = 6) + { + //合同文档传输接口 地址 + $url = FddConfig::FddServer.'/uploaddocs.api'; + try{ + //参数处理 + if (!$param->IsContract_idSet()) + throw new FddException("缺少必填参数-contract_id"); + if (!$param->IsDoc_titleSet()) + throw new FddException("缺少必填参数-doc_title"); + if (!$param->IsDoc_typeSet()) + throw new FddException("缺少必填参数-doc_type"); + if (!$param->IsFileSet() && !$param->IsDoc_urlSet()) + throw new FddException("缺少必填参数-file、doc_url 二选一"); + $param->SetApp_id(FddConfig::AppId); + $param->SetTimestamp(date('YmdHis')); + if (!$param->IsVSet()){ + $param->SetV('2.0'); + } + //实例化3DES类 + $des = new FddEncryption(); + //设置加密串 + $enc = [ + 'md5' => [], + 'sha1' => ['contract_id'] + ]; + // $param->SetMsg_digest($des::ContractDigest($param)); + $param->SetMsg_digest($des::GeneralDigest($param,$enc)); + $input = $param->GetValues(); + // file文件是为header 跳转 + // header('location:'.$url.$des->ArrayParamToStr($input)); + $res = self::https_request($url,$input); + return $res; + }catch (FddException $e){ + + return ['result'=>'error','code'=>2001,'msg'=>$e->errorMessage()]; + } + + } + + /** + * + * 合同生成接口 + * app_id、timestamp、msg_digest、v 、template_id 必填参数 + * @param FddTemplate $param + * @param int $timeOut + * @throws FddException + * @return 成功时返回,其他抛异常 + */ + public static function GenerateContract(FddTemplate $param, $timeOut = 6) + { + //合同生成接口 地址 + $url = FddConfig::FddServer.'/generate_contract.api'; + + try{ + //参数处理 + if (!$param->IsDoc_titleSet()) + throw new FddException("缺少必填参数-doc_title"); + if (!$param->IsTemplate_idSet()) + throw new FddException("缺少必填参数-template_id"); + if (!$param->IsContract_idSet()) + throw new FddException("缺少必填参数-contract_id"); + if (!$param->IsParameter_mapSet()) + throw new FddException("缺少必填参数-parameter_map"); + $param->SetApp_id(FddConfig::AppId); + $param->SetTimestamp(date('YmdHis')); + if (!$param->IsVSet()){ + $param->SetV('2.0'); + } + if($param->GetInsertWay()!=''){ + if($param->GetInsertWay() == 0){ + if (!$param->IsPageBeginSet()) + throw new FddException("缺少必填参数-pageBegin"); + } + if($param->GetInsertWay() == 1){ + if (!$param->IsKeywordSet()) + throw new FddException("缺少必填参数-keyword"); + } + $data = []; + if($param->GetInsertWay() != null){ + $data['insertWay'] = $param->GetInsertWay(); + } + if($param->GetKeyword() != null){ + $data['keyword'] = $param->GetKeyword(); + } + if($param->GetPageBegin() != null){ + $data['pageBegin'] = $param->GetPageBegin(); + } + if($param->GetBorderFlag() != null){ + $data['borderFlag'] = $param->GetBorderFlag(); + } + if($param->GetCellHeight() != null){ + $data['cellHeight'] = $param->GetCellHeight(); + } + if($param->GetCellHorizontalAlignment() != null){ + $data['cellHorizontalAlignment'] = $param->GetCellHorizontalAlignment(); + } + if($param->GetCellVerticalAlignment() != null){ + $data['cellVerticalAlignment'] = $param->GetCellVerticalAlignment(); + } + if($param->GetTheFirstHeader() != null){ + $data['theFirstHeader'] = $param->GetTheFirstHeader(); + } + if($param->GetHeaders() != null){ + $data['headers'] = $param->GetHeaders(); + } + if($param->GetHeadersAlignment() != null){ + $data['headersAlignment'] = $param->GetHeadersAlignment(); + } + if($param->GetDatas() != null){ + $data['datas'] = $param->GetDatas(); + } + if($param->GetColWidthPercent() != null){ + $data['colWidthPercent'] = $param->GetColWidthPercent(); + } + if($param->GetTableHorizontalAlignment() != null){ + $data['tableHorizontalAlignment'] = $param->GetTableHorizontalAlignment(); + } + if($param->GetTableWidthPercentage() != null){ + $data['tableWidthPercentage'] = $param->GetTableWidthPercentage(); + } + if($param->GetTableHorizontalOffset() != null){ + $data['tableHorizontalOffset'] = $param->GetTableHorizontalOffset(); + } + $param->SetHeaders(json_encode($param->GetHeaders())); + $param->SetDatas(json_encode($param->GetDatas())); + $param->SetColWidthPercent(json_encode($param->GetColWidthPercent())); + $arr = array($data); + $param->SetDynamic_tables(json_encode($arr)); + + if (!$param->IsHeadersSet()) + throw new FddException("缺少必填参数-headers"); + } + //实例化3DES类 + $des = new FddEncryption(); + $param->SetMsg_digest($des::ContractDigest($param)); + $input = $param->GetValues(); + + $res = self::https_request($url,$input); + + return $res; + }catch (FddException $e){ + + return ['result'=>'error','code'=>2001,'msg'=>$e->errorMessage()]; + } + + } + + /** + * + * 文档签署接口(手动签) + * app_id、timestamp、msg_digest、contract_id 、transaction_id、customer_id、必填参数 + * notify_url 选填参数 + * @param FddSignContract $param + * @param int $timeOut + * @throws FddException + * @return 成功时返回,其他抛异常 + */ + public static function Extsign(FddSignContract $param, $timeOut = 6) + { + // 文档签署接口(手动签) 地址 + $url = FddConfig::FddServer.'/extsign.api'; + try{ + //参数处理 + if (!$param->IsTransaction_idSet()) + throw new FddException("缺少必填参数-transaction_id"); + if (!$param->IsContract_idSet()) + throw new FddException("缺少必填参数-contract_id"); + if (!$param->IsCustomer_idSet()) + throw new FddException("缺少必填参数-customer_id"); + if (!$param->IsDoc_titleSet()) + throw new FddException("缺少必填参数-doc_title"); + if (!$param->IsReturn_urlSet()) + throw new FddException("缺少必填参数-return_url"); + $param->SetApp_id(FddConfig::AppId); + $param->SetTimestamp(date('YmdHis')); + $param->SetDoc_title(urlencode($param->GetDoc_title())); + if (!$param->IsVSet()){ + $param->SetV('2.0'); + } + //实例化3DES类 + $des = new FddEncryption(); + $param->SetMsg_digest($des::ExtsignDigest($param)); + $input = $param->GetValues(); + $jump=$url.$des->ArrayParamToStr($input); + return ['result'=>'success','code'=>1,'msg'=>'成功','data'=>$jump]; + header('location:'.$url.$des->ArrayParamToStr($input)); + // $res = self::https_request($url,$input); + // return $res; + }catch (FddException $e){ + + return ['result'=>'error','code'=>2001,'msg'=>$e->errorMessage()]; + } + + } + + /** + * + * 文档签署接口(自动签) + * app_id、timestamp、msg_digest、contract_id 、transaction_id、customer_id、必填参数 + * notify_url 选填参数 + * @param FddSignContract $param + * @param int $timeOut + * @throws FddException + * @return 成功时返回,其他抛异常 + */ + public static function ExtsignAuto(FddSignContract $param, $timeOut = 6) + { + // 文档签署接口(自动签) 地址 + $url = FddConfig::FddServer.'/extsign_auto.api'; + try{ + //参数处理 + if (!$param->IsTransaction_idSet()) + throw new FddException("缺少必填参数-transaction_id"); + if (!$param->IsContract_idSet()) + throw new FddException("缺少必填参数-contract_id"); + if (!$param->IsCustomer_idSet()) + throw new FddException("缺少必填参数-customer_id"); + if (!$param->IsDoc_titleSet()) + throw new FddException("缺少必填参数-doc_title"); + if (!$param->IsClient_roleSet()) + throw new FddException("缺少必填参数-client_role"); + if ($param->IsPosition_typeSet()){ + if($param->GetPosition_type() == 1){ + if(!$param->IsYSet() && !$param->IsXSet() && !$param->IsPagenumSet()) + throw new FddException("缺少必填参数- x 、y 、pagenum"); + } + if($param->GetPosition_type() == 0){ + if(!$param->IsSign_keywordSet()) + throw new FddException("缺少必填参数- Sign_keyword"); + } + } + if($param->IsPagenumSet()){ + $pagenum = $param->GetPagenum(); + $x = $param->GetX(); + $y = $param->GetY(); + $SearchLocation = array( + array( + 'pagenum' => $pagenum, + 'x' => $x, + 'y' => $y + ) + ); + $param->SetSignature_positions(json_encode($SearchLocation)); + } + $param->SetApp_id(FddConfig::AppId); + $param->SetTimestamp(date('YmdHis')); + $param->SetDoc_title(urlencode($param->GetDoc_title())); + if (!$param->IsVSet()){ + $param->SetV('2.0'); + } + //实例化3DES类 + $des = new FddEncryption(); + $param->SetMsg_digest($des::ExtsignDigest($param)); + $input = $param->GetValues(); + $res = self::https_request($url,$input); + return $res; + }catch (FddException $e){ + + return ['result'=>'error','code'=>2001,'msg'=>$e->errorMessage()]; + } + + } + + /** + * + * 文档签署接口(含有效期和次数限制) + * app_id、timestamp、msg_digest、contract_id 、transaction_id 、customer_id、doc_title、return_url、validity、quantity必填参数 + * notify_url 、sign_keyword 、keyword_strategy 选填参数 + * @param FddSignContract $param + * @param int $timeOut + * @throws FddException + * @return 成功时返回,其他抛异常 + */ + public static function ExtsignValidation(FddSignContract $param, $timeOut = 6) + { + // 文档签署接口(含有效期和次数限制) 地址 + $url = FddConfig::FddServer.'/extsign_validation.api'; + try{ + //参数处理 + if (!$param->IsTransaction_idSet()) + throw new FddException("缺少必填参数-transaction_id"); + if (!$param->IsContract_idSet()) + throw new FddException("缺少必填参数-contract_id"); + if (!$param->IsCustomer_idSet()) + throw new FddException("缺少必填参数-customer_id"); + if (!$param->IsDoc_titleSet()) + throw new FddException("缺少必填参数-doc_title"); + if (!$param->IsReturn_urlSet()) + throw new FddException("缺少必填参数-return_url"); + if (!$param->IsValiditySet()) + throw new FddException("缺少必填参数-validity"); + if (!$param->IsQuantitySet()) + throw new FddException("缺少必填参数-quantity"); + $param->SetApp_id(FddConfig::AppId); + $param->SetTimestamp(date('YmdHis')); + $param->SetDoc_title(urlencode($param->GetDoc_title())); + if (!$param->IsVSet()){ + $param->SetV('2.0'); + } + //实例化3DES类 + $des = new FddEncryption(); + $param->SetMsg_digest($des::ExtsignValiityDigest($param)); + $input = $param->GetValues(); + header('location:'.$url.$des->ArrayParamToStr($input)); + // $res = self::https_request($url,$input); + // return $res; + }catch (FddException $e){ + + return ['result'=>'error','code'=>2001,'msg'=>$e->errorMessage()]; + } + + } + + /** + * + * 客户签署结果查询接口 + * @param FddQuerySignResult $param + * @param int $timeOut + * @throws FddException + * @return 成功时返回,其他抛异常 + */ + public static function QuerySignResult(FddQuerySignResult $param, $timeOut = 6) + { + //客户签署结果查询接口 地址 + $url = FddConfig::FddServer.'/query_sign_result.api'; + try{ + //参数处理 + if (!$param->IsContract_idSet()) + throw new FddException("缺少必填参数-contract_id"); + if (!$param->IsCustomer_idSet()) + throw new FddException("缺少必填参数-customer_id"); + if (!$param->IsTransaction_idSet()) + throw new FddException("缺少必填参数-transaction_id"); + $param->SetApp_id(FddConfig::AppId); + $param->SetTimestamp(date('YmdHis')); + if (!$param->IsVSet()){ + $param->SetV('2.0'); + } + //实例化3DES类 + $des = new FddEncryption(); + //设置加密串 + $enc = [ + 'md5' => [], + 'sha1'=> ['contract_id','customer_id','transaction_id'] + ]; + $param->SetMsg_digest($des::GeneralDigest($param,$enc)); + $input = $param->GetValues(); + $res = self::https_request($url,$input); + return $res; + }catch (FddException $e){ + + return ['result'=>'error','code'=>2001,'msg'=>$e->errorMessage()]; + } + + } + + /** + * + * 文档查看接口 + * @param FddContractManageMent $param + * @param int $timeOut + * @throws FddException + * @return 成功时返回,其他抛异常 + */ + public static function ViewContract(FddContractManageMent $param, $timeOut = 6) + { + //文档查看接口 + $url = FddConfig::FddServer.'/viewContract.api'; + try{ + if (!$param->IsContract_idSet()) + throw new FddException("缺少必填参数-contract_id"); + $param->SetApp_id(FddConfig::AppId); + $param->SetTimestamp(date('YmdHis')); + if (!$param->IsVSet()){ + $param->SetV('2.0'); + } + //实例化3DES类 + $des = new FddEncryption(); + //设置加密串 + $enc = [ + 'md5' => [], + 'sha1'=> ['contract_id'] + ]; + $param->SetMsg_digest($des::GeneralDigest($param,$enc)); + $input = $param->GetValues(); + header('location:'.$url.$des->ArrayParamToStr($input)); + // $res = self::https_request($url,$input); + // return $res; + }catch (FddException $e){ + + return ['result'=>'error','code'=>2001,'msg'=>$e->errorMessage()]; + } + + } + + /** + * + * 文档临时查看/下载地址接口(含有效期和次数) + * @param FddContractManageMent $param + * @param int $timeOut + * @throws FddException + * @return 成功时返回,其他抛异常 Geturl + */ + public static function GetUrl(FddContractManageMent $param, $timeOut = 6) + { + //文档临时查看/下载地址接口(含有效期和次数) + $url = FddConfig::FddServer.'/geturl.api'; + try{ + if (!$param->IsContract_idSet()) + throw new FddException("缺少必填参数-contract_id"); + if (!$param->IsValiditySet()) + throw new FddException("缺少必填参数-validity"); + if (!$param->IsQuantitySet()) + throw new FddException("缺少必填参数-quantity"); + $param->SetApp_id(FddConfig::AppId); + $param->SetTimestamp(date('YmdHis')); + if (!$param->IsVSet()){ + $param->SetV('2.0'); + } + //实例化3DES类 + $des = new FddEncryption(); + //设置加密串 + $enc = [ + 'md5' => ['validity','quantity'], + 'sha1'=> ['contract_id'] + ]; + $param->SetMsg_digest($des::GeneralDigest($param,$enc)); + $input = $param->GetValues(); + // header('location:'.$url.$des->ArrayParamToStr($input)); + $res = self::https_request($url,$input); + return $res; + }catch (FddException $e){ + + return ['result'=>'error','code'=>2001,'msg'=>$e->errorMessage()]; + } + + } + + /** + * + * 文档下载接口 + * @param FddContractManageMent $param + * @param int $timeOut + * @throws FddException + * @return 成功时返回,其他抛异常 + */ + public static function DownLoadContract(FddContractManageMent $param, $timeOut = 6) + { + //文档下载接口 地址 + $url = FddConfig::FddServer.'/downLoadContract.api'; + try{ + if (!$param->IsContract_idSet()) + throw new FddException("缺少必填参数-contract_id"); + $param->SetApp_id(FddConfig::AppId); + $param->SetTimestamp(date('YmdHis')); + if (!$param->IsVSet()){ + $param->SetV('2.0'); + } + //实例化3DES类 + $des = new FddEncryption(); + //设置加密串 + $enc = [ + 'md5' => [], + 'sha1'=> ['contract_id'] + ]; + $param->SetMsg_digest($des::GeneralDigest($param,$enc)); + $input = $param->GetValues(); + header('location:'.$url.$des->ArrayParamToStr($input)); + }catch (FddException $e){ + + return ['result'=>'error','code'=>2001,'msg'=>$e->errorMessage()]; + } + + } + + /** + * + * 查询合同hash值接口 + * contract_id 必填参数 + * @param FddContractManageMent $param + * @param int $timeOut + * @throws FddException + * @return 成功时返回,其他抛异常 + */ + public static function GetContractHash(FddContractManageMent $param, $timeOut = 6) + { + //查询合同hash值接口 + $url = FddConfig::FddServer.'/getContractHash.api'; + try{ + if (!$param->IsContract_idSet()) + throw new FddException("缺少必填参数-contract_id"); + $param->SetApp_id(FddConfig::AppId); + $param->SetTimestamp(date('YmdHis')); + if (!$param->IsVSet()){ + $param->SetV('2.0'); + } + //实例化3DES类 + $des = new FddEncryption(); + //设置加密串 + $enc = [ + 'md5' => [], + 'sha1'=> ['contract_id'] + ]; + $param->SetMsg_digest($des::GeneralDigest($param,$enc)); + $input = $param->GetValues(); + $res = self::https_request($url,$input); + return $res; + }catch (FddException $e){ + + return ['result'=>'error','code'=>2001,'msg'=>$e->errorMessage()]; + } + + } + + /** + * + * 客户信息修改接口 + * @param FddUserManage $param + * @param int $timeOut + * @throws FddException + * @return 成功时返回,其他抛异常 + */ + public static function InfoChange(FddUserManage $param, $timeOut = 6) + { + //客户信息修改接口 地址 + $url = FddConfig::FddServer.'/infochange.api'; + try{ + if (!$param->IsCustomer_idSet()) + throw new FddException("缺少必填参数-customer_id"); + $param->SetApp_id(FddConfig::AppId); + $param->SetTimestamp(date('YmdHis')); + if (!$param->IsVSet()){ + $param->SetV('2.0'); + } + //实例化3DES类 + $des = new FddEncryption(); + //设置加密串 + $enc = [ + 'md5' => [], + 'sha1'=> [] + ]; + $param->SetMsg_digest($des::GeneralDigest($param,$enc)); + $input = $param->GetValues(); + $res = self::https_request($url,$input); + return $res; + }catch (FddException $e){ + + return ['result'=>'error','code'=>2001,'msg'=>$e->errorMessage()]; + } + + } + + /** + * + * 合同归档接口 + * @param FddContractManageMent $param + * @param int $timeOut + * @throws FddException + * @return 成功时返回,其他抛异常 + */ + public static function ContractFiling(FddContractManageMent $param, $timeOut = 6) + { + //合同归档接口 + $url = FddConfig::FddServer.'/contractFiling.api'; + try{ + if (!$param->IsContract_idSet()) + throw new FddException("缺少必填参数-contract_id"); + $param->SetApp_id(FddConfig::AppId); + $param->SetTimestamp(date('YmdHis')); + if (!$param->IsVSet()){ + $param->SetV('2.0'); + } + //实例化3DES类 + $des = new FddEncryption(); + //设置加密串 + $enc = [ + 'md5' => [], + 'sha1'=> ['contract_id'] + ]; + $param->SetMsg_digest($des::GeneralDigest($param,$enc)); + $input = $param->GetValues(); + // header('location:'.$url.$des->ArrayParamToStr($input)); + $res = self::https_request($url,$input); + return $res; + }catch (FddException $e){ + + return ['result'=>'error','code'=>2001,'msg'=>$e->errorMessage()]; + } + + } + + /** + * + * 文档验签接口 + * app_id、timestamp、msg_digest、doc_url、file必填参数 + * @param FddSignContract $param + * @param int $timeOut + * @throws FddException + * @return 成功时返回,其他抛异常 + */ + public static function ContractVerify(FddSignContract $param, $timeOut = 6) + { + // 文档验签接口 地址 + $url = FddConfig::FddServer.'/contract_verify.api'; + try{ + //参数处理 + if (!$param->IsFileSet() && !$param->IsDoc_urlSet()) + throw new FddException("缺少必填参数-file、doc_url 二选一"); + + $param->SetApp_id(FddConfig::AppId); + $param->SetTimestamp(date('YmdHis')); + if (!$param->IsVSet()){ + $param->SetV('2.0'); + } + //实例化3DES类 + $des = new FddEncryption(); + //设置加密串 + $enc = [ + 'md5' => [], + 'sha1'=> ['doc_url'] + ]; + $param->SetMsg_digest($des::GeneralDigest($param,$enc)); + $input = $param->GetValues(); + $res = self::https_request($url,$input); + return $res; + }catch (FddException $e){ + + return ['result'=>'error','code'=>2001,'msg'=>$e->errorMessage()]; + } + + } + + /** + * 实名信息哈希存证 + * @param FddCertification $param + * @param int $timeOut + * @throws FddException + * @return 成功时返回,其他抛异常 + */ + public static function HashDeposit(FddDeposit $param, $timeOut = 6) + { + //查询个人实名认证信息 + $url = FddConfig::FddServer.'/hash_deposit.api'; + try{ + //实例化3DES类 + $des = new FddEncryption(); + $encArr = $param->GetValues(); + $encKey = array_keys($encArr); + array_multisort($encKey); + $enc = [ + 'md5' => [], + 'sha1'=>$encKey + ]; + + $param->SetApp_id(FddConfig::AppId); + $param->SetTimestamp(date('YmdHis')); + if (!$param->IsVSet()){ + $param->SetV('2.0'); + } + $param->SetMsg_digest($des::GeneralDigest($param,$enc)); + + $input = $param->GetValues(); + $res = self::https_request($url,$input); + return $res; + + }catch (FddException $e){ + + return ['result'=>'error','code'=>2001,'msg'=>$e->errorMessage()]; + } + + } + + /** + * 个人实名信息存证 + * @param FddDeposit $param + * @param int $timeOut + * @throws FddException + * @return 成功时返回,其他抛异常 + */ + public static function personDeposit(FddDeposit $param, $timeOut = 6) + { + //个人实名信息存证 + $url =FddConfig::FddServer.'/person_deposit.api'; + try{ + + if (!$param->IsDocumentTypeSet()){ + $param->SetDocumentType('0'); + } + //实例化3DES类 + $des = new FddEncryption(); + if("1" === $param->GetVerifiedType()){ + $PublicSecurityEssentialFactor = [ + 'applyNum'=>$param->GetapplyNum(), + 'queryTime'=>$param->GetqueryTime(), + 'systemFlag'=>$param->GetsystemFlag(), + 'idcardCompare'=>$param->GetidcardCompare(), + 'nameCompare'=>$param->GetnameCompare(), + 'vrifiedProvider'=>$param->GetverifiedProvider(), + ]; + $param->SetPublicSecurityEssentialFactor(json_encode($PublicSecurityEssentialFactor)); + if (!$param->IsPublicSecurityEssentialFactorSet()) + throw new FddException("缺少必填参数-PublicSecurityEssentialFactor"); + } + if("2" === $param->GetVerifiedType()){ + $MobileEssentialFactor = [ + 'transactionId'=>$param->GettransactionId(), + 'mobileVerificationCode'=>'',//$param->GetmobileVerificationCode(), + 'verifiedProvider'=>'',//$param->GetverifiedProvider(), + 'result'=>'',//$param->Getresult(), + ]; + $param->SetMobileEssentialFactor(json_encode($MobileEssentialFactor)); + if (!$param->IsMobileEssentialFactorSet()) + throw new FddException("缺少必填参数-MobileEssentialFactor"); + + } + if("3" === $param->GetVerifiedType()){ + $BankEssentialFactor = [ + 'bank'=>$param->Getbank(), + 'bankAccount'=>$param->GetbankAccount(), + 'transactionId'=>$param->GettransactionId(), + 'verifiedProvider'=>$param->GetverifiedProvider(), + 'result'=>$param->Getresult(), + ]; + $param->SetBankEssentialFactor(json_encode($BankEssentialFactor)); + if (!$param->IsBankEssentialFactorSet()) + throw new FddException("缺少必填参数-BankEssentialFactor"); + } + if("4" === $param->GetVerifiedType()){ + $MobileAndBankEssentialFactor = [ + 'bank'=>$param->Getbank(), + 'bankAccount'=>$param->GetbankAccount(), + 'transactionId'=>$param->GettransactionId(), + 'mobileVerificationCode'=>$param->GetmobileVerificationCode(), + 'verifiedProvider'=>$param->GetverifiedProvider(), + 'result'=>$param->Getresult(), + ]; + $param->SetMobileAndBankEssentialFactor(json_encode($MobileAndBankEssentialFactor)); + if (!$param->IsMobileAndBankEssentialFactorSet()) + throw new FddException("缺少必填参数-MobileAndBankEssentialFactor"); + } + /* + $LiveDetection = [ + 'transactionId'=>$param->GettransactionId(), + 'result'=>$param->Getresult(), + ]; + if($param->Getresult()){ + $param->SetLiveDetection(json_encode($LiveDetection)); + } + */ + $enc = [ + 'md5' => [], + 'sha1'=>['bank_essential_factor','customer_id','document_type', + 'idcard','live_detection','mobile','mobile_and_bank_essential_factor', + 'mobile_essential_factor','name','preservation_data_provider', + 'preservation_desc','preservation_name','public_security_essential_factor', + 'verified_time','verified_type'] + ]; + + $param->SetApp_id(FddConfig::AppId); + $param->SetTimestamp(date('YmdHis')); + if (!$param->IsVSet()){ + $param->SetV('2.0'); + } + $param->SetMsg_digest($des::GeneralDigest($param,$enc)); + + $input = $param->GetValues(); + + $res = self::https_request($url,$input); + return $res; + + }catch (FddException $e){ + + return ['result'=>'error','code'=>2001,'msg'=>$e->errorMessage()]; + } + + } + + /** + * 企业信息实名存证 + * @param FddDeposit $param + * @param int $timeOut + * @throws FddException + * @return 成功时返回,其他抛异常 + */ + public static function companyDeposit(FddDeposit $param,FddDeposit $inputPerson, $timeOut = 6) + { + //企业信息实名存证 + $url = FddConfig::FddServer.'/company_deposit.api'; + try{ + + if (!$param->IsDocumentTypeSet()){ + $param->SetDocumentType('0'); + } + + $LiveDetection = [ + 'transactionId'=>$inputPerson->GettransactionId(), + 'result'=>$inputPerson->Getresult(), + ]; + $companyPrincipalVerifiedMsg = [ + 'customer_id'=>$inputPerson->GetCustomerID(), + 'preservation_name'=>$inputPerson->GetPreservationName(), + 'preservation_desc'=>$inputPerson->GetPreservationDesc(), + 'preservation_data_provider'=>$inputPerson->GetPreservationDataProvider(), + 'name'=>$inputPerson->GetName(), + 'document_type'=>$inputPerson->GetDocumentType(), + 'idcard'=>$inputPerson->GetIdCard(), + 'mobile'=>$inputPerson->GetMobile(), + //'verified_time'=>$inputPerson->GetVerifiedTime(), + 'verified_type'=>$inputPerson->GetVerifiedType(), + //'live_detection'=>json_encode($LiveDetection), + ]; + + if("1" === $inputPerson->GetVerifiedType()){ + $PublicSecurityEssentialFactor = [ + 'applyNum'=>$inputPerson->GetapplyNum(), + 'queryTime'=>$inputPerson->GetqueryTime(), + 'systemFlag'=>$inputPerson->GetsystemFlag(), + 'idcardCompare'=>$inputPerson->GetidcardCompare(), + 'nameCompare'=>$inputPerson->GetnameCompare(), + 'vrifiedProvider'=>$inputPerson->GetverifiedProvider(), + ]; + + $companyPrincipalVerifiedMsg['public_security_essential_factor']=$PublicSecurityEssentialFactor; + $inputPerson->SetPublicSecurityEssentialFactor(json_encode($PublicSecurityEssentialFactor)); + if (!$inputPerson->IsPublicSecurityEssentialFactorSet()) + throw new FddException("缺少必填参数-PublicSecurityEssentialFactor"); + } + if("2" === $inputPerson->GetVerifiedType()){ + $MobileEssentialFactor = [ + 'transactionId'=>$inputPerson->GettransactionId(), + 'verifiedProvider'=>$inputPerson->GetverifiedProvider(), + 'result'=>$inputPerson->Getresult(), + ]; + $companyPrincipalVerifiedMsg['mobile_essential_factor']=$MobileEssentialFactor; + $inputPerson->SetMobileEssentialFactor(json_encode($MobileEssentialFactor)); + if (!$inputPerson->IsMobileEssentialFactorSet()) + throw new FddException("缺少必填参数-MobileEssentialFactor"); + } + if("3" === $inputPerson->GetVerifiedType()){ + + $BankEssentialFactor = [ + 'bank'=>$inputPerson->Getbank(), + 'bankAccount'=>$inputPerson->GetbankAccount(), + 'transactionId'=>$inputPerson->GettransactionId(), + 'verifiedProvider'=>$inputPerson->GetverifiedProvider(), + 'result'=>$inputPerson->Getresult(), + ]; + + $companyPrincipalVerifiedMsg['bank_essential_factor']=$BankEssentialFactor; + $inputPerson->SetBankEssentialFactor(json_encode($BankEssentialFactor)); + if (!$inputPerson->IsBankEssentialFactorSet()) + throw new FddException("缺少必填参数-BankEssentialFactor"); + } + if("4" === $inputPerson->GetVerifiedType()){ + $MobileAndBankEssentialFactor = [ + 'bank'=>$inputPerson->Getbank(), + 'bankAccount'=>$inputPerson->GetbankAccount(), + 'transactionId'=>$inputPerson->GettransactionId(), + 'mobileVerificationCode'=>$inputPerson->GetmobileVerificationCode(), + 'verifiedProvider'=>$inputPerson->GetverifiedProvider(), + 'result'=>$inputPerson->Getresult(), + ]; + + $companyPrincipalVerifiedMsg['mobile_and_bank_essential_factor']=$MobileAndBankEssentialFactor; + $inputPerson->SetMobileAndBankEssentialFactor(json_encode($MobileAndBankEssentialFactor)); + if (!$inputPerson->IsMobileAndBankEssentialFactorSet()) + throw new FddException("缺少必填参数-MobileAndBankEssentialFactor"); + } + + + $inputPerson->SetLiveDetection(json_encode($LiveDetection)); + + + //实例化3DES类 + $des = new FddEncryption(); + $param->SetCompanyPrincipalVerifiedMsg(json_encode($companyPrincipalVerifiedMsg)); + + $enc = [ + 'md5' => [], + 'sha1'=>['amount_or_random_code','company_name','company_principal_type','company_principal_verified_msg', + 'credit_code','customer_bank','customer_bank_account','customer_branch_bank', + 'customer_id','document_type','legal_idcard','legal_name','licence','organization', + 'pay_type','preservation_data_provider','preservation_desc','preservation_name',' + public_bank_account','public_branch_bank','transaction_id','user_back_fill_amount_or_random_code', + 'verified_mode','verified_time'] + ]; + + $param->SetApp_id(FddConfig::AppId); + $param->SetTimestamp(date('YmdHis')); + $param->SetV('2.0'); + + $param->SetMsg_digest($des::GeneralDigest($param,$enc)); + + $input = $param->GetValues(); + dump($input); + $res = self::https_request($url,$input); + return $res; + + }catch (FddException $e){ + + return ['result'=>'error','code'=>2001,'msg'=>$e->errorMessage()]; + } + + } + + /** + * 个人实名信息存证 + * @param FddDeposit $param + * @param int $timeOut + * @throws FddException + * @return 成功时返回,其他抛异常 + */ + public static function personVerify(FddVerify $param){ + + $des = new FddEncryption(); + //个人实名信息存证 + $url =FddConfig::FddServer.'/get_person_verify_url.api'; + try{ + $keys=['customer_id','verified_way','page_modify', + 'return_url','notify_url','customer_name','customer_ident_type', + 'customer_ident_no','mobile','ident_front_path', + 'id_photo_optional','result_type','cert_flag', + 'option','cert_type']; + asort($keys); + $enc = [ + 'md5' => [], + 'sha1'=>$keys + ]; + + $param->SetApp_id(FddConfig::AppId); + $param->SetTimestamp(date('YmdHis')); + if (!$param->IsVSet()){ + $param->SetV('2.0'); + } + $param->SetMsg_digest($des::GeneralDigest($param,$enc)); + $input = $param->GetValues(); + + $res = self::https_request($url,$input); + return $res; + + }catch (FddException $e){ + + return ['result'=>'error','code'=>2001,'msg'=>$e->errorMessage()]; + } + + } + + /** + * 企业信息实名存证 + * @param FddDeposit $param + * @param int $timeOut + * @throws FddException + * @return 成功时返回,其他抛异常 + */ + public static function companyVerify(FddVerify $param) + { + + $des = new FddEncryption(); + //企业信息实名存证 + $url = FddConfig::FddServer.'/get_company_verify_url.api'; + try{ + $enc = [ + 'md5' => [], + 'sha1'=>['cert_flag','company_info','company_principal_type','customer_id','id_photo_optional', + 'legal_allow_company_verify_way','legal_authorized_mobile','legal_info','legal_name','mobile', + 'notify_url','option','organization_type','page_modify','return_url','verified_way'] + ]; + + $param->SetApp_id(FddConfig::AppId); + $param->SetTimestamp(date('YmdHis')); + $param->SetV('2.0'); + + $param->SetMsg_digest($des::GeneralDigest($param,$enc)); + + $input = $param->GetValues(); + $res = self::https_request($url,$input); + return $res; + + }catch (FddException $e){ + + return ['result'=>'error','code'=>2001,'msg'=>$e->errorMessage()]; + } + + } + /** + * 存证方案--编号证书 + * @param FddCertification $param + * @param int $timeOut + * @throws FddException + * @return 成功时返回,其他抛异常 + */ + public static function applyClientNumCert(FddDeposit $param, $timeOut = 6) + { + //编号证书申请接口 + $url = FddConfig::FddServer.'/apply_client_numcert.api'; + try{ + //实例化3DES类 + $des = new FddEncryption(); + $enc = [ + 'md5' => [], + 'sha1'=>['customer_id','evidence_no'] + ]; + + $param->SetApp_id(FddConfig::AppId); + $param->SetTimestamp(date('YmdHis')); + if (!$param->IsVSet()){ + $param->SetV('2.0'); + } + $param->SetMsg_digest($des::GeneralDigest($param,$enc)); + + $input = $param->GetValues(); + $res = self::https_request($url,$input); + return $res; + + }catch (FddException $e){ + + return ['result'=>'error','code'=>2001,'msg'=>$e->errorMessage()]; + } + + } + /** + * 实名证书申请 + * @param FddCertification $param + * @param int $timeOut + * @throws FddException + * @return 成功时返回,其他抛异常 + */ + public static function applyCert(FddDeposit $param, $timeOut = 6) + { + //编号证书申请接口 + $url = FddConfig::FddServer.'/apply_cert.api'; + try{ + //实例化3DES类 + $des = new FddEncryption(); + $enc = [ + 'md5' => [], + 'sha1'=>['customer_id','verified_serialno'] + ]; + + $param->SetApp_id(FddConfig::AppId); + $param->SetTimestamp(date('YmdHis')); + if (!$param->IsVSet()){ + $param->SetV('2.0'); + } + $param->SetMsg_digest($des::GeneralDigest($param,$enc)); + + $input = $param->GetValues(); + $res = self::https_request($url,$input); + return $res; + + }catch (FddException $e){ + + return ['result'=>'error','code'=>2001,'msg'=>$e->errorMessage()]; + } + + } + /** + * 实名证书申请 + * @param FddCertification $param + * @param int $timeOut + * @throws FddException + * @return 成功时返回,其他抛异常 + */ + public static function findCert($surl='',$no='') + { + //编号证书申请接口 + $url = FddConfig::FddServer.$surl; + try{ + //实例化3DES类 + $des = new FddEncryption(); + $enc = [ + 'md5' => [], + 'sha1'=>['verified_serialno'] + ]; + $param=new FddDeposit(); + $param->SetVerifiedSerialno($no); + $param->SetApp_id(FddConfig::AppId); + $param->SetTimestamp(date('YmdHis')); + if (!$param->IsVSet()){ + $param->SetV('2.0'); + } + $param->SetMsg_digest($des::GeneralDigest($param,$enc)); + + $input = $param->GetValues(); + $res = self::https_request($url,$input); + return $res; + + }catch (FddException $e){ + + return ['result'=>'error','code'=>2001,'msg'=>$e->errorMessage()]; + } + + } + /** + * + * 文档签署接口(手动签)--合规化存证方案 + * app_id、timestamp、msg_digest、contract_id 、transaction_id、customer_id、必填参数 + * notify_url 选填参数 + * @param FddSignContract $param + * @param int $timeOut + * @throws FddException + * @return 成功时返回,其他抛异常 + */ + public static function ExtsignForDeposit(FddSignContract $param, $timeOut = 6) + { + // 文档签署接口(手动签) 地址 + $url = FddConfig::FddServer.'/extsign.api'; + try{ + //参数处理 + if (!$param->IsTransaction_idSet()) + throw new FddException("缺少必填参数-transaction_id"); + if (!$param->IsContract_idSet()) + throw new FddException("缺少必填参数-contract_id"); + if (!$param->IsCustomer_idSet()) + throw new FddException("缺少必填参数-customer_id"); + if (!$param->IsDoc_titleSet()) + throw new FddException("缺少必填参数-doc_title"); + if (!$param->IsReturn_urlSet()) + throw new FddException("缺少必填参数-return_url"); + if(!$param->IsCustomerNameSet() || !$param->IsCustomerIdentNoSet()){ + throw new FddException("customer_name和customer_ident_no必须同时传入"); + } + $param->SetApp_id(FddConfig::AppId); + $param->SetTimestamp(date('YmdHis')); + $param->SetDoc_title(urlencode($param->GetDoc_title())); + if (!$param->IsVSet()){ + $param->SetV('2.0'); + } + //实例化3DES类 + $des = new FddEncryption(); + $param->SetMsg_digest($des::ExtsignDigest($param)); + $input = $param->GetValues(); + header('location:'.$url.$des->ArrayParamToStr($input)); +// $res = self::https_request($url,$input); +// return $res; + $end = $url.$des->ArrayParamToStr($input); + return $end; + }catch (FddException $e){ + + return ['result'=>'error','code'=>2001,'msg'=>$e->errorMessage()]; + } + + } + + /** + * 通用http函数 + * @param $url + * @param string $data + * @param string $type + * @param string $res + * @return mixed + */ + public static function https_request($url,$data = "",$type="post",$res="json"){ + + /* $apiUrl=FddConfig::FddServer; + $client=new HttpClient($apiUrl); + if($type=="post"){ + $ret=$client->quickPost($url, $data); + }else{ + $ret=$client->quickGet($url); + } + if (is_array($ret)&&$res == "json") { + return json_decode($ret,true); + } + return $ret; */ + echo $url; + dump($data); + + //1.初始化curl + $curl = curl_init(); + //2.设置curl的参数 + curl_setopt($curl, CURLOPT_URL, $url); + curl_setopt($curl, CURLOPT_SSL_VERIFYPEER, FALSE); + curl_setopt($curl, CURLOPT_SSL_VERIFYHOST,2); + curl_setopt($curl, CURLOPT_RETURNTRANSFER, 1); + if ($type == "post"){ + curl_setopt($curl, CURLOPT_POST, 1); + curl_setopt($curl, CURLOPT_POSTFIELDS, $data); + // curl_setopt($curl,CURLOPT_BINARYTRANSFER, true); + } + //3.采集 + $output = curl_exec($curl); + dump($output); + if (curl_errno($curl)) { + echo 'Curl error: ' . curl_error($curl);exit; + } + //4.关闭 + curl_close($curl); + if (is_array($output)&&$res == "json") { + return json_decode($output,true); + } + return $output; + } + + /** + * 文件输出http函数 + * @param $url + * @param string $data + * @param string $type + * @return mixed + */ + public static function https_request_file($url,$data = "",$type="post"){ + //1.初始化curl + $curl = curl_init(); + //2.设置curl的参数 + curl_setopt($curl, CURLOPT_URL, $url); + curl_setopt($curl, CURLOPT_SSL_VERIFYPEER, FALSE); + curl_setopt($curl, CURLOPT_SSL_VERIFYHOST,2); + curl_setopt($curl, CURLOPT_RETURNTRANSFER, 1); + if ($type == "post"){ + curl_setopt($curl, CURLOPT_POST, 1); + curl_setopt($curl, CURLOPT_POSTFIELDS, $data); + } + //3.采集 + $output = curl_exec($curl); + header("Content-type: application/octet-stream"); + + header("Content-Disposition: attachment; filename=原文出证".time().".pdf"); + + echo $output; + + //4.关闭 + curl_close($curl); + } + + /** + * 图片转base64文件 + * @param $image_file + * @return string + */ + public function base64EncodeImage ($image_file) + { + $base64_image = ""; + $image_info = getimagesize($image_file); + $image_data = fread(fopen($image_file, "r"), filesize($image_file)); + $base64_image = "data:" . $image_info["mime"] . ";base64," . chunk_split(base64_encode($image_data)); + return $base64_image; + } + +} ?> \ No newline at end of file diff --git a/extend/fdd/FddConfig.php b/extend/fdd/FddConfig.php new file mode 100644 index 0000000..8eb09c1 --- /dev/null +++ b/extend/fdd/FddConfig.php @@ -0,0 +1,47 @@ +values) || count($this->values) <= 0) + { + throw new FddException("数组数据异常!"); + } + + $xml = ""; + foreach ($this->values as $key=>$val) + { + if (is_numeric($val)){ + $xml.="<".$key.">".$val."<".$key.">"; + }else{ + $xml.="<".$key."><".$key.">"; + } + } + $xml.=""; + return $xml; + } + + /** + * 将xml转为array + * @param string $xml + * @throws FddException + * @return $this->value + */ + public function FromXml($xml) + { + if(!$xml){ + throw new FddException("xml数据异常!"); + } + //将XML转为array + //禁止引用外部xml实体 + libxml_disable_entity_loader(true); + $this->values = json_decode(json_encode(simplexml_load_string($xml, "SimpleXMLElement", LIBXML_NOCDATA)), true); + return $this->values; + } + + /** + * 格式化参数格式化成url参数 + */ + public function ToUrlParams() + { + $buff = ""; + foreach ($this->values as $k => $v) + { + if($k != "sign" && $v != "" && !is_array($v)){ + $buff .= $k . "=" . $v . "&"; + } + } + + $buff = trim($buff, "&"); + return $buff; + } + + /** + * 设置AppID + * @param string $value + **/ + public function SetApp_id($value) + { + $this->values["app_id"] = $value; + } + + /** + * 获取AppId + * @return 值 + **/ + public function GetApp_id() + { + return $this->values["app_id"]; + } + + /** + * 判断AppId是否存在 + * @return true 或 false + **/ + public function IsApp_idSet() + { + return array_key_exists("organization", $this->values); + } + + /** + * 设置请求时间 + * @param string $value + **/ + public function SetTimestamp($value) + { + $this->values["timestamp"] = $value; + } + /** + * 获取请求时间 + * @return 值 + **/ + public function GetTimestamp() + { + return $this->values["timestamp"]; + } + /** + * 判断请求时间是否存在 + * @return true 或 false + **/ + public function IsTimestampSet() + { + return array_key_exists("timestamp", $this->values); + } + /** + * 设置版本号 + * @param string $value + **/ + public function SetV($value) + { + $this->values["v"] = $value; + } + /** + * 获取版本号 + * @return 值 + **/ + public function GetV() + { + return $this->values["v"]; + } + /** + * 判断版本号是否存在 + * @return true 或 false + **/ + public function IsVSet() + { + return array_key_exists("v", $this->values); + } + + /** + * 设置消息摘要 + * @param string $value + **/ + public function SetMsg_digest($value) + { + $this->values["msg_digest"] = $value; + } + /** + * 获取消息摘要 + * @return 值 + **/ + public function GetMsg_digest() + { + return $this->values["msg_digest"]; + } + /** + * 判断消息摘要是否存在 + * @return true 或 false + **/ + public function IsMsg_digestSet() + { + return array_key_exists("msg_digest", $this->values); + } + + /** + * 获取设置的值 + */ + public function GetValues() + { + return $this->values; + } + } + +/** + * 合规化方案 账号注册 + * Class FddAccount + */ +class FddAccount extends FddDataBase{ + + /** + * 设置 用户在接入方的唯一标识 + * @param string $value + **/ + public function SetOpenID($value) + { + $this->values['open_id'] = $value; + } + + /** + * 判断 唯一标识 是否存在 + * @return true 或 false + **/ + public function IsOpenIDSet() + { + return array_key_exists('open_id', $this->values); + } + + /** + * 设置用户类型 1:个人,2:企业 + * @param string $value + **/ + public function SetAccountType($value) + { + $this->values['account_type'] = $value; + } + + /** + * 判断 唯一标识 是否存在 + * @return true 或 false + **/ + public function IsAccountTypeSet() + { + return array_key_exists('account_type', $this->values); + } +} + + /** + * 合同文档模板和生成类 + * Class FddTemplate + */ +class FddTemplate extends FddDataBase { + /** + * 设置 模板编号 + * @param string $value + **/ + public function SetTemplate_id($value) + { + $this->values['template_id'] = $value; + } + /** + * 获取 模板编号 + * @return 值 + **/ + public function GetTemplate_id() + { + return $this->values['template_id']; + } + /** + * 判断 模板编号 是否存在 + * @return true 或 false + **/ + public function IsTemplate_idSet() + { + return array_key_exists('template_id', $this->values); + } + /** + * 设置 文档类型 + * @param string $value + **/ + public function SetDoc_type($value) + { + $this->values['doc_type'] = $value; + } + /** + * 判断 文档类型 是否存在 + * @param string $value + **/ + public function IsDoc_typeSet() + { + return array_key_exists('doc_type', $this->values); + } + /** + * 设置 文档地址 + * @param string $value + **/ + public function SetDoc_url($value) + { + $this->values['doc_url'] = $value; + } + /** + * 判断 文档地址 是否存在 + * @return true 或 false + **/ + public function IsDoc_urlSet() + { + return array_key_exists('doc_url', $this->values); + } + /** + * 设置 文档标题 + * @param string $value + **/ + public function SetDoc_title($value) + { + $this->values['doc_title'] = $value; + } + /** + * 获取 文档标题 + * @return 值 + **/ + public function GetDoc_title() + { + return $this->values['doc_title']; + } + /** + * 判断 文档标题 是否存在 + * @return true 或 false + **/ + public function IsDoc_titleSet() + { + return array_key_exists('doc_title', $this->values); + } + /** + * 设置 PDF模板 + * @param string $value + **/ + public function SetFile($value) + { + $this->values['file'] = $value; + } + /** + * 判断 PDF模板 是否存在 + * @return true 或 false + **/ + public function IsFileSet() + { + return array_key_exists('file', $this->values); + } + /** + * 设置 合同编号 + * @param string $value + **/ + public function SetContract_id($value) + { + $this->values['contract_id'] = $value; + } + /** + * 获取 合同编号 + * @return 值 + **/ + public function GetContract_id() + { + return $this->values['contract_id']; + } + /** + * 判断 合同编号 是否存在 + * @return true 或 false + **/ + public function IsContract_idSet() + { + return array_key_exists('contract_id', $this->values); + } + /** + * 设置 字体大小 + * @param string $value + **/ + public function SetFont_size($value) + { + $this->values['font_size'] = $value; + } + /** + * 获取 字体大小 + * @return 值 + **/ + public function GetFont_size() + { + return $this->values['font_size']; + } + /** + * 判断 字体大小 是否存在 + * @return true 或 false + **/ + public function IsFont_sizeSet() + { + return array_key_exists('font_size', $this->values); + } + /** + * 设置 字体类型 + * @param string $value + **/ + public function SetFont_type($value) + { + $this->values['font_type'] = $value; + } + /** + * 获取 字体类型 + * @return 值 + **/ + public function GetFont_type() + { + return $this->values['font_type']; + } + /** + * 判断 字体类型 是否存在 + * @return true 或 false + **/ + public function IsFont_typeSet() + { + return array_key_exists('font_type', $this->values); + } + /** + * 设置 填充内容 + * @param string $value + **/ + public function SetParameter_map($value) + { + $this->values['parameter_map'] = $value; + } + /** + * 获取 填充内容 + * @return 值 + **/ + public function GetParameter_map() + { + return $this->values['parameter_map']; + } + /** + * 判断 填充内容 是否存在 + * @return true 或 false + **/ + public function IsParameter_mapSet() + { + return array_key_exists('parameter_map', $this->values); + } + /** + * 设置 动态表格 + * @param string $value + **/ + public function SetDynamic_tables($value) + { + $this->values['dynamic_tables'] = $value; + } + /** + * 获取 动态表格 + * @return 值 + **/ + public function GetDynamic_tables() + { + return $this->values['dynamic_tables']; + } + /** + * 判断 动态表格 是否存在 + * @return true 或 false + **/ + public function IsDynamic_tablesSet() + { + return array_key_exists('dynamic_tables', $this->values); + } + /** + * 设置 页面添加table + * @param string $value + **/ + public function SetInsertWay($value) + { + $this->values['insertWay'] = $value; + } + /** + * 获取 页面添加table + * @return 值 + **/ + public function GetInsertWay() + { + return $this->values['insertWay']; + } + /** + * 判断 页面添加table 是否存在 + * @return true 或 false + **/ + public function IsInsertWaySet() + { + return array_key_exists('insertWay', $this->values); + } + /** + * 设置 关键字 + * @param string $value + **/ + public function SetKeyword($value) + { + $this->values['keyword'] = $value; + } + /** + * 获取 关键字 + * @return 值 + **/ + public function GetKeyword() + { + return $this->values['keyword']; + } + /** + * 判断 关键字 是否存在 + * @return true 或 false + **/ + public function IsKeywordSet() + { + return array_key_exists('keyword', $this->values); + } + /** + * 设置 从第几页开始 + * @param string $value + **/ + public function SetPageBegin($value) + { + $this->values['pageBegin'] = $value; + } + /** + * 获取 从第几页开始 + * @return 值 + **/ + public function GetPageBegin() + { + return $this->values['pageBegin']; + } + /** + * 判断 从第几页开始 是否存在 + * @return true 或 false + **/ + public function IsPageBeginSet() + { + return array_key_exists('pageBegin', $this->values); + } + /** + * 设置 边框 + * @param string $value + **/ + public function SetBorderFlag($value) + { + $this->values['borderFlag'] = $value; + } + /** + * 获取 边框 + * @return 值 + **/ + public function GetBorderFlag() + { + return $this->values['borderFlag']; + } + /** + * 判断 边框 是否存在 + * @return true 或 false + **/ + public function IsBorderFlagSet() + { + return array_key_exists('borderFlag', $this->values); + } + /** + * 设置 正文行高 + * @param string $value + **/ + public function SetCellHeight($value) + { + $this->values['cellHeight'] = $value; + } + /** + * 获取 正文行高 + * @return 值 + **/ + public function GetCellHeight() + { + return $this->values['cellHeight']; + } + /** + * 判断 正文行高 是否存在 + * @return true 或 false + **/ + public function IsCellHeightSet() + { + return array_key_exists('cellHeight', $this->values); + } + /** + * 设置 Table中每个单元的水平对齐方式 + * @param string $value + **/ + public function SetCellHorizontalAlignment($value) + { + $this->values['cellHorizontalAlignment'] = $value; + } + /** + * 获取 Table中每个单元的水平对齐方式 + * @return 值 + **/ + public function GetCellHorizontalAlignment() + { + return $this->values['cellHorizontalAlignment']; + } + /** + * 判断 Table中每个单元的水平对齐方式 是否存在 + * @return true 或 false + **/ + public function IsCellHorizontalAlignmentSet() + { + return array_key_exists('cellHorizontalAlignment', $this->values); + } + /** + * 设置 Table中每个单元的垂直对齐方式 + * @param string $value + **/ + public function SetCellVerticalAlignment($value) + { + $this->values['cellVerticalAlignment'] = $value; + } + /** + * 获取 Table中每个单元的垂直对齐方式 + * @return 值 + **/ + public function GetCellVerticalAlignment() + { + return $this->values['cellVerticalAlignment']; + } + /** + * 判断 Table中每个单元的垂直对齐方式 是否存在 + * @return true 或 false + **/ + public function IsCellVerticalAlignmentSet() + { + return array_key_exists('cellVerticalAlignment', $this->values); + } + /** + * 设置 表头上方的一级标题 + * @param string $value + **/ + public function SetTheFirstHeader($value) + { + $this->values['theFirstHeader'] = $value; + } + /** + * 获取 表头上方的一级标题 + * @return 值 + **/ + public function GetTheFirstHeader() + { + return $this->values['theFirstHeader']; + } + /** + * 判断 表头上方的一级标题 是否存在 + * @return true 或 false + **/ + public function IsTheFirstHeaderSet() + { + return array_key_exists('theFirstHeader', $this->values); + } + /** + * 设置 表头信息 + * @param string $value + **/ + public function SetHeaders($value) + { + $this->values['headers'] = $value; + } + /** + * 获取 表头信息 + * @return 值 + **/ + public function GetHeaders() + { + return $this->values['headers']; + } + /** + * 判断 表头信息 是否存在 + * @return true 或 false + **/ + public function IsHeadersSet() + { + return array_key_exists('headers', $this->values); + } + /** + * 设置 表头对齐方式 + * @param string $value + **/ + public function SetHeadersAlignment($value) + { + $this->values['headersAlignment'] = $value; + } + /** + * 获取 表头对齐方式 + * @return 值 + **/ + public function GetHeadersAlignment() + { + return $this->values['headersAlignment']; + } + /** + * 判断 表头对齐方式 是否存在 + * @return true 或 false + **/ + public function IsHeadersAlignmentSet() + { + return array_key_exists('headersAlignment', $this->values); + } + /** + * 设置 正文 + * @param string $value + **/ + public function SetDatas($value) + { + $this->values['datas'] = $value; + } + /** + * 获取 正文 + * @return 值 + **/ + public function GetDatas() + { + return $this->values['datas']; + } + /** + * 判断 正文 是否存在 + * @return true 或 false + **/ + public function IsDatasSet() + { + return array_key_exists('datas', $this->values); + } + /** + * 设置 各列宽度比例 + * @param string $value + **/ + public function SetColWidthPercent($value) + { + $this->values['colWidthPercent'] = $value; + } + /** + * 获取 各列宽度比例 + * @return 值 + **/ + public function GetColWidthPercent() + { + return $this->values['colWidthPercent']; + } + /** + * 判断 各列宽度比例 是否存在 + * @return true 或 false + **/ + public function IsColWidthPercentSet() + { + return array_key_exists('colWidthPercent', $this->values); + } + /** + * 设置 table的水平对齐方式 + * @param string $value + **/ + public function SetTableHorizontalAlignment($value) + { + $this->values['tableHorizontalAlignment'] = $value; + } + /** + * 获取 table的水平对齐方式 + * @return 值 + **/ + public function GetTableHorizontalAlignment() + { + return $this->values['tableHorizontalAlignment']; + } + /** + * 判断 table的水平对齐方式 是否存在 + * @return true 或 false + **/ + public function IsTableHorizontalAlignmentSet() + { + return array_key_exists('tableHorizontalAlignment', $this->values); + } + /** + * 设置 table宽度的百分比 + * @param string $value + **/ + public function SetTableWidthPercentage($value) + { + $this->values['tableWidthPercentage'] = $value; + } + /** + * 获取 table宽度的百分比 + * @return 值 + **/ + public function GetTableWidthPercentage() + { + return $this->values['tableWidthPercentage']; + } + /** + * 判断 table宽度的百分比 是否存在 + * @return true 或 false + **/ + public function IsTableWidthPercentageSet() + { + return array_key_exists('tableWidthPercentage', $this->values); + } + /** + * 设置 设置table居左居中居右后的水平偏移量 + * @param string $value + **/ + public function SetTableHorizontalOffset($value) + { + $this->values['tableHorizontalOffset'] = $value; + } + /** + * 获取 设置table居左居中居右后的水平偏移量 + * @return 值 + **/ + public function GetTableHorizontalOffset() + { + return $this->values['tableHorizontalOffset']; + } + /** + * 判断 设置table居左居中居右后的水平偏移量 是否存在 + * @return true 或 false + **/ + public function IsTableHorizontalOffsetSet() + { + return array_key_exists('tableHorizontalOffset', $this->values); + } + +} + + /** + * 合同签署类 + * Class FddSignContract + */ +class FddSignContract extends FddDataBase { + + /** + * 设置 存证方案手动签署时所传身份证--用于刷脸验证,姓名和身份证需要同时传 + * @param string $value + **/ + public function SetCustomerIdentNo($value) + { + $this->values['customer_ident_no'] = $value; + } + /** + * 获取 存证方案手动签署时所传身份证--用于刷脸验证,姓名和身份证需要同时传 + * @param string $value + **/ + public function GetCustomerIdentNo() + { + return $this->values['customer_ident_no']; + } + /** + * 判断 存证方案手动签署时所传身份证 是否存在 + * @return true 或 false + **/ + public function IsCustomerIdentNoSet() + { + return array_key_exists('customer_ident_no', $this->values); + } + + /** + * 设置 存证方案手动签署时所传姓名--用于刷脸验证,姓名和身份证需要同时传 + * @param string $value + **/ + public function SetCustomerName($value) + { + $this->values['customer_name'] = $value; + } + /** + * 获取 存证方案手动签署时所传姓名--用于刷脸验证,姓名和身份证需要同时传 + * @param string $value + **/ + public function GetCustomerName() + { + return $this->values['customer_name']; + } + /** + * 判断 存证方案手动签署时所传姓名 是否存在 + * @return true 或 false + **/ + public function IsCustomerNameSet() + { + return array_key_exists('customer_name', $this->values); + } + /** + * 设置 存证方案手动签署时所传手机号 + * @param string $value + **/ + public function SetCustomerMobile($value) + { + $this->values['customer_mobile'] = $value; + } + /** + * 获取 存证方案手动签署时所传手机号 + * @param string $value + **/ + public function GetCustomerMobile() + { + return $this->values['customer_mobile']; + } + /** + * 判断 存证方案手动签署时所传手机号 是否存在 + * @return true 或 false + **/ + public function IsCustomerMobileSet() + { + return array_key_exists('customer_mobile', $this->values); + } + /** + * 设置 签署时所传合同编号 + * @param string $value + **/ + public function SetContract_id($value) + { + $this->values['contract_id'] = $value; + } + /** + * 获取 签署时所传合同编号 + * @param string $value + **/ + public function GetContract_id() + { + return $this->values['contract_id']; + } + /** + * 判断 签署时所传合同编号 是否存在 + * @return true 或 false + **/ + public function IsContract_idSet() + { + return array_key_exists('contract_id', $this->values); + } + /** + * 设置 签署时所传客户编号 + * @param string $value + **/ + public function SetCustomer_id($value) + { + $this->values['customer_id'] = $value; + } + /** + * 获取 签署时所传合同编号 + * @param string $value + **/ + public function GetCustomer_id() + { + return $this->values['customer_id']; + } + /** + * 判断 签署时所传客户编号 是否存在 + * @return true 或 false + **/ + public function IsCustomer_idSet() + { + return array_key_exists('customer_id', $this->values); + } + /** + * 设置 签署时所传交易号 + * @param string $value + **/ + public function SetTransaction_id($value) + { + $this->values['transaction_id'] = $value; + } + /** + * 获取 是否设置有效期 + * @param string $value + **/ + public function GetTransaction_id() + { + return $this->values['transaction_id']; + } + /** + * 判断 签署时所传交易号 是否存在 + **/ + public function IsTransaction_idSet() + { + return array_key_exists('transaction_id', $this->values); + } + /** + * 设置 有效时间 + * @param string $value + **/ + public function SetExpire_time($value) + { + $this->values['expire_time'] = $value; + } + /** + * 设置 传入url + * @param string $value + **/ + public function SetSource_url($value) + { + $this->values['source_url'] = $value; + } + /** + * 判断 传入url 是否存在 + **/ + public function IsSource_urlSet() + { + return array_key_exists('source_url', $this->values); + } + /** + * 设置 短信标识 + * @param string $value + **/ + public function SetPush_type($value) + { + $this->values['push_type'] = $value; + } + /** + * 判断 短信标识 是否存在 + **/ + public function IsPush_typeSet() + { + return array_key_exists('push_type', $this->values); + } + /** + * 设置 定位关键字 + * @param string $value + **/ + public function SetSign_keyword($value) + { + $this->values['sign_keyword'] = $value; + } + /** + * 获取 有效期 + **/ + public function GetSign_keyword() + { + return $this->values['sign_keyword']; + } + /** + * 判断 定位关键字 是否存在 + **/ + public function IsSign_keywordSet() + { + return array_key_exists('sign_keyword', $this->values); + } + /** + * 设置 定位关键字(多) + * @param string $value + **/ + public function SetSign_keywords($value) + { + $this->values['sign_keywords'] = $value; + } + /** + * 判断 定位关键字(多) 是否存在 + **/ + public function IsSign_keywordsSet() + { + return array_key_exists('sign_keywords', $this->values); + } + /** + * 设置 是否设置有效期 + * @param string $value + **/ + public function SetLimit_type($value) + { + $this->values['limit_type'] = $value; + } + /** + * 获取 是否设置有效期 + **/ + public function GetLimit_type() + { + return $this->values['limit_type']; + } + /** + * 判断 是否设置有效期 是否存在 + **/ + public function IsLimit_typeSet() + { + return array_key_exists('limit_type', $this->values); + } + /** + * 设置 有效期 + * @param string $value + **/ + public function SetValidity($value) + { + $this->values['validity'] = $value; + } + /** + * 获取 有效期 + **/ + public function GetValidity() + { + return $this->values['validity']; + } + /** + * 判断 有效期 是否存在 + **/ + public function IsValiditySet() + { + return array_key_exists('validity', $this->values); + } + /** + * 设置 页面跳转url(签名结果同步通知) + * @param string $value + **/ + public function SetReturn_url($value) + { + $this->values['return_url'] = $value; + } + /** + * 判断 页面跳转url(签名结果同步通知) 是否存在 + **/ + public function IsReturn_urlSet() + { + return array_key_exists('return_url', $this->values); + } + /** + * 设置 签名结果异步步通知url + * @param string $value + **/ + public function SetNotify_url($value) + { + $this->values['notify_url'] = $value; + } + /** + * 设置 签名结果异步步通知url + * @param string $value + **/ + public function IsNotify_urlSet() + { + return array_key_exists('notify_url', $this->values); + } + /** + * 设置 文档标题 + * @param string $value + **/ + public function SetDoc_title($value) + { + $this->values['doc_title'] = $value; + } + /** + * 获取 文档标题 + * @param string $value + **/ + public function GetDoc_title() + { + return $this->values['doc_title']; + } + /** + * 判断 文档标题 是否存在 + * @return true 或 false + **/ + public function IsDoc_titleSet() + { + return array_key_exists('doc_title', $this->values); + } + /** + * 设置 手写章 + * @param string $value + **/ + public function SetHandsignimg($value) + { + $this->values['handsignimg'] = $value; + } + /** + * 设置 短信验证码 + * @param string $value + **/ + public function SetSms($value) + { + $this->values['sms'] = $value; + } + /** + * 判断 短信验证码 是否存在 + * @param string $value + **/ + public function IsSmsSet() + { + return array_key_exists('sms', $this->values); + } + /** + * 设置 短信校验令牌 + * @param string $value + **/ + public function SetMarkUUID($value) + { + $this->values['markUUID'] = $value; + } + /** + * 判断 短信校验令牌 是否存在 + * @param string $value + **/ + public function IsMarkUUIDSet() + { + return array_key_exists('markUUID', $this->values); + } + /** + * 设置 批量签署记录主键 + * @param string $value + **/ + public function SetExtBatchSignId($value) + { + $this->values['extBatchSignId'] = $value; + } + /** + * 判断 批量签署记录主键 是否存在 + * @param string $value + **/ + public function IsExtBatchSignIdSet() + { + return array_key_exists('extBatchSignId', $this->values); + } + /** + * 设置 填充内容 + * @param string $value + **/ + public function SetParameter_map($value) + { + $this->values['parameter_map'] = $value; + } + /** + * 判断 填充内容 是否存在 + * @return true 或 false + **/ + public function IsParameter_mapSet() + { + return array_key_exists('parameter_map', $this->values); + } + /** + * 设置 签署截止时间 + * @param string $value + **/ + public function SetExpiration_time($value) + { + $this->values['expiration_time'] = $value; + } + /** + * 判断 签署截止时间 是否存在 + * @return true 或 false + **/ + public function IsExpiration_timeSet() + { + return array_key_exists('expiration_time', $this->values); + } + /** + * 设置 是否发送通知(短信 及邮件) + * @param string $value + **/ + public function SetSend_msg($value) + { + $this->values['send_msg'] = $value; + } + /** + * 判断 是否发送通知(短信 及邮件) 是否存在 + * @return true 或 false + **/ + public function IsSend_msgSet() + { + return array_key_exists('send_msg', $this->values); + } + /** + * 设置 待签署人姓名 + * @param string $value + **/ + public function SetUser_names($value) + { + $this->values['user_names'] = $value; + } + /** + * 判断 待签署人姓名 是否存在 + * @return true 或 false + **/ + public function IsUser_namesSet() + { + return array_key_exists('user_names', $this->values); + } + /** + * 设置 待签署人手机号 + * @param string $value + **/ + public function SetUser_mobiles($value) + { + $this->values['user_mobiles'] = $value; + } + /** + * 判断 待签署人手机号 是否存在 + * @return true 或 false + **/ + public function IsUser_mobilesSet() + { + return array_key_exists('user_mobiles', $this->values); + } + /** + * 设置 待签署人邮箱 + * @param string $value + **/ + public function SetUser_emails($value) + { + $this->values['user_emails'] = $value; + } + /** + * 判断 待签署人邮箱 是否存在 + * @return true 或 false + **/ + public function IsUser_emailsSet() + { + return array_key_exists('user_emails', $this->values); + } + /** + * 设置 批次号(流水号) + * @param string $value + **/ + public function SetBatch_id($value) + { + $this->values['batch_id'] = $value; + } + /** + * 获取 批次号(流水号) + * @param string $value + **/ + public function GetBatch_id() + { + return $this->values['batch_id']; + } + /** + * 判断 批次号(流水号) 是否存在 + * @return true 或 false + **/ + public function IsBatch_idSet() + { + return array_key_exists('batch_id', $this->values); + } + /** + * 设置 代理人客户编号 + * @param string $value + **/ + public function SetOuth_customer_id($value) + { + $this->values['outh_customer_id'] = $value; + } + /** + * 获取 代理人客户编号 + * @param string $value + **/ + public function GetOuth_customer_id() + { + return $this->values['outh_customer_id']; + } + /** + * 判断 代理人客户编号 是否存在 + * @return true 或 false + **/ + public function IsOuth_customer_idSet() + { + return array_key_exists('outh_customer_id', $this->values); + } + /** + * 设置 签章数据 + * @param string $value + **/ + public function SetSign_data($value) + { + $this->values['sign_data'] = $value; + } + /** + * 获取 签章数据 + * @param string $value + **/ + public function GetSign_data() + { + return $this->values['sign_data']; + } + /** + * 判断 签章数据 是否存在 + * @return true 或 false + **/ + public function IsSign_dataSet() + { + return array_key_exists('sign_data', $this->values); + } + /** + * 设置 批量请求标题 + * @param string $value + **/ + public function SetBatch_title($value) + { + $this->values['batch_title'] = $value; + } + /** + * 获取 批量请求标题 + * @param string $value + **/ + public function GetBatch_title() + { + return $this->values['batch_title']; + } + /** + * 判断 批量请求标题 是否存在 + * @return true 或 false + **/ + public function IsBatch_titleSet() + { + return array_key_exists('batch_title', $this->values); + } + /** + * 设置 客户类型 + * @param string $value + **/ + public function SetClientType($value) + { + $this->values['clientType'] = $value; + } + /** + * 判断 客户类型 是否存在 + * @return true 或 false + **/ + public function IsClientTypeSet() + { + return array_key_exists('clientType', $this->values); + } + /** + * 设置 客户角色 + * @param string $value + **/ + public function SetClient_role($value) + { + $this->values['client_role'] = $value; + } + /** + * 判断 客户角色 是否存在 + * @return true 或 false + **/ + public function IsClient_roleSet() + { + return array_key_exists('client_role', $this->values); + } + /** + * 设置 有效次数 + * @param string $value + **/ + public function SetQuantity($value) + { + $this->values['quantity'] = $value; + } + /** + * 获取 有效次数 + * @param string $value + **/ + public function GetQuantity() + { + return $this->values['quantity']; + } + /** + * 判断 有效次数 是否存在 + * @return true 或 false + **/ + public function IsQuantitySet() + { + return array_key_exists('quantity', $this->values); + } + /** + * 设置 关键字签章策略 + * @param string $value + **/ + public function SetKeyword_strategy($value) + { + $this->values['keyword_strategy'] = $value; + } + /** + * 判断 关键字签章策略 是否存在 + * @return true 或 false + **/ + public function IsKeyword_strategySet() + { + return array_key_exists('keyword_strategy', $this->values); + } + /** + * 设置 关键字签章策略 + * @param string $value + **/ + public function SetAcrosspage_customer_id($value) + { + $this->values['acrosspage_customer_id'] = $value; + } + /** + * 判断 关键字签章策略 是否存在 + * @return true 或 false + **/ + public function IsAcrosspage_customer_idSet() + { + return array_key_exists('acrosspage_customer_id', $this->values); + } + /** + * 设置 定位类型 + * @param string $value + **/ + public function SetPosition_type($value) + { + $this->values['position_type'] = $value; + } + /** + * 获取 定位类型 + * @param string $value + **/ + public function GetPosition_type() + { + return $this->values['position_type']; + } + /** + * 判断 定位类型 是否存在 + * @return true 或 false + **/ + public function IsPosition_typeSet() + { + return array_key_exists('position_type', $this->values); + } + /** + * 设置 盖章点x坐标 + * @param string $value + **/ + public function SetX($value) + { + $this->values['x'] = $value; + } + /** + * 获取 盖章点X坐标 + * @param string $value + **/ + public function GetX() + { + return $this->values['x']; + } + /** + * 判断 盖章点x坐标 是否存在 + * @return true 或 false + **/ + public function IsXSet() + { + return array_key_exists('x', $this->values); + } + /** + * 设置 签章页码,从0开始。 + * @param string $value + **/ + public function SetPagenum($value) + { + $this->values['pagenum'] = $value; + } + /** + * 获取 盖章点Y坐标 + * @param string $value + **/ + public function GetPagenum() + { + return $this->values['pagenum']; + } + /** + * 判断 签章页码,从 0开始。 是否存在 + * @return true 或 false + **/ + public function IsPagenumSet() + { + return array_key_exists('pagenum', $this->values); + } + /** + * 设置 定位坐标 + * @param string $value + **/ + public function SetSignature_positions($value) + { + $this->values['signature_positions'] = $value; + } + /** + * 设置 盖章点Y坐标 + * @param string $value + **/ + public function SetY($value) + { + $this->values['y'] = $value; + } + /** + * 获取 盖章点Y坐标 + * @param string $value + **/ + public function GetY() + { + return $this->values['y']; + } + + /** + * 判断 盖章点Y坐标 是否存在 + * @return true 或 false + **/ + public function IsYSet() + { + return array_key_exists('Y', $this->values); + } + /** + * 设置 签章图片类型 + * @param string $value + **/ + public function SetShow_type($value) + { + $this->values['show_type'] = $value; + } + /** + * 设置 替换标志 + * @param string $value + **/ + public function SetReplace_signature_flag($value) + { + $this->values['replace_signature_flag'] = $value; + } + + /** + * 设置 合同 url 地址 + * @param string $value + **/ + public function SetDoc_url($value) + { + $this->values['doc_url'] = $value; + } + /** + * 判断 合同 url 地址 是否存在 + * @return true 或 false + **/ + public function IsDoc_urlSet() + { + return array_key_exists('doc_url', $this->values); + } + /** + * 设置 合同流文件 + * @param string $value + **/ + public function SetFile($value) + { + $this->values['file'] = $value; + } + /** + * 判断 合同流文件 是否存在 + * @return true 或 false + **/ + public function IsFileSet() + { + return array_key_exists('file', $this->values); + } +} + + /** + * 合同签署状态查询类 + * Class FddQuerySignResult + */ +class FddQuerySignResult extends FddDataBase { + /** + * 设置 签署时所传合同编号 + * @param string $value + **/ + public function SetContract_id($value) + { + $this->values['contract_id'] = $value; + } + /** + * 判断 签署时所传合同编号 是否存在 + * @return true 或 false + **/ + public function IsContract_idSet() + { + return array_key_exists('contract_id', $this->values); + } + /** + * 设置 签署时所传客户编号 + * @param string $value + **/ + public function SetCustomer_id($value) + { + $this->values['customer_id'] = $value; + } + /** + * 判断 签署时所传客户编号 是否存在 + * @return true 或 false + **/ + public function IsCustomer_idSet() + { + return array_key_exists('customer_id', $this->values); + } + /** + * 设置 签署时所传交易号 + * @param string $value + **/ + public function SetTransaction_id($value) + { + $this->values['transaction_id'] = $value; + } + /** + * 判断 签署时所传交易号 是否存在 + * @param string $value + **/ + public function IsTransaction_idSet() + { + return array_key_exists('transaction_id', $this->values); + } + + +} + + /** + * 合同管理类 + * Class FddContractManageMent + */ +class FddContractManageMent extends FddDataBase { + /** + * 设置 合同编号 + * @param string $value + **/ + public function SetContract_id($value) + { + $this->values['contract_id'] = $value; + } + /** + * 获取 签署时所传合同编号 + * @param string $value + **/ + public function GetContract_id() + { + return $this->values['contract_id']; + } + /** + * 判断 签署时所传合同编号 是否存在 + * @return true 或 false + **/ + public function IsContract_idSet() + { + return array_key_exists('contract_id', $this->values); + } + /** + * 设置 合同编号(多) + * @param string $value + **/ + public function SetContract_ids($value) + { + $this->values['contract_ids'] = $value; + } + /** + * 判断 签署时所传合同编号 是否存在 + * @return true 或 false + **/ + public function IsContract_idsSet() + { + return array_key_exists('contract_ids', $this->values); + } + /** + * 设置用户ID + * @param string $value + **/ + public function SetCustomer_id($value) + { + $this->values['customer_id'] = $value; + } + /** + * 设置 有效期 + * @param string $value + **/ + public function SetValidity($value) + { + $this->values['validity'] = $value; + } + /** + * 判断 有效期 是否存在 + * @param string $value + **/ + public function IsValiditySet() + { + return array_key_exists('validity', $this->values); + } + /** + * 设置 有效次数 + * @param string $value + **/ + public function SetQuantity($value) + { + $this->values['quantity'] = $value; + } + /** + * 判断 有效次数 是否存在 + * @return true 或 false + **/ + public function IsQuantitySet() + { + return array_key_exists('quantity', $this->values); + } +} + + /** + * 用户管理类 + * Class FddUserManage + */ +class FddUserManage extends FddDataBase { + /** + * 设置 合同ID + * @param string $value + **/ + public function SetContract_id($value) + { + $this->values['contract_id'] = $value; + } + /** + * 设置 用户ID + * @param string $value + **/ + public function SetCustomer_id($value) + { + $this->values['customer_id'] = $value; + } + /** + * 判断 用户ID 是否存在 + * @return true 或 false + **/ + public function IsCustomer_idSet() + { + return array_key_exists('customer_id', $this->values); + } + + /** + * 设置 电子邮箱 + * @param string $value + **/ + public function SetEmail($value) + { + $this->values['email'] = $value; + } + /** + * 设置 手机号码 + * @param string $value + **/ + public function SetMobile($value) + { + $this->values['mobile'] = $value; + } +} + + /** + * 合规化方案 实名存证类 + * Class FddDeposit + */ +class FddDeposit extends FddDataBase{ + /** + * 客户编号 注册账号时返回 + * @param $value + */ + public function SetCustomerID($value) + { + $this->values['customer_id'] = $value; + } + + /** + * 判断 客户编号 是否存在 + * @return bool + */ + public function IsCustomerIDSet() + { + return array_key_exists('customer_id', $this->values); + } + + + /** + * 存证名称 + * @param $value + */ + public function SetPreservationName($value) + { + $this->values['preservation_name'] = $value; + } + + /** + * 判断 存证名称 是否存在 + * @return bool + */ + public function IsPreservationNameSet() + { + return array_key_exists('preservation_name', $this->values); + } + + + /** + * 存证描述 + * @param $value + */ + public function SetPreservationDesc($value) + { + $this->values['preservation_desc'] = $value; + } + + /** + * 判断 存证描述 是否存在 + * @return bool + */ + public function IsPreservationDescSet() + { + return array_key_exists('preservation_desc', $this->values); + } + + + /** + * 文件名字符(len<=100) + * @param $value + */ + public function SetFileName($value) + { + $this->values['file_name'] = $value; + } + + /** + * 判断 文件名 是否存在 + * @return bool + */ + public function IsFileNameSet() + { + return array_key_exists('file_name', $this->values); + } + + /** + * 文件最后修改时间(unix时间,单位s):file.lastModified()/1000 + * @param $value + */ + public function SetNoperTime($value) + { + $this->values['noper_time'] = $value; + } + + /** + * 判断 文件最后修改时间 是否存在 + * @return bool + */ + public function IsNoperTimeSet() + { + return array_key_exists('noper_time', $this->values); + } + + /** + * 文件大小 值单位(byte);最大值: “9223372036854775807” >> 2^63-1最小值:0sha256 + * @param $value + */ + public function SetFileSize($value) + { + $this->values['file_size'] = $value; + } + + /** + * 判断 文件大小 是否存在 + * @return bool + */ + public function IsFileSizeSet() + { + return array_key_exists('file_size', $this->values); + } + + /** + * 文件hash值:sha256算法 + * @param $value + */ + public function SetOriginalSha256($value) + { + $this->values['original_sha256'] = $value; + } + + /** + * 判断 文件hash值 是否存在 + * @return bool + */ + public function IsOriginalSha256Set() + { + return array_key_exists('original_sha256', $this->values); + } + /** + * 交易号 + * @param $value + */ + public function SetTransactionId($value) + { + $this->values['transaction_id'] = $value; + } + + /** + * 判断 交易号 是否存在 + * @return bool + */ + public function IsTransactionIdSet() + { + return array_key_exists('transaction_id', $this->values); + } + + /** + * 存证数据提供方 + * @param $value + */ + public function SetPreservationDataProvider($value) + { + $this->values['preservation_data_provider'] = $value; + } + + /** + * 判断 存证数据提供方 是否存在 + * @return bool + */ + public function IsPreservationDataProviderSet() + { + return array_key_exists('preservation_data_provider', $this->values); + } + + + /** + * 姓名 + * @param $value + */ + public function SetName($value) + { + $this->values['name'] = $value; + } + + /** + * 判断 姓名 是否存在 + * @return bool + */ + public function IsNameSet() + { + return array_key_exists('name', $this->values); + } + + /** + * 证件类型 默认是0:身份证,具体查看5.19附录 + * @param $value + */ + public function SetDocumentType($value) + { + $this->values['document_type'] = $value; + } + + /** + * 判断 证件类型 是否存在 + * @return bool + */ + public function IsDocumentTypeSet() + { + return array_key_exists('document_type', $this->values); + } + + /** + * 证件号 + * @param $value + */ + public function SetIdCard($value) + { + $this->values['idcard'] = $value; + } + + /** + * 判断 证件号 是否存在 + * @return bool + */ + public function IsIdCardSet() + { + return array_key_exists('idcard', $this->values); + } + + /** + * 证件照正面 + * @param $value + */ + public function SetIdcardPositiveFile($value) + { + $this->values['idcard_positive_file'] = $value; + } + + /** + * 判断 证件照正面 是否存在 + * @return bool + */ + public function IsIdcardPositiveFileSet() + { + return array_key_exists('idcard_positive_file', $this->values); + } + + + /** + * 证件照反面 + * @param $value + */ + public function SetIdcardNegativeFile($value) + { + $this->values['idcard_negative_file'] = $value; + } + + /** + * 判断 证件照反面 是否存在 + * @return bool + */ + public function IsIdcardNegativeFileSet() + { + return array_key_exists('idcard_negative_file', $this->values); + } + + /** + * 手机号 verified_type =2/4必填 + * @param $value + */ + public function SetMobile($value) + { + $this->values['mobile'] = $value; + } + + /** + * 判断 手机号 是否存在 + * @return bool + */ + public function IsMobileSet() + { + return array_key_exists('mobile', $this->values); + } + + /** + * 实名时间 + * @param $value + */ + public function SetVerifiedTime($value) + { + $this->values['verified_time'] = $value; + } + + /** + * 判断 实名时间 是否存在 + * @return bool + */ + public function IsVerifiedTimeSet() + { + return array_key_exists('verified_time', $this->values); + } + + /** + * 实名存证类型 + * @param $value + */ + public function SetVerifiedType($value) + { + $this->values['verified_type'] = $value; + } + + /** + * 实名存证类型 + * @param $value + */ + public function GetVerifiedType() + { + return $this->values['verified_type']; + } + /** + * 判断 实名存证类型 是否存在 + * @return bool + */ + public function IsVerifiedTypeSet() + { + return array_key_exists('verified_type', $this->values); + } + + + /** + * verified_type =1 公安部二要素 + * @param $value + */ + public function SetPublicSecurityEssentialFactor($value) + { + $this->values['public_security_essential_factor'] = $value; + } + + /** + * 判断 verified_type =1 公安部二要素 是否存在 + * @return bool + */ + public function IsPublicSecurityEssentialFactorSet() + { + return array_key_exists('public_security_essential_factor', $this->values); + } + + + /** + * 客户编号 注册账号时返回 + * @return + **/ + public function GetCustomerID() + { + return $this->values['customer_id']; + } + + + + + + + /** + * 获取存证名称 + * @return + **/ + public function GetPreservationName() + { + return $this->values['preservation_name']; + } + + /** + * 获取存证描述 + * @return + **/ + public function GetPreservationDesc() + { + return $this->values['preservation_desc']; + } + /** + * 获取文件名字符 + * @return + **/ + public function GetFileName() + { + return $this->values['file_name']; + } + + /** + * 获取文件最后修改时间(unix时间,单位s):file.lastModified()/1000 + * @return + **/ + public function GetNoperTime() + { + return $this->values['noper_time']; + } + + /** + * 获取文件大小 值单位(byte);最大值: “9223372036854775807” >> 2^63-1最小值:0sha256 + * @return + **/ + public function GetFileSize() + { + return $this->values['file_size']; + } + + + + + + /** + * 获取文件hash值:sha256算法 + * @return + **/ + public function GetOriginalSha256() + { + return $this->values['original_sha256']; + } + + /** + * 获取交易号 + * @return + **/ + public function GetTransactionId() + { + return $this->values['transaction_id']; + } + + + + + + /** + * 获取数据提供方 + * @return + **/ + public function GetPreservationDataProvider() + { + return $this->values['preservation_data_provider']; + } + + + /** + * 获取姓名 + * @return + **/ + public function GetName() + { + return $this->values['name']; + } + + + + + + /** + * 获取证件类型 默认是0:身份证,具体查看5.19附录 + * @return + **/ + public function GetDocumentType() + { + return $this->values['document_type']; + } + + /** + * 获取证件号 + * @return + **/ + public function GetIdCard() + { + return $this->values['idcard']; + } + + /** + * 获取证件照正面 + * @return + **/ + public function GetIdcardPositiveFile() + { + return $this->values['idcard_positive_file']; + } + + + + + /** + * 获取证件照反面 + * @return + **/ + public function GetIdcardNegativeFile() + { + return $this->values['idcard_negative_file']; + } + + + + + + /** + * 获取手机号 verified_type =2/4必填 + * @return + **/ + public function GetMobile() + { + return $this->values['mobile']; + } + + /** + * 获取实名时间 + * @return + **/ + public function GetVerifiedTime() + { + return $this->values['verified_time']; + } + + + /** + * 获取verified_type =1 公安部二要素 + * @return + **/ + public function GetPublicSecurityEssentialFactor() + { + return $this->values['public_security_essential_factor']; + } + + /** + * verified_type =2 手机三要素 + * @param $value + */ + public function SetMobileEssentialFactor($value) + { + $this->values['mobile_essential_factor'] = $value; + } + + /** + * 获取verified_type =2 手机三要素 + * @return + **/ + public function GetMobileEssentialFactor() + { + return $this->values['mobile_essential_factor']; + } + + /** + * 判断 verified_type =2 手机三要素是否存在 + * @return bool + */ + public function IsMobileEssentialFactorSet() + { + return array_key_exists('mobile_essential_factor', $this->values); + } + + /** + * verified_type =3 银行卡三要素 + * @param $value + */ + public function SetBankEssentialFactor($value) + { + $this->values['bank_essential_factor'] = $value; + } + + /** + * 获取verified_type =3 银行卡三要素 + * @return + **/ + public function GetBankEssentialFactor() + { + return $this->values['bank_essential_factor']; + } + + /** + * 判断 verified_type =3 银行卡三要素是否存在 + * @return bool + */ + public function IsBankEssentialFactorSet() + { + return array_key_exists('bank_essential_factor', $this->values); + } + + /** + * verified_type =4 个人四要素 + * @param $value + */ + public function SetMobileAndBankEssentialFactor($value) + { + $this->values['mobile_and_bank_essential_factor'] = $value; + } + + /** + * 获取verified_type =4 个人四要素 + * @return + **/ + public function GetMobileAndBankEssentialFactor() + { + return $this->values['mobile_and_bank_essential_factor']; + } + + /** + * 判断 verified_type =4 个人四要素是否存在 + * @return bool + */ + public function IsMobileAndBankEssentialFactorSet() + { + return array_key_exists('mobile_and_bank_essential_factor', $this->values); + } + + /** + * 活体检测信息json数据 + * @param $value + */ + public function SetLiveDetection($value) + { + $this->values['live_detection'] = $value; + } + + /** + * 获取活体检测信息json数据 + * @return + **/ + public function GetLiveDetection() + { + return $this->values['live_detection']; + } + + /** + * 判断 活体检测信息json数据 是否存在 + * @return bool + */ + public function IsLiveDetectionSet() + { + return array_key_exists('live_detection', $this->values); + } + + /** + * 活体检测图 + * @param $value + */ + public function SetLiveDetectionFile($value) + { + $this->values['live_detection_file'] = $value; + } + + /** + * 获取活体检测图 + * @return + **/ + public function GetLiveDetectionFile() + { + return $this->values['live_detection_file']; + } + + /** + * 判断 活体检测图 是否存在 + * @return bool + */ + public function IsLiveDetectionFileSet() + { + return array_key_exists('live_detection_file', $this->values); + } + + /** + * 活体检测结果 + * @param $value + */ + public function SetResult($value) + { + $this->values['result'] = $value; + } + + /** + * 获取 活体检测结果 + * @return + **/ + public function GetResult() + { + return $this->values['result']; + } + + /** + * 判断 活体检测结果 是否存在 + * @return bool + */ + public function IsResultSet() + { + return array_key_exists('result', $this->values); + } + + /** + * 申请编号 + * @param $value + */ + public function SetApplyNum($value) + { + $this->values['apply_num'] = $value; + } + + /** + * 获取 申请编号 + * @return + **/ + public function GetApplyNum() + { + return $this->values['apply_num']; + } + + /** + * 判断 申请编号 是否存在 + * @return bool + */ + public function IsApplyNumSet() + { + return array_key_exists('apply_num', $this->values); + } + + /** + * 查询时间 + * @param $value + */ + public function SetQueryTime($value) + { + $this->values['query_time'] = $value; + } + + /** + * 获取 查询时间 + * @return + **/ + public function GetQueryTime() + { + return $this->values['query_time']; + } + + /** + * 判断 查询时间 是否存在 + * @return bool + */ + public function IsQueryTimeSet() + { + return array_key_exists('query_time', $this->values); + } + + /** + * 系统标志 + * @param $value + */ + public function SetSystemFlag($value) + { + $this->values['system_flag'] = $value; + } + + /** + * 获取 系统标志 + * @return + **/ + public function GetSystemFlag() + { + return $this->values['system_flag']; + } + + /** + * 判断 系统标志 是否存在 + * @return bool + */ + public function IsSystemFlagSet() + { + return array_key_exists('system_flag', $this->values); + } + + /** + * 身份证号对比 + * @param $value + */ + public function SetIdcardCompare($value) + { + $this->values['idcard_compare'] = $value; + } + + /** + * 获取 身份证号对比 + * @return + **/ + public function GetIdcardCompare() + { + return $this->values['idcard_compare']; + } + + /** + * 判断 身份证号对比 是否存在 + * @return bool + */ + public function IsIdcardCompareSet() + { + return array_key_exists('idcard_compare', $this->values); + } + + /** + * 姓名对比 + * @param $value + */ + public function SetNameCompare($value) + { + $this->values['name_compare'] = $value; + } + + /** + * 获取 姓名对比 + * @return + **/ + public function GetNameCompare() + { + return $this->values['name_compare']; + } + + /** + * 判断 姓名对比 是否存在 + * @return bool + */ + public function IsNameCompareSet() + { + return array_key_exists('name_compare', $this->values); + } + + /** + * 实名认证提供方 + * @param $value + */ + public function SetVerifiedProvider($value) + { + $this->values['verifiedProvider'] = $value; + } + + /** + * 获取 实名认证提供方 + * @return + **/ + public function GetVerifiedProvider() + { + return $this->values['verifiedProvider']; + } + + + /** + * 实名开户行 (银行卡三要素) + * @param $value + */ + public function SetBank($value) + { + $this->values['bank'] = $value; + } + + /** + * 获取 实名开户行 (银行卡三要素) + * @return + **/ + public function GetBank() + { + return $this->values['bank']; + } + + /** + * 判断 实名开户行 (银行卡三要素) 是否存在 + * @return bool + */ + public function IsBankSet() + { + return array_key_exists('bank', $this->values); + } + + /** + * 实名银行账号 (银行卡三要素) + * @param $value + */ + public function SetBankAccount($value) + { + $this->values['bank_account'] = $value; + } + + /** + * 获取 实名银行账号 (银行卡三要素) + * @return + **/ + public function GetBankAccount() + { + return $this->values['bank_account']; + } + + /** + * 判断 实名银行账号 (银行卡三要素) 是否存在 + * @return bool + */ + public function IsBankAccountSet() + { + return array_key_exists('bank_account', $this->values); + } + /** + * 手机验证码 (四要素) + * @param $value + */ + public function SetMobileVerificationCode($value) + { + $this->values['mobile_verification_code'] = $value; + } + + /** + * 获取 手机验证码 (四要素) + * @return + **/ + public function GetMobileVerificationCode() + { + return $this->values['mobile_verification_code']; + } + + /** + * 判断 手机验证码 (四要素) 是否存在 + * @return bool + */ + public function IsMobileVerificationCode() + { + return array_key_exists('mobile_verification_code', $this->values); + } + + /** + * 存证编号 + * @param $value + */ + public function SetEvidenceNo($value) + { + $this->values['evidence_no'] = $value; + } + + /** + * 实名认证序列号 + * @param $value + */ + public function SetVerifiedSerialno($value) + { + $this->values['verified_serialno'] = $value; + } + /** + * 判断 存证编号 是否存在 + * @return bool + */ + public function IsEvidenceNoSet() + { + return array_key_exists('evidence_no', $this->values); + } + + /** + * 客户名称 + * @param $value + */ + public function SetCustomerName($value) + { + $this->values['customer_name'] = $value; + } + + /** + * 判断 客户名称 是否存在 + * @return bool + */ + public function IsCustomerNameSet() + { + return array_key_exists('customer_name', $this->values); + } + + + + /** + * 客户证件类型 + * @param $value + */ + public function SetCustomerIdentType($value) + { + $this->values['customer_ident_type'] = $value; + } + + /** + * 判断 客户证件类型 是否存在 + * @return bool + */ + public function IsCustomerIdentTypeSet() + { + return array_key_exists('customer_ident_type', $this->values); + } + + /** + * 客户证件号码 + * @param $value + */ + public function SetCustomerIdentNo($value) + { + $this->values['customer_ident_no'] = $value; + } + + /** + * 判断 客户证件号码 是否存在 + * @return bool + */ + public function IsCustomerIdentNoSet() + { + return array_key_exists('customer_ident_no', $this->values); + } + + + /** + * 企业名称 + * @param $value + */ + public function SetCompanyName($value) + { + $this->values['company_name'] = $value; + } + + /** + * 企业名称 + * @return + **/ + public function GetCompanyName() + { + return $this->values['company_name']; + } + + /** + * 判断 企业名称 是否存在 + * @return bool + */ + public function IsCompanyNameSet() + { + return array_key_exists('company_name', $this->values); + } + + + /** + * 统一社会信用代码 + * @param $value + */ + public function SetCreditCode($value) + { + $this->values['credit_code'] = $value; + } + + /** + * 获取 统一社会信用代码 + * @return + **/ + public function GetCreditCode() + { + return $this->values['credit_code']; + } + + /** + * 判断 统一社会信用代码 是否存在 + * @return bool + */ + public function IsCreditCodeSet() + { + return array_key_exists('credit_code', $this->values); + } + + /** + * 统一社会信用代码电子版 + * @param $value + */ + public function SetCreditCodeFile($value) + { + $this->values['credit_code_file'] = $value; + } + + /** + * 获取 统一社会信用代码电子版 + * @return + **/ + public function GetCreditCodeFile() + { + return $this->values['credit_code_file']; + } + + /** + * 判断 统一社会信用代码电子版 是否存在 + * @return bool + */ + public function IsCreditCodeFileSet() + { + return array_key_exists('credit_code_file', $this->values); + } + + /** + * 营业注册号 + * @param $value + */ + public function SetLicence($value) + { + $this->values['licence'] = $value; + } + + /** + * 获取 营业注册号 + * @return + **/ + public function GetLicence() + { + return $this->values['licence']; + } + + /** + * 判断 营业注册号 是否存在 + * @return bool + */ + public function IsLicenceSet() + { + return array_key_exists('licence', $this->values); + } + + /** + * 营业注册号电子版 + * @param $value + */ + public function SetLicenceFile($value) + { + $this->values['licence_file'] = $value; + } + + /** + * 获取 营业注册号电子版 + * @return + **/ + public function GetLicenceFile() + { + return $this->values['licence_file']; + } + + /** + * 判断 营业注册号电子版 是否存在 + * @return bool + */ + public function IsLicenceFileSet() + { + return array_key_exists('licence_file', $this->values); + } + + /** + * 组织机构代码 + * @param $value + */ + public function SetOrganization($value) + { + $this->values['organization'] = $value; + } + + /** + * 获取 组织机构代码 + * @return + **/ + public function GetOrganization() + { + return $this->values['organization']; + } + + /** + * 判断 组织机构代码 是否存在 + * @return bool + */ + public function IsOrganizationSet() + { + return array_key_exists('organization', $this->values); + } + + /** + * 组织机构代码电子版 + * @param $value + */ + public function SetOrganizationFile($value) + { + $this->values['organization_file'] = $value; + } + + /** + * 获取 组织机构代码电子版 + * @return + **/ + public function GetOrganizationFile() + { + return $this->values['organization_file']; + } + + /** + * 判断 组织机构代码电子版 是否存在 + * @return bool + */ + public function IsOrganizationFileSet() + { + return array_key_exists('organization_file', $this->values); + } + + + /** + * 实名认证方式 + * @param $value + */ + public function SetVerifiedMode($value) + { + $this->values['verified_mode'] = $value; + } + + /** + * 获取 实名认证方式 + * @return + **/ + public function GetVerifiedMode() + { + return $this->values['verified_mode']; + } + + /** + * 判断 实名认证方式 是否存在 + * @return bool + */ + public function IsVerifiedModeSet() + { + return array_key_exists('verified_mode', $this->values); + } + + /** + * 授权委托书电子版 + * @param $value + */ + public function SetPowerAttorneyFile($value) + { + $this->values['power_attorney_file'] = $value; + } + + /** + * 获取 授权委托书电子版 + * @return + **/ + public function GetPowerAttorneyFile() + { + return $this->values['power_attorney_file']; + } + + /** + * 判断 授权委托书电子版 是否存在 + * @return bool + */ + public function IsPowerAttorneyFileSet() + { + return array_key_exists('power_attorney_file', $this->values); + } + + /** + * 己方银行支行 + * @param $value + */ + public function SetPublicBranchBank($value) + { + $this->values['public_branch_bank'] = $value; + } + + /* + * 获取 己方银行支行 + * @return + **/ + public function GetPublicBranchBank() + { + return $this->values['public_branch_bank']; + } + + /** + * 判断 己方银行支行 是否存在 + * @return bool + */ + public function IsPublicBranchBankSet() + { + return array_key_exists('public_bank_account', $this->values); + } + + /** + * 己方银行账号 + * @param $value + */ + public function SetPublicBankAccount($value) + { + $this->values['public_bank_account'] = $value; + } + + /* + * 获取 己方银行账号 + * @return + **/ + public function GetPublicBankAccount() + { + return $this->values['public_bank_account']; + } + + /** + * 判断 己方银行账号 是否存在 + * @return bool + */ + public function IsPublicBankAccountSet() + { + return array_key_exists('public_bank_account', $this->values); + } + + /** + * 客户打款银行 + * @param $value + */ + public function SetCustomerBank($value) + { + $this->values['customer_bank'] = $value; + } + + /* + * 获取 客户打款银行 + * @return + **/ + public function GetCustomerBank() + { + return $this->values['customer_bank']; + } + + /** + * 判断 客户打款银行 是否存在 + * @return bool + */ + public function IsCustomerBankSet() + { + return array_key_exists('customer_bank', $this->values); + } + + /** + * 客户银行支行 + * @param $value + */ + public function SetCustomerBranchBank($value) + { + $this->values['customer_branch_bank'] = $value; + } + + /* + * 获取 客户银行支行 + * @return + **/ + public function GetCustomerBranchBank() + { + return $this->values['customer_branch_bank']; + } + + /** + * 判断 客户银行支行 是否存在 + * @return bool + */ + public function IsCustomerBranchBankSet() + { + return array_key_exists('customer_branch_bank', $this->values); + } + + /** + * 客户银行账号 + * @param $value + */ + public function SetCustomerBankAccount($value) + { + $this->values['customer_bank_account'] = $value; + } + + /* + * 获取 客户银行账号 + * @return + **/ + public function GetCustomerBankAccount() + { + return $this->values['customer_bank_account']; + } + + /** + * 判断 客户银行账号 是否存在 + * @return bool + */ + public function IsCustomerBankAccountSet() + { + return array_key_exists('customer_bank_account', $this->values); + } + + /** + * 打款类型 + * @param $value + */ + public function SetPayType($value) + { + $this->values['pay_type'] = $value; + } + + /* + * 获取 打款类型 + * @return + **/ + public function GetPayType() + { + return $this->values['pay_type']; + } + + /** + * 判断 打款类型 是否存在 + * @return bool + */ + public function IsPayTypeSet() + { + return array_key_exists('pay_type', $this->values); + } + + /** + * 打款金额/打款随机码 + * @param $value + */ + public function SetAmountOrRandomCode($value) + { + $this->values['amount_or_random_code'] = $value; + } + + /* + * 获取 打款金额/打款随机码 + * @return + **/ + public function GetAmountOrRandomCode() + { + return $this->values['amount_or_random_code']; + } + + /** + * 判断 打款金额/打款随机码 是否存在 + * @return bool + */ + public function IsAmountOrRandomCodeSet() + { + return array_key_exists('amount_or_random_code', $this->values); + } + + /** + * 用户回填金额/随机码 + * @param $value + */ + public function SetUserBackFillAmountOrRandomCode($value) + { + $this->values['user_back_fill_amount_or_random_code'] = $value; + } + + /* + * 获取 用户回填金额/随机码 + * @return + **/ + public function GetUserBackFillAmountOrRandomCode() + { + return $this->values['user_back_fill_amount_or_random_code']; + } + + /** + * 判断 用户回填金额/随机码 是否存在 + * @return bool + */ + public function IsUserBackFillAmountOrRandomCodeSet() + { + return array_key_exists('user_back_fill_amount_or_random_code', $this->values); + } + + /** + * 企业负责人身份 + * @param $value + */ + public function SetCompanyPrincipalType($value) + { + $this->values['company_principal_type'] = $value; + } + + /* + * 获取 企业负责人身份 + * @return + **/ + public function GetCompanyPrincipalType() + { + return $this->values['company_principal_type']; + } + + /** + * 判断 企业负责人身份 是否存在 + * @return bool + */ + public function IsCompanyPrincipalTypeSet() + { + return array_key_exists('company_principal_type', $this->values); + } + + + /** + * json 企业负责人实名存证信息 + * @param $value + */ + public function SetCompanyPrincipalVerifiedMsg($value) + { + $this->values['company_principal_verified_msg'] = $value; + } + + /* + * 获取 json 企业负责人实名存证信息 + * @return + **/ + public function GetCompanyPrincipalVerifiedMsg() + { + return $this->values['company_principal_verified_msg']; + } + + /** + * 判断 json 企业负责人实名存证信息 是否存在 + * @return bool + */ + public function IsCompanyPrincipalVerifiedMsgSet() + { + return array_key_exists('company_principal_verified_msg', $this->values); + } + + /** + * json 法人姓名 + * @param $value + */ + public function SetLegalName($value) + { + $this->values['legal_name'] = $value; + } + + /* + * 获取 法人姓名 + * @return + **/ + public function GetLegalName() + { + return $this->values['legal_name']; + } + + /** + * 判断 法人姓名 是否存在 + * @return bool + */ + public function IsLegalNameSet() + { + return array_key_exists('legal_name', $this->values); + } + + /** + * json 法人身份证号 + * @param $value + */ + public function SetLegalIdCard($value) + { + $this->values['legal_idcard'] = $value; + } + + /* + * 获取 法人身份证号 + * @return + **/ + public function GetLegalIdCard() + { + return $this->values['legal_idcard']; + } + + /** + * 判断 法人身份证号 是否存在 + * @return bool + */ + public function IsLegalIdCardSet() + { + return array_key_exists('legal_idcard', $this->values); + } + + + +} +/** + * 合规化方案 实名认证 + * Class FddVerify + */ +class FddVerify extends FddDataBase{ + + /** + * 客户编号 注册账号时返回 + * @param $value + */ + public function SetCustomerID($value){ + $this->values['customer_id'] = $value; + } + /** + * 是否允许用户页面 修改 + * @param $value + */ + public function SetVerifiedWay($value){ + $this->values['verified_way'] = $value; + } + /** + * 实名认证套餐类 型 + * @param $value + */ + public function SetPageModify($value){ + $this->values['page_modify'] = $value; + } + /** + * 回调地址 + * @param $value + */ + public function SetNotifyUrl($value){ + $this->values['notify_url'] = $value; + } + /** + *同步通知url + * @param $value + */ + public function SetReturnUrl($value){ + $this->values['return_url'] = $value; + } + + /** + *姓名 + * @param $value + */ + public function SetCustomerName($value){ + $this->values['customer_name'] = $value; + } + + /** + *证件类型: + * @param $value + */ + public function SetCustomerIdentType($value){ + $this->values['customer_ident_type'] = $value; + } + + /** + *证件号码: + * @param $value + */ + public function SetCustomerIdentNo($value){ + $this->values['customer_ident_no'] = $value; + } + + /** + * 手机号 verified_type =2/4必填 + * @param $value + */ + public function SetMobile($value) + { + $this->values['mobile'] = $value; + } + + /** + * 证件正面照下载地 址 + * @param $value + */ + public function SetIdentFrontPath($value) + { + $this->values['ident_front_path'] = $value; + } + /** + * 证件正面照下载地 址 + * @param $value + */ + public function SetIdentFrontImg($value) + { + $this->values['ident_front_img'] = $value; + } + + /** + * 证件反面照下载地 址 + * @param $value + */ + public function SetIdentBackPath($value) + { + $this->values['ident_back_path'] = $value; + } + /** + * 证件反面照下载地 址 + * @param $value + */ + public function SetIdentBackImg($value) + { + $this->values['ident_back_img'] = $value; + } + /** + * 是否需要上传身份 照片 + * @param $value + */ + public function SetIdPhotoOptional($value) + { + $this->values['id_photo_optional'] = $value; + } + /** + * 刷脸是否显示结果 页面: + * @param $value + */ + public function SetResultType($value) + { + $this->values['result_type'] = $value; + } + /** + * + * @param $value + */ + public function SetOption($value) + { + $this->values['option'] = $value; + } + /** + *证件类型: + * @param $value + */ + public function SetCertType($value) + { + $this->values['cert_type'] = $value; + } + /** + *个人银行卡 + * @param $value + */ + public function SetBankCardNo($value) + { + $this->values['bank_card_no'] = $value; + } + /** + *是否跳转法大大公 证处小程序认证 + * @param $value + */ + public function SetIsMiniProgram($value) + { + $this->values['is_mini_program'] = $value; + } + /** + * + * @param $value + */ + public function SetLang($value) + { + $this->values['lang'] = $value; + } + /** + *海外用户是否支持 银行卡认证: + * @param $value + */ + public function SetIsAllowOverseasBankCardAuth($value) + { + $this->values['is_allow_overseas_bank_card_auth'] = $value; + } + /** + * 是否认证成功后自 动申请实名证书 + * @param $value + */ + public function SetCertFlag($value) + { + $this->values['cert_flag'] = $value; + } + + /** + * 客户编号 注册账号时返回 + * @param $value + */ + public function GetCustomerID(){ + return $this->values['customer_id']; + } + /** + * 是否允许用户页面 修改 + * @param $value + */ + public function GetVerifiedWay(){ + return $this->values['verified_way']; + } + /** + * 实名认证套餐类 型 + * @param $value + */ + public function GetPageModify(){ + return $this->values['page_modify']; + } + /** + * 回调地址 + * @param $value + */ + public function GetNotifyUrl(){ + return $this->values['notify_url']; + } + /** + *同步通知url + * @param $value + */ + public function GetReturnUrl(){ + return $this->values['return_url']; + } + + /** + *姓名 + * @param $value + */ + public function GetCustomerName(){ + return $this->values['customer_name']; + } + + /** + *证件类型: + * @param $value + */ + public function GetCustomerIdentType(){ + return $this->values['customer_ident_type']; + } + + /** + *证件号码: + * @param $value + */ + public function GetCustomerIdentNo(){ + return $this->values['customer_ident_no']; + } + + /** + * 手机号 verified_type =2/4必填 + * @param $value + */ + public function GetMobile() + { + return $this->values['mobile']; + } + + /** + * 证件正面照下载地 址 + * @param $value + */ + public function GetIdentFrontPath() + { + return $this->values['ident_front_path']; + } + /** + * 证件正面照下载地 址 + * @param $value + */ + public function GetIdentFrontImg() + { + return $this->values['ident_front_img']; + } + + /** + * 证件反面照下载地 址 + * @param $value + */ + public function GetIdentBackPath() + { + return $this->values['ident_back_path']; + } + /** + * 证件反面照下载地 址 + * @param $value + */ + public function GetIdentBackImg() + { + return $this->values['ident_back_img']; + } + /** + * 是否需要上传身份 照片 + * @param $value + */ + public function GetIdPhotoOptional() + { + return $this->values['id_photo_optional']; + } + /** + * 刷脸是否显示结果 页面: + * @param $value + */ + public function GetResultType() + { + return $this->values['result_type']; + } + /** + * + * @param $value + */ + public function GetOption() + { + return $this->values['option']; + } + /** + *证件类型: + * @param $value + */ + public function GetCertType() + { + return $this->values['cert_type']; + } + /** + *个人银行卡 + * @param $value + */ + public function GetBankCardNo() + { + return $this->values['bank_card_no']; + } + /** + *是否跳转法大大公 证处小程序认证 + * @param $value + */ + public function GetIsMiniProgram() + { + return $this->values['is_mini_program']; + } + /** + * + * @param $value + */ + public function GetLang() + { + return $this->values['lang']; + } + /** + *海外用户是否支持 银行卡认证: + * @param $value + */ + public function GetIsAllowOverseasBankCardAuth() + { + return $this->values['is_allow_overseas_bank_card_auth']; + } + /** + * 是否认证成功后自 动申请实名证书 + * @param $value + */ + public function GetCertFlag() + { + return $this->values['cert_flag']; + } + /** + * 管理员认证套 餐类型: + * @param $value + */ + public function SetMVerifiedWay($value) + { + $this->values['m_verified_way']=$value; + } + /** + * 指定管理员 为"法人"身份 下: + * @param $value + */ + public function SetLegalAllowCompanyVerifyWay($value) + { + $this->values['legal_allow_company_verify_way']=$value; + } + /** + * 指定管理员 为"代理人"身份 下 + * @param $value + */ + public function SetAgentAllowCompanyVerifyWay($value) + { + $this->values['agent_allow_company_verify_way']=$value; + } + /** + * 企业信息 + * @param $value + */ + public function SetCompanyInfo($value) + { + $this->values['company_info']=$value; + } + /** + *企业负责人身 份 + * @param $value + */ + public function SetCompanyPrincipalType($value) + { + $this->values['company_principal_type']=$value; + } + /** + *法人信息 + * @param $value + */ + public function SetLegalInfo($value) + { + $this->values['legal_info']=$value; + } + /** + *代理人信息 + * @param $value + */ + public function SetAgentInfo($value) + { + $this->values['agent_info']=$value; + } + /** + *对公账号信息 + * @param $value + */ + public function SetBankInfo($value) + { + $this->values['bank_info']=$value; + } + /** + *代理人证件正 面照 + * @param $value + */ + public function SetAgentIdFrontImg($value) + { + $this->values['agent_id_front_img']=$value; + } + /** + *统一社会信用 代码证件照 + * @param $value + */ + public function SetCreditImage($value) + { + $this->values['credit_image']=$value; + } + /** + *法人证件正面 照 + * @param $value + */ + public function SetLegalIdFrontImg($value) + { + $this->values['legal_id_front_img']=$value; + } + + /** + *银行所在省份 + * @param $value + */ + public function SetBankProvinceName($value) + { + $this->values['bank_province_name']=$value; + } + /** + * 银行所在市 + * @param $value + */ + public function SetBankCityName($value) + { + $this->values['bank_city_name']=$value; + } + /** + * 管理员认证流 水号 + * @param $value + */ + public function SetVerifiedSerialno($value) + { + $this->values['verified_serialno']=$value; + } + /** + * 企业注册申请 表 + * @param $value + */ + public function SetAuthorizationFile($value) + { + $this->values['authorization_file']=$value; + } + /** + * 法人姓名 + * @param $value + */ + public function SetLegalName($value) + { + $this->values['legal_name']=$value; + } + /** + * 法人授权手机 号 + * @param $value + */ + public function SetLegalAuthorizedMobile($value) + { + $this->values['legal_authorized_mobile']=$value; + } + /** + * 组织类型 + * @param $value + */ + public function SetOrganizationType($value) + { + $this->values['organization_type']=$value; + } + /** + * 管理员认证套 餐类型: + * @param $value + */ + public function GetMVerifiedWay() + { + return $this->values['m_verified_way']; + } + /** + * 指定管理员 为"法人"身份 下: + * @param $value + */ + public function GetLegalAllowCompanyVerifyWay() + { + return $this->values['legal_allow_company_verify_way']; + } + /** + * 指定管理员 为"代理人"身份 下 + * @param $value + */ + public function GetAgentAllowCompanyVerifyWay() + { + return $this->values['agent_allow_company_verify_way']; + } + /** + * 企业信息 + * @param $value + */ + public function GetCompanyInfo() + { + return $this->values['company_info']; + } + /** + *企业负责人身 份 + * @param $value + */ + public function GetCompanyPrincipalType() + { + return $this->values['company_principal_type']; + } + /** + *法人信息 + * @param $value + */ + public function GetLegalInfo() + { + return $this->values['legal_info']; + } + /** + *代理人信息 + * @param $value + */ + public function GetAgentInfo() + { + return $this->values['agent_info']; + } + /** + *对公账号信息 + * @param $value + */ + public function GetBankInfo() + { + return $this->values['bank_info']; + } + /** + *代理人证件正 面照 + * @param $value + */ + public function GetAgentIdFrontImg() + { + return $this->values['agent_id_front_img']; + } + /** + *统一社会信用 代码证件照 + * @param $value + */ + public function GetCreditImage() + { + return $this->values['credit_image']; + } + /** + *法人证件正面 照 + * @param $value + */ + public function GetLegalIdFrontImg() + { + return $this->values['legal_id_front_img']; + } + + /** + *银行所在省份 + * @param $value + */ + public function GetBankProvinceName() + { + return $this->values['bank_province_name']; + } + /** + * 银行所在市 + * @param $value + */ + public function GetBankCityName() + { + return $this->values['bank_city_name']; + } + /** + * 管理员认证流 水号 + * @param $value + */ + public function GetVerifiedSerialno() + { + return $this->values['verified_serialno']; + } + /** + * 企业注册申请 表 + * @param $value + */ + public function GetAuthorizationFile() + { + return $this->values['authorization_file']; + } + /** + * 法人姓名 + * @param $value + */ + public function GetLegalName() + { + return $this->values['legal_name']; + } + /** + * 法人授权手机 号 + * @param $value + */ + public function GetLegalAuthorizedMobile() + { + return $this->values['legal_authorized_mobile']; + } + /** + * 组织类型 + * @param $value + */ + public function GetOrganizationType() + { + return $this->values['organization_type']; + } +} + ?> \ No newline at end of file diff --git a/extend/fdd/FddEncryption.php b/extend/fdd/FddEncryption.php new file mode 100644 index 0000000..db4408f --- /dev/null +++ b/extend/fdd/FddEncryption.php @@ -0,0 +1,109 @@ +key,1)); + } + /** + * 通用msg_digest加密函数 + * @param $param + * @param $enc + * @return string + */ + public static function GeneralDigest($param,$enc) + { + $value = $param->GetValues(); + $md5Str = $param->GetTimestamp(); + $sha1Str = FddConfig::AppSecret; + foreach ($enc as $k => $v) + { + switch ($k){ + case "md5": + foreach ($v as $md5Key => $md5Value){ + if(isset($value[$md5Value])){ + $md5Str.= $value[$md5Value]; + } + } + break; + case "sha1": + foreach ($v as $sha1Key => $sha1Value){ + if(isset($value[$sha1Value])) { + $sha1Str .= $value[$sha1Value]; + } + } + break; + } + } + $enc = base64_encode(strtoupper(sha1(FddConfig::AppId.strtoupper(md5($md5Str)).strtoupper(sha1($sha1Str))))); + + return $enc; + } + /** + * 数组参数转字符串格式 + * @param $Array + * @return string + */ + public function ArrayParamToStr($Array) + { + $Str = "?"; + if (!empty($Array)) + { + foreach($Array as $k => $v){ + $Str .= $k."=".$v."&"; + } + } + return trim($Str,"&"); + + } + + + /** + * 合同生成msg_digest加密 + * @param FddTemplate $param + * @return string + */ + public static function ContractDigest(FddTemplate $param) + { + $sha1 = FddConfig::AppSecret.$param->GetTemplate_id().$param->GetContract_id(); + $enc = base64_encode(strtoupper(sha1(FddConfig::AppId.strtoupper(md5($param->GetTimestamp())).strtoupper(sha1($sha1)).$param->GetParameter_map()))); + return $enc; + } + + /** + * 文档签署接口(手动签) msg_digest加密 + * @param FddSignContract $param + * @return string + */ + public static function ExtsignDigest(FddSignContract $param) + { + $sha1 = FddConfig::AppSecret.$param->GetCustomer_id(); + $enc = base64_encode(strtoupper(sha1(FddConfig::AppId.strtoupper(md5($param->GetTransaction_id().$param->GetTimestamp())).strtoupper(sha1($sha1))))); + return $enc; + } + + /** + * 文档签署接口(含有效期和次数限制) msg_digest加密 + * @param FddSignContract $param + * @return string + */ + public static function ExtsignValiityDigest(FddSignContract $param) + { + $sha1 = FddConfig::AppSecret.$param->GetCustomer_id(); + $enc = base64_encode(strtoupper(sha1(FddConfig::AppId.strtoupper(md5($param->GetTransaction_id().$param->GetTimestamp().$param->GetValidity().$param->GetQuantity())).strtoupper(sha1($sha1))))); + return $enc; + } + + } +?> \ No newline at end of file diff --git a/extend/fdd/FddException.php b/extend/fdd/FddException.php new file mode 100644 index 0000000..abe2d01 --- /dev/null +++ b/extend/fdd/FddException.php @@ -0,0 +1,14 @@ +getMessage(); + } +} diff --git a/extend/fdd/HttpClient.php b/extend/fdd/HttpClient.php new file mode 100644 index 0000000..f72a2bc --- /dev/null +++ b/extend/fdd/HttpClient.php @@ -0,0 +1,350 @@ +cookies array ready for the next request + // Note: This currently ignores the cookie path (and time) completely. Time is not important, + // but path could possibly lead to security problems. + var $persist_referers = true; // For each request, sends path of last request as referer + var $debug = false; + var $handle_redirects = true; // Auaomtically redirect if Location or URI header is found + var $max_redirects = 5; + var $headers_only = false; // If true, stops receiving once headers have been read. + // Basic authorization variables + var $username; + var $password; + // Response vars + var $status; + var $headers = array(); + var $content = ''; + var $errormsg; + // Tracker variables + var $redirect_count = 0; + var $cookie_host = ''; + function __construct($host, $port=80){ + $this->host = $host; + $this->port = $port; + } + function HttpClient($host, $port=80) { + $this->host = $host; + $this->port = $port; + } + function get($path, $data = false) { + $this->path = $path; + $this->method = 'GET'; + if ($data) { + $this->path .= '?'.$this->buildQueryString($data); + } + return $this->doRequest(); + } + function post($path, $data) { + $this->path = $path; + $this->method = 'POST'; + $this->postdata = $this->buildQueryString($data); + return $this->doRequest(); + } + function buildQueryString($data) { + $querystring = ''; + if (is_array($data)) { + // Change data in to postable data + foreach ($data as $key => $val) { + if (is_array($val)) { + foreach ($val as $val2) { + $querystring .= urlencode($key).'='.urlencode($val2).'&'; + } + } else { + $querystring .= urlencode($key).'='.urlencode($val).'&'; + } + } + $querystring = substr($querystring, 0, -1); // Eliminate unnecessary & + } else { + $querystring = $data; + } + return $querystring; + } + function doRequest() { + + + // Performs the actual HTTP request, returning true or false depending on outcome + if (!$fp = @fsockopen($this->host, $this->port, $errno, $errstr, $this->timeout)) { + // Set error message + switch($errno) { + case -3: + $this->errormsg = 'Socket creation failed (-3)'; + case -4: + $this->errormsg = 'DNS lookup failure (-4)'; + case -5: + $this->errormsg = 'Connection refused or timed out (-5)'; + default: + $this->errormsg = 'Connection failed ('.$errno.')'; + } + $this->errormsg .= ' '.$errstr; + $this->debug($this->errormsg); + + return false; + } + socket_set_timeout($fp, $this->timeout); + $request = $this->buildRequest(); + + $this->debug('Request', $request); + fwrite($fp, $request); + // Reset all the variables that should not persist between requests + $this->headers = array(); + $this->content = ''; + $this->errormsg = ''; + // Set a couple of flags + $inHeaders = true; + $atStart = true; + // Now start reading back the response + while (!feof($fp)) { + $line = fgets($fp, 4096); + + if ($atStart) { + // Deal with first line of returned data + $atStart = false; + if (!preg_match('/HTTP\/(\\d\\.\\d)\\s*(\\d+)\\s*(.*)/', $line, $m)) { + $this->errormsg = "Status code line invalid: ".htmlentities($line); + $this->debug($this->errormsg); + return false; + } + $http_version = $m[1]; // not used + $this->status = $m[2]; + $status_string = $m[3]; // not used + $this->debug(trim($line)); + continue; + } + if ($inHeaders) { + if (trim($line) == '') { + $inHeaders = false; + $this->debug('Received Headers', $this->headers); + if ($this->headers_only) { + break; // Skip the rest of the input + } + continue; + } + if (!preg_match('/([^:]+):\\s*(.*)/', $line, $m)) { + // Skip to the next header + continue; + } + $key = strtolower(trim($m[1])); + $val = trim($m[2]); + // Deal with the possibility of multiple headers of same name + if (isset($this->headers[$key])) { + if (is_array($this->headers[$key])) { + $this->headers[$key][] = $val; + } else { + $this->headers[$key] = array($this->headers[$key], $val); + } + } else { + $this->headers[$key] = $val; + } + continue; + } + // We're not in the headers, so append the line to the contents + $this->content .= $line; + } + fclose($fp); + // If data is compressed, uncompress it + if (isset($this->headers['content-encoding']) && $this->headers['content-encoding'] == 'gzip') { + $this->debug('Content is gzip encoded, unzipping it'); + $this->content = substr($this->content, 10); // See http://www.php.net/manual/en/function.gzencode.php + $this->content = gzinflate($this->content); + } + // If $persist_cookies, deal with any cookies + if ($this->persist_cookies && isset($this->headers['set-cookie']) && $this->host == $this->cookie_host) { + $cookies = $this->headers['set-cookie']; + if (!is_array($cookies)) { + $cookies = array($cookies); + } + foreach ($cookies as $cookie) { + if (preg_match('/([^=]+)=([^;]+);/', $cookie, $m)) { + $this->cookies[$m[1]] = $m[2]; + } + } + // Record domain of cookies for security reasons + $this->cookie_host = $this->host; + } + + // If $persist_referers, set the referer ready for the next request + if ($this->persist_referers) { + $this->debug('Persisting referer: '.$this->getRequestURL()); + $this->referer = $this->getRequestURL(); + } + // Finally, if handle_redirects and a redirect is sent, do that + if ($this->handle_redirects) { + if (++$this->redirect_count >= $this->max_redirects) { + $this->errormsg = 'Number of redirects exceeded maximum ('.$this->max_redirects.')'; + $this->debug($this->errormsg); + $this->redirect_count = 0; + return false; + } + $location = isset($this->headers['location']) ? $this->headers['location'] : ''; + $uri = isset($this->headers['uri']) ? $this->headers['uri'] : ''; + if ($location || $uri) { + $url = parse_url($location.$uri); + // This will FAIL if redirect is to a different site + return $this->get($url['path']); + } + } + return true; + } + function buildRequest() { + $headers = array(); + $headers[] = "{$this->method} {$this->path} HTTP/1.0"; // Using 1.1 leads to all manner of problems, such as "chunked" encoding + $headers[] = "Host: {$this->host}"; + $headers[] = "User-Agent: {$this->user_agent}"; + $headers[] = "Accept: {$this->accept}"; + if ($this->use_gzip) { + $headers[] = "Accept-encoding: {$this->accept_encoding}"; + } + $headers[] = "Accept-language: {$this->accept_language}"; + if ($this->referer) { + $headers[] = "Referer: {$this->referer}"; + } + // Cookies + if ($this->cookies) { + $cookie = 'Cookie: '; + foreach ($this->cookies as $key => $value) { + $cookie .= "$key=$value; "; + } + $headers[] = $cookie; + } + // Basic authentication + if ($this->username && $this->password) { + $headers[] = 'Authorization: BASIC '.base64_encode($this->username.':'.$this->password); + } + // If this is a POST, set the content type and length + if ($this->postdata) { + $headers[] = 'Content-Type: application/x-www-form-urlencoded'; + $headers[] = 'Content-Length: '.strlen($this->postdata); + } + $request = implode("\r\n", $headers)."\r\n\r\n".$this->postdata; + return $request; + } + function getStatus() { + return $this->status; + } + function getContent() { + return $this->content; + } + function getHeaders() { + return $this->headers; + } + function getHeader($header) { + $header = strtolower($header); + if (isset($this->headers[$header])) { + return $this->headers[$header]; + } else { + return false; + } + } + function getError() { + return $this->errormsg; + } + function getCookies() { + return $this->cookies; + } + function getRequestURL() { + $url = 'http://'.$this->host; + if ($this->port != 80) { + $url .= ':'.$this->port; + } + $url .= $this->path; + return $url; + } + // Setter methods + function setUserAgent($string) { + $this->user_agent = $string; + } + function setAuthorization($username, $password) { + $this->username = $username; + $this->password = $password; + } + function setCookies($array) { + $this->cookies = $array; + } + // Option setting methods + function useGzip($boolean) { + $this->use_gzip = $boolean; + } + function setPersistCookies($boolean) { + $this->persist_cookies = $boolean; + } + function setPersistReferers($boolean) { + $this->persist_referers = $boolean; + } + function setHandleRedirects($boolean) { + $this->handle_redirects = $boolean; + } + function setMaxRedirects($num) { + $this->max_redirects = $num; + } + function setHeadersOnly($boolean) { + $this->headers_only = $boolean; + } + function setDebug($boolean) { + $this->debug = $boolean; + } + // "Quick" static methods + function quickGet($url) { + $bits = parse_url($url); + $host = $bits['host']; + $port = isset($bits['port']) ? $bits['port'] : 80; + $path = isset($bits['path']) ? $bits['path'] : '/'; + if (isset($bits['query'])) { + $path .= '?'.$bits['query']; + } + $client = new HttpClient($host, $port); + if (!$client->get($path)) { + return false; + } else { + return $client->getContent(); + } + } + function quickPost($url, $data) { + $bits = parse_url($url); + $host = $bits['host']; + $port = isset($bits['port']) ? $bits['port'] : 80; + $path = isset($bits['path']) ? $bits['path'] : '/'; + $client = new HttpClient($host, $port); + + if (!$client->post($path, $data)) { + return false; + } else { + return $client->getContent(); + } + } + function debug($msg, $object = false) { + if ($this->debug) { + print '
HttpClient Debug: '.$msg; + if ($object) { + ob_start(); + print_r($object); + $content = htmlentities(ob_get_contents()); + ob_end_clean(); + print '
'.$content.'
'; + } + print '
'; + } + } +} + +?> \ No newline at end of file diff --git a/extend/ip/17monipdb.dat b/extend/ip/17monipdb.dat new file mode 100644 index 0000000..a38c4d3 Binary files /dev/null and b/extend/ip/17monipdb.dat differ diff --git a/extend/ip/readme.txt b/extend/ip/readme.txt new file mode 100644 index 0000000..3594aa0 --- /dev/null +++ b/extend/ip/readme.txt @@ -0,0 +1,292 @@ + \ No newline at end of file