[英]how to read results from aws s3 headObject using PHP SDK v2?
I am able to successfully get results back from a call to headObject like this.我能够像这样成功地从对 headObject 的调用中获得结果。 But then I can't access what's in $result as result is an object (Guzzle\Service|Resource\Model) and the data I see in it is obviously in protected variables meaning I have to use an object call to get it.
但是我无法访问 $result 中的内容,因为结果是 object (Guzzle\Service|Resource\Model) 并且我在其中看到的数据显然是在受保护的变量中,这意味着我必须使用 object 调用来获取它。 But how do I know what the method call should be?
但是我怎么知道方法调用应该是什么?
$result = $client->headObject([
'Bucket' => $bucket, // REQUIRED
'Key' => $key // REQUIRED
]);
$relevantmetaData = array();
$relevantmetaData['LastModified'] = $result->data['LastModified'];
The link here doesn't mention a method to get at $data 这里的链接没有提到获取 $data 的方法
I guess I should just have tried get(), it works.我想我应该尝试一下 get(),它有效。
$relevantmetaData['LastModified'] = $result->get('LastModified');
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.