本文整理汇总了PHP中AmazonS3::useSSL方法的典型用法代码示例。如果您正苦于以下问题:PHP AmazonS3::useSSL方法的具体用法?PHP AmazonS3::useSSL怎么用?PHP AmazonS3::useSSL使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类AmazonS3
的用法示例。
在下文中一共展示了AmazonS3::useSSL方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: invalidateDistribution
/**
* Invalidate objects in a CloudFront distribution
*
* Thanks to Martin Lindkvist for S3::invalidateDistribution()
*
* @param string $distributionId Distribution ID from listDistributions()
* @param array $paths Array of object paths to invalidate
* @return boolean
*/
public static function invalidateDistribution($distributionId, $paths)
{
if (!extension_loaded('openssl')) {
self::__triggerError(sprintf("S3::invalidateDistribution(): [%s] %s", "CloudFront functionality requires SSL"), __FILE__, __LINE__);
return false;
}
$useSSL = self::$useSSL;
self::$useSSL = true;
// CloudFront requires SSL
$rest = new S3Request('POST', '', '2010-08-01/distribution/' . $distributionId . '/invalidation', 'cloudfront.amazonaws.com');
$rest->data = self::__getCloudFrontInvalidationBatchXML($paths, (string) microtime(true));
$rest->size = strlen($rest->data);
$rest = self::__getCloudFrontResponse($rest);
self::$useSSL = $useSSL;
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::invalidate('{$distributionId}',{$paths}): [%s] %s", $rest->error['code'], $rest->error['message']), E_USER_WARNING);
return false;
}
return true;
}