neurofuzzy, flash game development, rich internet applications, free source code - *alt.neurotica.fuzzy*

neurofuzzy, flash game development, rich internet applications, free source code - *alt.neurotica.fuzzy*

8/26/2006

Amazon S3 PHP Class Update

Filed under: PHP — geoff @ 4:14 pm

I’ve made some small updates to my Amazon S3 PHP Class.  It now supports the prefix, max-keys, delimeter, and marker parameters for listing objects in buckets.  I still need to add the delimeter parameter.  The main reason I am posting is because I’ve gotten word that some people are experiencing Signature Match errors when authenticating requests.  It’s probably just a parameter ordering problem, but I am unable to replicate the error.  If anyone has experienced this problem, please post a comment here.  If anyone found a fix, please let me know!

The latest class will always be available via the link, Amazon S3 PHP Class Download.  The class is free to use and open source.

I’d also like to use this post as a place for people to provide links to all the cool interfaces and tools people have created using this class.  Please post a comment with linkage.  Thanks!

UPDATE 8/27/2006: Thanks to Bryan Kennedy for figuring out that some versions of PHP do not correctly report gmdate(”r”), I’m now defining DATE_RFC822 in the class and using it as a constant in the gmdate method. I’ve also added CONTENT-MD5 to PUT object HTTP headers. If object data is neing sent, the class will compute the MD5 checksum of that data and send it to Amazon for verification. This was an optional parameter, but it’s necessary to create a more robust service. Keep in mind Amazon has noted in their updates that this comparison is weak, and future updates may include headers in the checksum.

UPDATE 8/30/2006: Fixed a bug where I forgot to declare delimeter in the class (oops!). I am now updating the date in the sendRequest method in order to be sure date is current if the class is used for multiple requests over a long period of time (thanks to Chris Shepherd). Chris says I need to fix a bug that occurs when using metadata with numeric keys. ksort doesn’t sort them the way Amazon wants them. Looking into this…

UPDATE 9/9/2006: Thanks to Nathan Schmidt for discovering I mispelled delimiter as delimeter. It changed this to the proper ‘delimiter’ globally throughout the class. If you are using delimiters in your GET operations, please update.

 

Powered by WordPress