【发布时间】:2015-12-30 00:02:00
【问题描述】:
我正在尝试使用 S3 PHP SDK 生成一个预签名的 url 请求,如下所示:
$cmd = self::$S3Client->getCommand('GetObject', array('Bucket' => USER_CONTENT_BUCKET_NAME,'Key' => $key));
$request = self::$S3Client->createPresignedRequest($cmd, '+20 minutes');
*USER_CONTENT_BUCKET_NAME是在constants.php中定义的桶名*$key是字符串key。
如果我var_dump($cmd) 可以看到对象从getCommand() 正确返回。
但是从createPresignedRequest() 调用中,我得到了一个异常-
"Argument 2 passed to Guzzle\Service\Client::getCommand() must be of the type array, object given".
帮助?
【问题讨论】: