本文整理汇总了PHP中AmazonS3::get_object_headers方法的典型用法代码示例。如果您正苦于以下问题:PHP AmazonS3::get_object_headers方法的具体用法?PHP AmazonS3::get_object_headers怎么用?PHP AmazonS3::get_object_headers使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类AmazonS3
的用法示例。
在下文中一共展示了AmazonS3::get_object_headers方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: getMd5
public function getMd5($path)
{
$v = null;
$retries = 3;
do {
try {
$v = $this->_s3->get_object_headers($this->getBucket(), $path);
$retries = 0;
} catch (Exception $e) {
$this->_out->logWarning("retry S3::getMd5() for {$path}");
usleep(200);
$retries--;
}
} while ($retries !== 0);
if ($v === null || !array_key_exists('etag', $v->header)) {
return false;
}
$md5 = str_replace('"', '', (string) $v->header['etag']);
return $md5;
}
示例2: array
<?php
/*
* v1. 22 June 2012
*
* what this script does?
*
* print headers for an object in s3 bucket
*
*/
require_once "sdk-1.5.7/sdk.class.php";
error_reporting(-1);
$config = parse_ini_file("aws.ini");
$awsKey = $config["aws.key"];
$awsSecret = $config["aws.secret"];
$bucket = "test.indigloo";
$name = "garbage_bin_wallpaper.jpg";
$options = array("key" => $awsKey, "secret" => $awsSecret, "default_cache_config" => '', "certificate_authority" => true);
$s3 = new AmazonS3($options);
$exists = $s3->if_bucket_exists($bucket);
if (!$exists) {
printf("S3 bucket %s does not exists \n", $bucket);
exit;
}
$response = $s3->get_object_headers($bucket, $name);
print_r($response);