Skip to content
This repository has been archived by the owner on Jul 5, 2024. It is now read-only.

Commit

Permalink
由青塘发起的RELEASE-TEST SDK自动发布, BUILD_ID=26, 版本号:0.0.2
Browse files Browse the repository at this point in the history
发布日志:
1, 这是一次测试发布,请忽略。
  • Loading branch information
Qingtang-SDK committed Jul 21, 2017
1 parent 1ab8c83 commit 6c5f6b3
Show file tree
Hide file tree
Showing 219 changed files with 3,518 additions and 24,175 deletions.
154 changes: 154 additions & 0 deletions aliyun-php-sdk-release-test/AcsRequest.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,154 @@
<?php
/*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*/
abstract class AcsRequest
{
protected $version;
protected $product;
protected $actionName;
protected $regionId;
protected $acceptFormat;
protected $method;
protected $protocolType = "http";
protected $content;

protected $queryParameters = array();
protected $headers = array();

protected $locationServiceCode;
protected $locationEndpointType;

function __construct($product, $version, $actionName, $locationServiceCode = null, $locationEndpointType = "openAPI")
{
$this->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;
}
}
44 changes: 44 additions & 0 deletions aliyun-php-sdk-release-test/AcsResponse.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
<?php
/*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*/
class AcsResponse
{
private $code;
private $message;

public function getCode()
{
return $this->code;
}

public function setCode($code)
{
$this->code = $code;
}

public function getMessage()
{
return $this->message;
}

public function setMessage($message)
{
$this->message = $message;
}
}
83 changes: 83 additions & 0 deletions aliyun-php-sdk-release-test/Auth/Credential.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,83 @@
<?php
/*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*/
class Credential
{
private $dateTimeFormat = 'Y-m-d\TH:i:s\Z';
private $refreshDate;
private $expiredDate;
private $accessKeyId;
private $accessSecret;
private $securityToken;

public function __construct($accessKeyId, $accessSecret)
{
$this->accessKeyId = $accessKeyId;
$this->accessSecret = $accessSecret;
$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;
}
}
27 changes: 27 additions & 0 deletions aliyun-php-sdk-release-test/Auth/ISigner.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
<?php
/*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*/
interface ISigner
{
public function getSignatureMethod();

public function getSignatureVersion();

public function signString($source, $accessSecret);
}
Original file line number Diff line number Diff line change
@@ -1,43 +1,36 @@
<?php
/*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*/
namespace Ecs\Request\V20140526;

class DescribeSecurityGroupReferencesRequest extends \RpcAcsRequest
{
function __construct()
{
parent::__construct("Ecs", "2014-05-26", "DescribeSecurityGroupReferences");
$this->setMethod("POST");
}

private $SecurityGroupIds;

public function getSecurityGroupIds() {
return $this->SecurityGroupIds;
}

public function setSecurityGroupIds($SecurityGroupIds) {
$this->SecurityGroupIds = $SecurityGroupIds;
for ($i = 0; $i < count($SecurityGroupIds); $i ++) {
$this->queryParameters["SecurityGroupId.".($i+1)] = $SecurityGroupIds[$i];
}
}

}
<?php
/*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*/
class ShaHmac1Signer implements ISigner
{
public function signString($source, $accessSecret)
{
return base64_encode(hash_hmac('sha1', $source, $accessSecret, true));
}

public function getSignatureMethod()
{
return "HMAC-SHA1";
}

public function getSignatureVersion()
{
return "1.0";
}
}
Loading

0 comments on commit 6c5f6b3

Please sign in to comment.