Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/master'
Browse files Browse the repository at this point in the history
  • Loading branch information
calchen committed Oct 21, 2020
2 parents 75d1bed + 02e8a03 commit 1b0c8b2
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 8 deletions.
12 changes: 6 additions & 6 deletions src/AliyunOssAdapter.php
Original file line number Diff line number Diff line change
Expand Up @@ -505,23 +505,24 @@ protected function getOptionsFromConfig(Config $config)
}

/**
* endpoint 不以 ".aliyuncs.com" 结尾的且不是 IP 的都认为是用户域名,即 CNAME domain
* endpoint 不以 ".aliyuncs.com" 结尾的且不是 IP 的都认为是用户域名,即 CNAME domain.
*
* @link https://help.aliyun.com/document_detail/31837.html 访问域名和数据中心
*
* @param $endpoint
*
* @return boolean
* @return bool
*/
public static function isEndpointCnameDomain($endpoint)
{
$domain = ".aliyuncs.com";
$domain = '.aliyuncs.com';

return substr($endpoint, -1 * strlen($domain)) !== $domain &&
! OssUtil::isIPFormat(static::getEndpointDomain($endpoint));
}

/**
* 获取 endpoint 的域名
* 获取 endpoint 的域名.
*
* @param $endpoint
*
Expand All @@ -532,7 +533,6 @@ public static function getEndpointDomain($endpoint)
$domain = $endpoint;
if (strpos($endpoint, 'http://') == 0) {
$domain = substr($endpoint, strlen('http://'));

} elseif (strpos($endpoint, 'https://') == 0) {
$domain = substr($endpoint, strlen('https://'));
}
Expand All @@ -541,7 +541,7 @@ public static function getEndpointDomain($endpoint)
}

/**
* 获取以 endpoint 为域名的 base URL,默认为 https
* 获取以 endpoint 为域名的 base URL,默认为 https.
*
* @param $endpoint
*
Expand Down
3 changes: 1 addition & 2 deletions src/AliyunOssServiceProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,7 @@
use OSS\OssClient;

/**
* Class AliyunOssServiceProvider
* @package Calchen\Flysystem\AliyunOss
* Class AliyunOssServiceProvider.
*/
class AliyunOssServiceProvider extends ServiceProvider
{
Expand Down

0 comments on commit 1b0c8b2

Please sign in to comment.