I'm trying to generate a pre signed url request with the S3 PHP SDK like this:
$cmd = self::$S3Client->getCommand('GetObject', array('Bucket' => USER_CONTENT_BUCKET_NAME,'Key' => $key));
$request = self::$S3Client->createPresignedRequest($cmd, '+20 minutes');
*USER_CONTENT_BUCKET_NAME
is the bucket name defined in constants.php
*$key
is string key.
If I var_dump($cmd)
I can see the object is returned correctly from the getCommand()
.
But from the createPresignedRequest()
call, I get an exception-
"Argument 2 passed to Guzzle\Service\Client::getCommand() must be of the type array, object given".
Help?