Monday, May 05, 2008

how to get s3 work with symfony

I've tried the s3 plugin, but had no luck. So I started to use the example from IBM on http://www.ibm.com/developerworks/library/os-php-amzmm/index.html
actually, this example is very similar to the official example on http://developer.amazonwebservices.com/connect/entry.jspa?externalID=847&categoryID=137
there's some problem, the solution is on: http://developer.amazonwebservices.com/connect/thread.jspa?threadID=17692

I added the s3 class into lib\myTools.php
installed PEAR package: Crypt_HMAC and HTTP_Request

made 2 changes:
replace 'DATE_RFC822' with 'S3_DATE_RFC822' as my version of PHP (5.2.0) won't allow me to redefine this variable.
commented below out:
/*
        if ( strlen( $contenttypestring ) )

            $contenttypestring = $contenttypestring.",application/x-www-form-urlencoded";

        else if ( $verb == "PUT" )

            $contenttypestring = "application/x-www-form-urlencoded";
*/

No comments: