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

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
skyzyx committed Jun 12, 2012
1 parent 9e51818 commit 3059cfe
Show file tree
Hide file tree
Showing 21 changed files with 945 additions and 270 deletions.
4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -127,6 +127,10 @@ your project with:
3. Make sure that `getenv('HOME')` points to your user directory. If not you'll need to set
`putenv('HOME=<your-user-directory>')`.

This is because PHP will attempt to load the file from your user directory (e.g., `~/.aws/sdk/config.inc.php`).
If PHP doesn't happen to know where your user directory is, you'll need to tell PHP where it is with the `putenv()`
function.


## Additional Information

Expand Down
62 changes: 57 additions & 5 deletions _docs/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,11 +1,63 @@
# Changelog: "HyperCard"
One of the first successful hypermedia systems before the World Wide Web, developed by Apple. <http://en.wikipedia.org/wiki/HyperCard>

Launched Monday, June 11th, 2012.

## Bug fixes and enhancements
* [Handling of NULL bytes](https://forums.aws.amazon.com/thread.jspa?threadID=94935)
* [Bug with setting credentials](https://forums.aws.amazon.com/thread.jspa?messageID=337661)
* [Add a composer.json configuration](https://github.com/amazonwebservices/aws-sdk-for-php/pull/29)
* [Change auto home detection for windows](https://github.com/amazonwebservices/aws-sdk-for-php/pull/28)
* [Encode ampersands in keys passed to delete_objects](https://github.com/amazonwebservices/aws-sdk-for-php/pull/27)
* Bug with S3 object copy
* Bug with JSON encoding happening too early

## Runtime
* **New:** Support for retrieving credentials using IAM Instance Profiles has been added to the SDK.
* **Fixed:** Resolved an issue where default credentials must be provided in the case of multiple credential sets.

## Services
### AmazonAS
* **New:** Support for specifying spot instances in Auto Scaling has been added to the SDK.
* **New:** Support for IAM Instance Profiles has been added to the SDK.

### AmazonDynamoDB
* **Fixed:** Resolved an issue where JSON encoding was happening too early in the request process.
* **Fixed:** Resolved an issue where providing token-based credentials caused errors.
* **Fixed:** Resolved an issue where null-bytes were causing data to be truncated.

### AmazonEC2
* **New:** Support for IAM Instance Profiles has been added to the SDK.
* **New:** Support for VM export tasks has been added to the SDK.
* **New:** Support for AWS Marketplace product codes has been added to the SDK.
* **New:** Support for an enhanced `describe_instance_status()` has been added to the SDK.

### AmazonElastiCache
* **New:** Support for reserved cache nodes has been added to the SDK.

### AmazonIAM
* **New:** Support for IAM Instance Profiles has been added to the SDK.

### AmazonS3
* **Fixed:** Resolved an issue where ampersands were not being encoded correctly in `delete_objects` calls.
* **Fixed:** Resolved an issue where content-types were being incorrectly set in `copy_object` calls.

### AmazonStorageGateway
* **Fixed:** Resolved an issue where JSON encoding was happening too early in the request process.

### AmazonSWF
* **Fixed:** Resolved an issue where JSON encoding was happening too early in the request process.

----

# Changelog: 1.5.6.2 "Gershwin"
Code name for Apple's never-released successor to the never-released Copeland. <http://en.wikipedia.org/wiki/Gershwin_operating_system>

Launched Tuesday, May 29th, 2012.
Launched Tuesday, May 30th, 2012.

## Services
### AmazonDynamoDB
- **Fixed:** STS credentials were not always being cached correctly.
* **Fixed:** STS credentials were not always being cached correctly.

----

Expand All @@ -16,7 +68,7 @@ Launched Tuesday, May 24th, 2012.

## Services
### AmazonDynamoDB
- **Fixed:** STS credentials were not always being cached correctly.
* **Fixed:** STS credentials were not always being cached correctly.

----

Expand All @@ -27,8 +79,8 @@ Launched Tuesday, May 15th, 2012.

## Services
### AmazonSES
- **New:** Support for domain verification has been added to the SDK, which enables customers to verify an entire email domain.
- **New:** Requests to this service are now signed with Signature V4.
* **New:** Support for domain verification has been added to the SDK, which enables customers to verify an entire email domain.
* **New:** Requests to this service are now signed with Signature V4.

----

Expand Down
3 changes: 3 additions & 0 deletions _docs/CONTRIBUTORS.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,16 @@ The following people have provided ideas, support and bug fixes:
* [arech8](http://developer.amazonwebservices.com/connect/profile.jspa?userID=154435) (bug fixes)
* [Aizat Faiz](http://aizatto.com) (bug fixes)
* [Ben Lumley](http://github.com/benlumley) (bug fixes)
* [Dan Stillman](https://github.com/dstillman) (bug fixes)
* [Daniel Holmes](https://github.com/danielholmes) (bug fixes)
* [David Chan](http://www.chandeeland.org) (bug fixes)
* [Eric Caron](http://www.ericcaron.com) (bug fixes)
* [Jason Ardell](http://ardell.posterous.com/) (bug fixes)
* [Jeremy Archuleta](http://code.google.com/u/jeremy.archuleta/) (bug fixes)
* [Jimmy Berry](http://blog.boombatower.com/) (bug fixes, patches)
* [Paul Voegler](mailto:voegler@gmx.de) (bug fixes, bug reports, patches)
* [Peter Bowen](http://github.com/pzb) (feedback, bug reports)
* [Roman Cambian](https://github.com/rcambien) (patches)
* [zoxa](https://github.com/zoxa) (bug fixes)


Expand Down
23 changes: 2 additions & 21 deletions authentication/signature_v3json.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -54,11 +54,9 @@ public function authenticate()
$date = gmdate(CFUtilities::DATE_FORMAT_RFC2616, $current_time);
$timestamp = gmdate(CFUtilities::DATE_FORMAT_ISO8601, $current_time);
$nonce = $this->util->generate_guid();
$curlopts = array();
$signed_headers = array();
$return_curl_handle = false;
$x_amz_target = null;
$query = array('body' => $this->payload);
$query = array();

// Do we have an authentication token?
if ($this->auth_token)
Expand All @@ -83,28 +81,11 @@ public function authenticate()
$query['Version'] = $this->api_version;
}

$curlopts = array();

// Set custom CURLOPT settings
if (is_array($this->payload) && isset($this->payload['curlopts']))
{
$curlopts = $this->payload['curlopts'];
unset($this->payload['curlopts']);
}

// Merge in any options that were passed in
if (is_array($this->payload))
{
$query = array_merge($query, $this->payload);
}

$return_curl_handle = isset($query['returnCurlHandle']) ? $query['returnCurlHandle'] : false;
unset($query['returnCurlHandle']);

// Do a case-sensitive, natural order sort on the array keys.
uksort($query, 'strcmp');

// Normalize JSON input
$query['body'] = json_encode($this->payload);
if (isset($query['body']) && $query['body'] === '[]')
{
$query['body'] = '{}';
Expand Down
6 changes: 1 addition & 5 deletions authentication/signature_v4json.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -62,11 +62,7 @@ public function authenticate()
$this->query = array();

// Prepare JSON structure
$decoded = json_decode($this->payload, true);
$data = (array) (is_array($decoded) ? $decoded : $this->payload);
unset($data['curlopts']);
unset($data['returnCurlHandle']);
$this->body = json_encode($data);
$this->body = json_encode($this->payload);
if ($this->body === '' || $this->body === '[]')
{
$this->body = '{}';
Expand Down
27 changes: 27 additions & 0 deletions composer.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
{
"name":"amazonwebservices/aws-sdk-for-php",
"description":"AWS SDK for PHP",
"keywords":["aws","amazon","sdk","s3","ec2","dynamodb"],
"type":"library",
"license":"Apache-2.0",
"authors":[
{
"name":"Amazon Web Services",
"homepage":"http://aws.amazon.com"
}
],
"homepage": "http://aws.amazon.com/sdkforphp/",
"require":{
"php":">=5.2.0"
},
"autoload":{
"classmap": [
"authentication/",
"extensions/",
"lib/",
"services/",
"utilities/",
"sdk.class.php"
]
}
}
6 changes: 6 additions & 0 deletions lib/dom/ArrayToDOMDocument.php
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,12 @@ private static function createDOMElement($source, $tagName, DOMDocument $documen
{
if (!is_array($source))
{
// Handle NULL bytes
if (strpos($source, "\0") !== false)
{
$source = 'json_encoded::' . json_encode($source);
}

$element = $document->createElement($tagName);
$element->appendChild($document->createCDATASection($source));

Expand Down
Loading

0 comments on commit 3059cfe

Please sign in to comment.