private function CreateSignedAwsRequest($request, $version = '2011-08-01') {
	    // Get a nice array of elements to work with
	    $uri_elements = parse_url($request);

	    // Grab our request elements
	    $request = $uri_elements['query'];

	    // Throw them into an array
	    parse_str($request, $parameters);

	    // Add the new required paramters
	    $parameters['Timestamp'] = gmdate("Y-m-d\TH:i:s\Z");
	    $parameters['Version'] = $version;

	    // The new authentication requirements need the keys to be sorted
	    ksort($parameters);

	    // Create our new request
	    foreach ($parameters as $parameter => $value) {
	        // We need to be sure we properly encode the value of our parameter
	        $parameter = str_replace("%7E", "~", rawurlencode($parameter));
	        $value = str_replace("%7E", "~", rawurlencode($value));
	        $requestArray[] = $parameter . '=' . $value;
	    }

	    // Put our & symbol at the beginning of each of our request variables and put it in a string
	    $requestParameters = implode('&', $requestArray);

	    // Create our signature string
	    $signatureString = "GET\n{$uri_elements['host']}\n{$uri_elements['path']}\n{$requestParameters}";
	    $signature = $this->createSignature($signatureString);

	    // Return our new request
		$newUrl = "http://{$uri_elements['host']}{$uri_elements['path']}?{$requestParameters}&Signature={$signature}";
	    return $newUrl;
	}
private function CreateSignedAwsRequest($request, $version = '2011-08-01') {
	    // Get a nice array of elements to work with
	    $uri_elements = parse_url($request);

	    // Grab our request elements
	    $request = $uri_elements['query'];

	    // Throw them into an array
	    parse_str($request, $parameters);

	    // Add the new required paramters
	    $parameters['Timestamp'] = gmdate("Y-m-d\TH:i:s\Z");
	    $parameters['Version'] = $version;

	    // The new authentication requirements need the keys to be sorted
	    ksort($parameters);

	    // Create our new request
	    foreach ($parameters as $parameter => $value) {
	        // We need to be sure we properly encode the value of our parameter
	        $parameter = str_replace("%7E", "~", rawurlencode($parameter));
	        $value = str_replace("%7E", "~", rawurlencode($value));
	        $requestArray[] = $parameter . '=' . $value;
	    }

	    // Put our & symbol at the beginning of each of our request variables and put it in a string
	    $requestParameters = implode('&', $requestArray);

	    // Create our signature string
	    $signatureString = "GET\n{$uri_elements['host']}\n{$uri_elements['path']}\n{$requestParameters}";
	    $signature = $this->createSignature($signatureString);

	    // Return our new request
		$newUrl = "http://{$uri_elements['host']}{$uri_elements['path']}?{$requestParameters}&Signature={$signature}";
	    return $newUrl;
	}
private function CreateSignedAwsRequest ( $ request , $ version = '2011-08-01' ) { // Get a nice array of elements to work with $ uri_elements = parse_url ( $ request ) ; // Grab our request elements $ request = $ uri_elements [ 'query' ] ; // Throw them into an array parse_str ( $ request , $ parameters ) ; // Add the new required paramters $ parameters [ 'Timestamp' ] = gmdate ( "Y-m-d\TH:i:s\Z" ) ; $ parameters [ 'Version' ] = $ version ; // The new authentication requirements need the keys to be sorted ksort ( $ parameters ) ; // Create our new request foreach ( $ parameters as $ parameter => $ value ) { // We need to be sure we properly encode the value of our parameter $ parameter = str_replace ( "%7E" , "~" , rawurlencode ( $ parameter ) ) ; $ value = str_replace ( "%7E" , "~" , rawurlencode ( $ value ) ) ; $ requestArray [ ] = $ parameter . '=' . $ value ; } // Put our & symbol at the beginning of each of our request variables and put it in a string $ requestParameters = implode ( '&' , $ requestArray ) ; // Create our signature string $ signatureString = "GET\n{$uri_elements['host']}\n{$uri_elements['path']}\n{$requestParameters}" ; $ signature = $ this -> createSignature ( $ signatureString ) ; // Return our new request $ newUrl = "http://{$uri_elements['host']}{$uri_elements['path']}?{$requestParameters}&Signature={$signature}" ; return $ newUrl ; }
This function will take an existing Amazon request and change it so that it will be usable
with the new authentication.

@param string $request - your existing request URI
@param string $version - (optional) the version of the service you are using

@link http://www.ilovebonnie.net/2009/07/27/amazon-aws-api-rest-authentication-for-php-5/
This function will take an existing Amazon request and change it so that it will be usable with the new authentication .