本文整理汇总了PHP中S3::use_ssl方法的典型用法代码示例。如果您正苦于以下问题:PHP S3::use_ssl方法的具体用法?PHP S3::use_ssl怎么用?PHP S3::use_ssl使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类S3
的用法示例。
在下文中一共展示了S3::use_ssl方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: createInvalidation
/**
* Creates invalidation bath
*
* @static
* @param integer $distributionId
* @param array $paths
* @return array|bool
*/
public static function createInvalidation($distributionId, $paths)
{
self::$use_ssl = true;
// CloudFront requires SSL
$rest = new S3Request('POST', '', '2010-11-01/distribution/' . $distributionId . '/invalidation', 'cloudfront.amazonaws.com');
$rest->data = self::__getCloudFrontInvalidationBath($paths);
$rest->size = strlen($rest->data);
$rest->setHeader('Content-Type', 'application/xml');
$rest = self::__getCloudFrontResponse($rest);
if ($rest->error === false && $rest->code !== 201) {
$rest->error = array('code' => $rest->code, 'message' => 'Unexpected HTTP status');
}
if ($rest->error !== false) {
trigger_error(sprintf("S3::createInvalidation(%d, '%s'): [%s] %s", $distributionId, implode(', ', $paths), $rest->error['code'], $rest->error['message']), E_USER_WARNING);
return false;
} elseif ($rest->body instanceof SimpleXMLElement) {
return self::__parseCloudFrontInvalidation($rest->body);
}
return false;
}
示例2: listDistributions
/**
* Get a list of CloudFront distributions
*
* @return array
*/
public static function listDistributions()
{
self::$use_ssl = true;
// CloudFront requires SSL
$rest = new S3Request('GET', '', '2008-06-30/distribution', 'cloudfront.amazonaws.com');
$rest = self::__getCloudFrontResponse($rest);
if ($rest->error === false && $rest->code !== 200) {
$rest->error = array('code' => $rest->code, 'message' => 'Unexpected HTTP status');
}
if ($rest->error !== false) {
trigger_error(sprintf("S3::listDistributions(): [%s] %s", $rest->error['code'], $rest->error['message']), E_USER_WARNING);
return false;
} elseif ($rest->body instanceof SimpleXMLElement && isset($rest->body->DistributionSummary)) {
$list = array();
if (isset($rest->body->Marker, $rest->body->MaxItems, $rest->body->IsTruncated)) {
//$info['marker'] = (string)$rest->body->Marker;
//$info['maxItems'] = (int)$rest->body->MaxItems;
//$info['isTruncated'] = (string)$rest->body->IsTruncated == 'true' ? true : false;
}
foreach ($rest->body->DistributionSummary as $summary) {
$list[(string) $summary->Id] = self::__parseCloudFrontDistributionConfig($summary);
}
return $list;
}
return array();
}