Commit 3f24562e by 杨昕

code format

parent fe2a3071
Pipeline #9793 passed with stages
in 32 seconds
......@@ -13,20 +13,21 @@ final class QiniuModel
private static $accessKey = "5ClMHcAd5KN6oN6SC7ni7uuwOOpaSvoDRMHR_3l8";
private static $secretKey = "xoJZ_3crOqMOsznLU8lbjlNU8pXJwEq5-n5vd3Fv";
public function __construct($accessKey, $secretKey)
{
$this->accessKey = $accessKey;
$this->secretKey = $secretKey;
}
// public function __construct($accessKey, $secretKey)
// {
// $this->accessKey = $accessKey;
// $this->secretKey = $secretKey;
// }
public static function getAccessKey()
{
return self::$accessKey;
return getenv('QINIU_ACCESS_KEY')??self::$accessKey;
}
private static function sign($data)
{
$hmac = hash_hmac('sha1', $data, self::$secretKey, true);
$sercetKey = getenv('QINIU_SECRET_KEY')??self::$secretKey;
$hmac = hash_hmac('sha1', $data, $sercetKey, true);
return self::$accessKey . ':' . \Qiniu\base64_urlSafeEncode($hmac);
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment