/** * 获取url签名 * @method sign * @param [type] $url [description] * @return [type] [description] * @author NewFuture */ private static function sign($url) { $config = self::$_config ?: (self::$_config = \Config::getSecret('qiniu')); $sign = hash_hmac('sha1', $url, $config['secretkey'], true); $ak = $config['accesskey']; return $ak . ':' . self::qiniuEncode($sign); }
/** * 获取配置 * @method config * @param [type] $key [description] * @return [type] [description] * @author NewFuture */ private static function config($key = null) { if (null === self::$_config) { $path = \Config::get('secret_config_path'); $type = \Config::get('upload.type'); self::$_type = $type; self::$_config = (new \Yaf_Config_Ini($path, $type))->toArray(); } return $key ? self::$_config[$key] : self::$_config; }