本文整理汇总了PHP中Cloudinary::domain_shard方法的典型用法代码示例。如果您正苦于以下问题:PHP Cloudinary::domain_shard方法的具体用法?PHP Cloudinary::domain_shard怎么用?PHP Cloudinary::domain_shard使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Cloudinary
的用法示例。
在下文中一共展示了Cloudinary::domain_shard方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: unsigned_download_url_prefix
private static function unsigned_download_url_prefix($source, $cloud_name, $private_cdn, $cdn_subdomain, $secure_cdn_subdomain, $cname, $secure, $secure_distribution)
{
$shared_domain = !$private_cdn;
$prefix = NULL;
if ($secure) {
if (empty($secure_distribution) || $secure_distribution == Cloudinary::OLD_AKAMAI_SHARED_CDN) {
$secure_distribution = $private_cdn ? $cloud_name . '-res.cloudinary.com' : Cloudinary::SHARED_CDN;
}
if (empty($shared_domain)) {
$shared_domain = $secure_distribution == Cloudinary::SHARED_CDN;
}
if (is_null($secure_cdn_subdomain) && $shared_domain) {
$secure_cdn_subdomain = $cdn_subdomain;
}
if ($secure_cdn_subdomain) {
$secure_distribution = str_replace('res.cloudinary.com', "res-" . Cloudinary::domain_shard($source) . ".cloudinary.com", $secure_distribution);
}
$prefix = "https://" . $secure_distribution;
} else {
if ($cname) {
$subdomain = $cdn_subdomain ? "a" . Cloudinary::domain_shard($source) . '.' : "";
$prefix = "http://" . $subdomain . $cname;
} else {
$host = implode(array($private_cdn ? $cloud_name . "-" : "", "res", $cdn_subdomain ? "-" . Cloudinary::domain_shard($source) : "", ".cloudinary.com"));
$prefix = "http://" . $host;
}
}
if ($shared_domain) {
$prefix = $prefix . '/' . $cloud_name;
}
return $prefix;
}