Skip to content
This repository was archived by the owner on Jul 22, 2021. It is now read-only.

Commit 4b50b81

Browse files
committed
1 parent 19774df commit 4b50b81

File tree

12 files changed

+328
-77
lines changed

12 files changed

+328
-77
lines changed

_docs/CHANGELOG.md

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,24 @@
1+
# Changelog: 1.5.17
2+
3+
Launched Tuesday, November 13, 2012.
4+
5+
## Bug fixes and enhancements
6+
* **New:** Support for the new Asia Pacific (Sydney) Region has been added. Region endpoint constants have been added to several clients.
7+
8+
## Services
9+
### AmazonDynamoDB
10+
* **New:** Support for ConsistentRead option on the BatchWriteItem operation has been added to the SDK.
11+
* **New:** Support for CRC32 checksums has been added to the SDK. Requests are automatically retried on the if there is a checksum mismatch on the response.
12+
13+
### AmazonElasticBeanstalk
14+
* **New:** Support for the TerminateEnvByForce option on the DeleteApplication operation has been added to the SDK.
15+
16+
### AmazonS3
17+
* **New:** Support for website page redirects has been added to the SDK.
18+
* **New:** Support for archiving data to Amazon Glacier has been added to the SDK.
19+
20+
----
21+
122
# Changelog: 1.5.16.1 "Rhapsody"
223
The pre-cursor to Mac OS X, built from technology acquired from NeXT. <http://en.wikipedia.org/wiki/Rhapsody_(operating_system)>
324

_docs/CONTRIBUTORS.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ The following people have provided ideas, support and bug fixes:
1515
* [Dan Stillman](https://github.com/dstillman) (bug fixes)
1616
* [Daniel Holmes](https://github.com/danielholmes) (bug fixes)
1717
* [David Chan](http://www.chandeeland.org) (bug fixes)
18+
* [derekclapham](https://github.com/derekclapham) (bug fixes)
1819
* [Eric Caron](http://www.ericcaron.com) (bug fixes)
1920
* [Jason Ardell](http://ardell.posterous.com/) (bug fixes)
2021
* [Jeremy Archuleta](http://code.google.com/u/jeremy.archuleta/) (bug fixes)

extensions/s3browserupload.class.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@ class S3BrowserUpload extends AmazonS3
3939
* <li><code>success_action_status</code> - <code>integer</code> - Optional - The status code for Amazon S3 to return upon successful upload.</li>
4040
* <li><code>x-amz-server-side-encryption</code> - <code>string</code> - Optional - The server-side encryption mechanism to use. [Allowed values: <code>AES256</code>].</li>
4141
* <li><code>x-amz-storage-class</code> - <code>string</code> - Optional - The storage setting to apply to the object. [Allowed values: <code>AmazonS3::STORAGE_STANDARD</code>, <code>AmazonS3::STORAGE_REDUCED</code>]. The default value is <code>AmazonS3::STORAGE_STANDARD</code>.</li>
42+
* <li><code>x-amz-website-redirect-location</code> - <code>string</code> - Optional - The URI to send an HTTP 301 redirect to when accessing this object. Value must be prefixed either <code>/</code>, <code>http://</code> or <code>https://</code>.</li>
4243
* <li><code>x-amz-meta-*</code> - <code>mixed</code> - Optional - Any custom meta tag that should be set to the object.</li>
4344
* </ul>
4445
* @return array An array of fields that can be converted into markup.

package.xml

Lines changed: 8 additions & 8 deletions
Large diffs are not rendered by default.

sdk.class.php

Lines changed: 38 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -115,8 +115,8 @@ function __aws_sdk_ua_callback()
115115
// INTERMEDIARY CONSTANTS
116116

117117
define('CFRUNTIME_NAME', 'aws-sdk-php');
118-
define('CFRUNTIME_VERSION', '1.5.16.1');
119-
define('CFRUNTIME_BUILD', '20121112104359');
118+
define('CFRUNTIME_VERSION', '1.5.17');
119+
define('CFRUNTIME_BUILD', '20121113183000');
120120
define('CFRUNTIME_USERAGENT', CFRUNTIME_NAME . '/' . CFRUNTIME_VERSION . ' PHP/' . PHP_VERSION . ' ' . str_replace(' ', '_', php_uname('s')) . '/' . str_replace(' ', '_', php_uname('r')) . ' Arch/' . php_uname('m') . ' SAPI/' . php_sapi_name() . ' Integer/' . PHP_INT_MAX . ' Build/' . CFRUNTIME_BUILD . __aws_sdk_ua_callback());
121121

122122

@@ -1047,10 +1047,12 @@ public function authenticate($operation, $payload)
10471047

10481048
$data = new $this->response_class($headers, ($this->parse_the_response === true) ? $this->parse_callback($request->get_response_body()) : $request->get_response_body(), $request->get_response_code());
10491049

1050+
$response_body = (string) $request->get_response_body();
1051+
10501052
// Was it Amazon's fault the request failed? Retry the request until we reach $max_retries.
10511053
if (
1052-
(integer) $request->get_response_code() === 500 || // Internal Error (presumably transient)
1053-
(integer) $request->get_response_code() === 503) // Service Unavailable (presumably transient)
1054+
(integer) $request->get_response_code() === 500 || // Internal Error (presumably transient)
1055+
(integer) $request->get_response_code() === 503) // Service Unavailable (presumably transient)
10541056
{
10551057
if ($this->redirects <= $this->max_retries)
10561058
{
@@ -1062,26 +1064,41 @@ public function authenticate($operation, $payload)
10621064
}
10631065
}
10641066

1065-
// DynamoDB has custom logic
1066-
elseif (
1067-
(integer) $request->get_response_code() === 400 &&
1068-
stripos((string) $request->get_response_body(), 'com.amazonaws.dynamodb.') !== false && (
1069-
stripos((string) $request->get_response_body(), 'ProvisionedThroughputExceededException') !== false
1070-
)
1071-
)
1067+
// DynamoDB has additional, custom logic for retrying requests
1068+
else
10721069
{
1073-
if ($this->redirects === 0)
1070+
// If the request to DynamoDB was throttled, we need to retry
1071+
$need_to_retry_dynamodb_request = (
1072+
(integer) $request->get_response_code() === 400 &&
1073+
stripos($response_body, 'com.amazonaws.dynamodb.') !== false &&
1074+
stripos($response_body, 'ProvisionedThroughputExceededException') !== false
1075+
);
1076+
1077+
// If the CRC32 of the response does not match the expected value, we need to retry
1078+
$response_headers = $request->get_response_header();
1079+
if (!$need_to_retry_dynamodb_request && isset($response_headers['x-amz-crc32']))
10741080
{
1075-
$this->redirects++;
1076-
$data = $this->authenticate($operation, $original_payload);
1081+
$crc32_expected = $response_headers['x-amz-crc32'];
1082+
$crc32_actual = hexdec(hash('crc32b', $response_body));
1083+
$need_to_retry_dynamodb_request = ($crc32_expected != $crc32_actual);
10771084
}
1078-
elseif ($this->redirects <= max($this->max_retries, 10))
1085+
1086+
// Perform retry if necessary using a more aggressive exponential backoff
1087+
if ($need_to_retry_dynamodb_request)
10791088
{
1080-
// Exponential backoff
1081-
$delay = (integer) (pow(2, ($this->redirects - 1)) * 50000);
1082-
usleep($delay);
1083-
$this->redirects++;
1084-
$data = $this->authenticate($operation, $original_payload);
1089+
if ($this->redirects === 0)
1090+
{
1091+
$this->redirects++;
1092+
$data = $this->authenticate($operation, $original_payload);
1093+
}
1094+
elseif ($this->redirects <= max($this->max_retries, 10))
1095+
{
1096+
// Exponential backoff
1097+
$delay = (integer) (pow(2, ($this->redirects - 1)) * 50000);
1098+
usleep($delay);
1099+
$this->redirects++;
1100+
$data = $this->authenticate($operation, $original_payload);
1101+
}
10851102
}
10861103
}
10871104

@@ -1467,7 +1484,7 @@ public static function autoloader($class)
14671484
elseif ($class === 'Signer')
14681485
{
14691486
if (!interface_exists('Signable', false) &&
1470-
file_exists($require_this = $path . 'authentication' . DIRECTORY_SEPARATOR . 'signable.interface.php'))
1487+
file_exists($require_this = $path . 'authentication' . DIRECTORY_SEPARATOR . 'signable.interface.php'))
14711488
{
14721489
require_once $require_this;
14731490
}

services/dynamodb.class.php

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
* Amazon DynamoDB removes traditional scalability limitations on data storage while maintaining
2222
* low latency and predictable performance.
2323
*
24-
* @version 2012.09.18
24+
* @version 2012.11.12
2525
* @license See the included NOTICE.md file for complete information.
2626
* @copyright See the included NOTICE.md file for complete information.
2727
* @link http://aws.amazon.com/dynamodb/ Amazon DynamoDB
@@ -82,6 +82,16 @@ class AmazonDynamoDB extends CFRuntime
8282
*/
8383
const REGION_SINGAPORE = self::REGION_APAC_SE1;
8484

85+
/**
86+
* Specify the queue URL for the Asia Pacific Southeast (Singapore) Region.
87+
*/
88+
const REGION_APAC_SE2 = 'dynamodb.ap-southeast-2.amazonaws.com';
89+
90+
/**
91+
* Specify the queue URL for the Asia Pacific Southeast (Singapore) Region.
92+
*/
93+
const REGION_SYDNEY = self::REGION_APAC_SE2;
94+
8595
/**
8696
* Specify the queue URL for the Asia Pacific Northeast (Tokyo) Region.
8797
*/
@@ -304,7 +314,7 @@ public function __construct(array $options = array())
304314
/**
305315
* This allows you to explicitly sets the region for the service to use.
306316
*
307-
* @param string $region (Required) The region to explicitly set. Available options are <REGION_US_E1>, <REGION_US_W1>, <REGION_US_W2>, <REGION_EU_W1>, <REGION_APAC_SE1>, <REGION_APAC_NE1>.
317+
* @param string $region (Required) The region to explicitly set. Available options are <REGION_US_E1>, <REGION_US_W1>, <REGION_US_W2>, <REGION_EU_W1>, <REGION_APAC_SE1>, <REGION_APAC_SE2>, <REGION_APAC_NE1>.
308318
* @return $this A reference to the current instance.
309319
*/
310320
public function set_region($region)
@@ -577,6 +587,7 @@ public function binary_set($values)
577587
* </ul></li>
578588
* </ul></li>
579589
* <li><code>AttributesToGet</code> - <code>string|array</code> - Optional - List of <code>Attribute</code> names. If attribute names are not specified then all attributes will be returned. If some attributes are not found, they will not appear in the result. Pass a string for a single value, or an indexed array for multiple values.</li>
590+
* <li><code>ConsistentRead</code> - <code>boolean</code> - Optional - If set to <code>true</code>, then a consistent read is issued. Otherwise eventually-consistent is used.</li>
580591
* </ul></li>
581592
* </ul></li>
582593
* <li><code>curlopts</code> - <code>array</code> - Optional - A set of values to pass directly into <code>curl_setopt()</code>, where the key is a pre-defined <code>CURLOPT_*</code> constant.</li>

services/ec2.class.php

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@
2929
*
3030
* Visit <a href="http://aws.amazon.com/ec2/">http://aws.amazon.com/ec2/</a> for more information.
3131
*
32-
* @version 2012.09.18
32+
* @version 2012.11.12
3333
* @license See the included NOTICE.md file for complete information.
3434
* @copyright See the included NOTICE.md file for complete information.
3535
* @link http://aws.amazon.com/ec2/ Amazon EC2
@@ -90,6 +90,16 @@ class AmazonEC2 extends CFRuntime
9090
*/
9191
const REGION_SINGAPORE = self::REGION_APAC_SE1;
9292

93+
/**
94+
* Specify the queue URL for the Asia Pacific Southeast (Singapore) Region.
95+
*/
96+
const REGION_APAC_SE2 = 'ec2.ap-southeast-2.amazonaws.com';
97+
98+
/**
99+
* Specify the queue URL for the Asia Pacific Southeast (Singapore) Region.
100+
*/
101+
const REGION_SYDNEY = self::REGION_APAC_SE2;
102+
93103
/**
94104
* Specify the queue URL for the Asia Pacific Northeast (Tokyo) Region.
95105
*/
@@ -191,7 +201,7 @@ public function __construct(array $options = array())
191201
/**
192202
* This allows you to explicitly sets the region for the service to use.
193203
*
194-
* @param string $region (Required) The region to explicitly set. Available options are <REGION_US_E1>, <REGION_US_W1>, <REGION_US_W2>, <REGION_EU_W1>, <REGION_APAC_SE1>, <REGION_APAC_NE1>, <REGION_US_GOV1>, <REGION_SA_E1>.
204+
* @param string $region (Required) The region to explicitly set. Available options are <REGION_US_E1>, <REGION_US_W1>, <REGION_US_W2>, <REGION_EU_W1>, <REGION_APAC_SE1>, <REGION_APAC_SE2>, <REGION_APAC_NE1>, <REGION_US_GOV1>, <REGION_SA_E1>.
195205
* @return $this A reference to the current instance.
196206
*/
197207
public function set_region($region)

services/elasticbeanstalk.class.php

Lines changed: 38 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -28,13 +28,11 @@
2828
*
2929
* <strong>Endpoints</strong>
3030
*
31-
* AWS Elastic Beanstalk supports the following region-specific endpoint:
32-
*
33-
* <ul>
34-
* <li>https://elasticbeanstalk.us-east-1.amazonaws.com</li>
35-
* </ul>
31+
* For a list of region-specific endpoints that AWS Elastic Beanstalk supports, go to <a href=
32+
* "http://docs.amazonwebservices.com/general/latest/gr/rande.html#elasticbeanstalk_region">Regions
33+
* and Endpoints</a> in the <em>Amazon Web Services Glossary</em>.
3634
*
37-
* @version 2012.06.21
35+
* @version 2012.11.12
3836
* @license See the included NOTICE.md file for complete information.
3937
* @copyright See the included NOTICE.md file for complete information.
4038
* @link http://aws.amazon.com/elasticbeanstalk/ AWS ElasticBeanstalk
@@ -55,16 +53,6 @@ class AmazonElasticBeanstalk extends CFRuntime
5553
*/
5654
const REGION_VIRGINIA = self::REGION_US_E1;
5755

58-
/**
59-
* Specify the queue URL for the Asia Pacific Northeast (Tokyo) Region.
60-
*/
61-
const REGION_APAC_NE1 = 'elasticbeanstalk.ap-northeast-1.amazonaws.com';
62-
63-
/**
64-
* Specify the queue URL for the Asia Pacific Northeast (Tokyo) Region.
65-
*/
66-
const REGION_TOKYO = self::REGION_APAC_NE1;
67-
6856
/**
6957
* Specify the queue URL for the United States West (Northern California) Region.
7058
*/
@@ -95,6 +83,36 @@ class AmazonElasticBeanstalk extends CFRuntime
9583
*/
9684
const REGION_IRELAND = self::REGION_EU_W1;
9785

86+
/**
87+
* Specify the queue URL for the Asia Pacific Southeast (Singapore) Region.
88+
*/
89+
const REGION_APAC_SE1 = 'elasticbeanstalk.ap-southeast-1.amazonaws.com';
90+
91+
/**
92+
* Specify the queue URL for the Asia Pacific Southeast (Singapore) Region.
93+
*/
94+
const REGION_SINGAPORE = self::REGION_APAC_SE1;
95+
96+
/**
97+
* Specify the queue URL for the Asia Pacific Southeast (Singapore) Region.
98+
*/
99+
const REGION_APAC_SE2 = 'elasticbeanstalk.ap-southeast-2.amazonaws.com';
100+
101+
/**
102+
* Specify the queue URL for the Asia Pacific Southeast (Singapore) Region.
103+
*/
104+
const REGION_SYDNEY = self::REGION_APAC_SE2;
105+
106+
/**
107+
* Specify the queue URL for the Asia Pacific Northeast (Tokyo) Region.
108+
*/
109+
const REGION_APAC_NE1 = 'elasticbeanstalk.ap-northeast-1.amazonaws.com';
110+
111+
/**
112+
* Specify the queue URL for the Asia Pacific Northeast (Tokyo) Region.
113+
*/
114+
const REGION_TOKYO = self::REGION_APAC_NE1;
115+
98116
/**
99117
* Default service endpoint.
100118
*/
@@ -132,7 +150,7 @@ public function __construct(array $options = array())
132150
/**
133151
* This allows you to explicitly sets the region for the service to use.
134152
*
135-
* @param string $region (Required) The region to explicitly set. Available options are <REGION_US_E1>, <REGION_APAC_NE1>, <REGION_US_W1>, <REGION_US_W2>, <REGION_EU_W1>.
153+
* @param string $region (Required) The region to explicitly set. Available options are <REGION_US_E1>, <REGION_US_W1>, <REGION_US_W2>, <REGION_EU_W1>, <REGION_APAC_SE1>, <REGION_APAC_SE2>, <REGION_APAC_NE1>.
136154
* @return $this A reference to the current instance.
137155
*/
138156
public function set_region($region)
@@ -365,14 +383,16 @@ public function create_storage_location($opt = null)
365383
}
366384

367385
/**
368-
* Deletes the specified application along with all associated versions and configurations.
386+
* Deletes the specified application along with all associated versions and configurations. The
387+
* application versions will not be deleted from your Amazon S3 bucket.
369388
*
370389
* <p class="note">
371390
* You cannot delete an application that has a running environment.
372391
* </p>
373392
*
374393
* @param string $application_name (Required) The name of the application to delete.
375394
* @param array $opt (Optional) An associative array of parameters that can have the following keys: <ul>
395+
* <li><code>TerminateEnvByForce</code> - <code>boolean</code> - Optional - When set to true, running environments will be terminated before deleting the application.</li>
376396
* <li><code>curlopts</code> - <code>array</code> - Optional - A set of values to pass directly into <code>curl_setopt()</code>, where the key is a pre-defined <code>CURLOPT_*</code> constant.</li>
377397
* <li><code>returnCurlHandle</code> - <code>boolean</code> - Optional - A private toggle specifying that the cURL handle be returned rather than actually completing the request. This toggle is useful for manually managed batch requests.</li></ul>
378398
* @return CFResponse A <CFResponse> object containing a parsed HTTP response.

services/elb.class.php

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
* application loads between two or more EC2 instances. Elastic Load Balancing enables
2121
* availability through redundancy and supports traffic growth of your application.
2222
*
23-
* @version 2012.06.25
23+
* @version 2012.11.12
2424
* @license See the included NOTICE.md file for complete information.
2525
* @copyright See the included NOTICE.md file for complete information.
2626
* @link http://aws.amazon.com/elasticloadbalancing/ Elastic Load Balancing
@@ -81,6 +81,16 @@ class AmazonELB extends CFRuntime
8181
*/
8282
const REGION_SINGAPORE = self::REGION_APAC_SE1;
8383

84+
/**
85+
* Specify the queue URL for the Asia Pacific Southeast (Singapore) Region.
86+
*/
87+
const REGION_APAC_SE2 = 'elasticloadbalancing.ap-southeast-2.amazonaws.com';
88+
89+
/**
90+
* Specify the queue URL for the Asia Pacific Southeast (Singapore) Region.
91+
*/
92+
const REGION_SYDNEY = self::REGION_APAC_SE2;
93+
8494
/**
8595
* Specify the queue URL for the Asia Pacific Northeast (Tokyo) Region.
8696
*/
@@ -138,7 +148,7 @@ public function __construct(array $options = array())
138148
/**
139149
* This allows you to explicitly sets the region for the service to use.
140150
*
141-
* @param string $region (Required) The region to explicitly set. Available options are <REGION_US_E1>, <REGION_US_W1>, <REGION_US_W2>, <REGION_EU_W1>, <REGION_APAC_SE1>, <REGION_APAC_NE1>, <REGION_SA_E1>.
151+
* @param string $region (Required) The region to explicitly set. Available options are <REGION_US_E1>, <REGION_US_W1>, <REGION_US_W2>, <REGION_EU_W1>, <REGION_APAC_SE1>, <REGION_APAC_SE2>, <REGION_APAC_NE1>, <REGION_SA_E1>.
142152
* @return $this A reference to the current instance.
143153
*/
144154
public function set_region($region)

services/emr.class.php

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
* tasks such as web indexing, data mining, log file analysis, machine learning, scientific
2424
* simulation, and data warehousing.
2525
*
26-
* @version 2012.01.16
26+
* @version 2012.11.12
2727
* @license See the included NOTICE.md file for complete information.
2828
* @copyright See the included NOTICE.md file for complete information.
2929
* @link http://aws.amazon.com/elasticmapreduce/ Amazon Elastic MapReduce
@@ -84,6 +84,16 @@ class AmazonEMR extends CFRuntime
8484
*/
8585
const REGION_SINGAPORE = self::REGION_APAC_SE1;
8686

87+
/**
88+
* Specify the queue URL for the Asia Pacific Southeast (Singapore) Region.
89+
*/
90+
const REGION_APAC_SE2 = 'elasticmapreduce.ap-southeast-2.amazonaws.com';
91+
92+
/**
93+
* Specify the queue URL for the Asia Pacific Southeast (Singapore) Region.
94+
*/
95+
const REGION_SYDNEY = self::REGION_APAC_SE2;
96+
8797
/**
8898
* Specify the queue URL for the Asia Pacific Northeast (Tokyo) Region.
8999
*/
@@ -141,7 +151,7 @@ public function __construct(array $options = array())
141151
/**
142152
* This allows you to explicitly sets the region for the service to use.
143153
*
144-
* @param string $region (Required) The region to explicitly set. Available options are <REGION_US_E1>, <REGION_US_W1>, <REGION_US_W2>, <REGION_EU_W1>, <REGION_APAC_SE1>, <REGION_APAC_NE1>, <REGION_SA_E1>.
154+
* @param string $region (Required) The region to explicitly set. Available options are <REGION_US_E1>, <REGION_US_W1>, <REGION_US_W2>, <REGION_EU_W1>, <REGION_APAC_SE1>, <REGION_APAC_SE2>, <REGION_APAC_NE1>, <REGION_SA_E1>.
145155
* @return $this A reference to the current instance.
146156
*/
147157
public function set_region($region)

0 commit comments

Comments
 (0)