profile
viewpoint

alibaba/macaca 2752

Automation solution for multi-platform. 多端自动化解决方案

JacksonTian/anywhere 801

Running static file server anywhere / 随启随用的静态文件服务器

alibaba/funcraft 521

(have) Fun with Serverless(API Gateway & Function Compute)

aleafs/pm 278

A graceful node library to contribute a permanent "master-worker" server.

JacksonTian/bagpipe 271

Async call limit

JacksonTian/api-doc-service 121

Node API Documentation Service

JacksonTian/bufferhelper 118

Concat buffer correctly and easily.

aliyun/fc-helper 36

函数计算 & API 网关辅助库

gregrperkins/grunt-mocha-hack 12

A hacky wrapper to run node.js lib Mocha tests via grunt. (fork of grunt-simple-mocha)

aliyun/rpc-client-php 8

Alibaba Cloud RPC Client for PHP

issue openedalibaba/funcraft

希望提供 fun export <service> <function> 导出配置的能力

由于文档的不明确性,导致在编写 yaml 文件的时候会很迷糊,但控制台界面有很好的明确性,可以帮助填充一些配置信息。但下一次 fun deploy 就会冲掉控制台上的配置。

希望能通过导出配置,通过在本地 diff 的方式,明确如何填写详细的配置。

created time in 20 hours

push eventaliyun/tea-roa-util

Jackson Tian

commit sha 5651ca7bd9c8da699e57134c8a510f7abf86d88e

Add includes

view details

push time in 2 days

PR opened nodejs/llhttp

make: add install target
+9 -0

0 comment

1 changed file

pr created time in 2 days

create barnchJacksonTian/llhttp

branch : install

created branch time in 2 days

fork JacksonTian/llhttp

Port of http_parser to llparse

http://llhttp.org

fork in 2 days

delete branch aliyun/tea-roa-util

delete branch : addChangeLog

delete time in 2 days

push eventaliyun/tea-roa-util

sonny

commit sha 67c222fdae31dd02b1f05f1cd820e1c2d3bc3afb

add changeLog

view details

push time in 2 days

PR merged aliyun/tea-roa-util

add changeLog
+2 -0

0 comment

1 changed file

atptro

pr closed time in 2 days

PR opened aliyun/tea-roa-util

Add C++ implementation
+195 -0

0 comment

2 changed files

pr created time in 2 days

PR opened aliyun/tea-util

Support C++
+190 -0

0 comment

3 changed files

pr created time in 2 days

create barnchaliyun/tea-util

branch : cc

created branch time in 2 days

create barnchaliyun/tea-roa-util

branch : cc

created branch time in 2 days

push eventaliyun/credentials-java

sonny

commit sha 2ce8cdff90262308884ecab0aa2cf71d23830c9b

release version 0.1.0

view details

push time in 2 days

delete branch aliyun/credentials-java

delete branch : releaseVersion0.1.0

delete time in 2 days

push eventaliyun/aliyun-ccp

wenzuochao

commit sha 54764328eb075cb8ae22fade2c4781bafc90436a

rm baseclient

view details

push time in 2 days

PR merged aliyun/aliyun-ccp

rm baseclient
+2 -4465

1 comment

52 changed files

wenzuochao

pr closed time in 2 days

push eventaliyun/aliyun-ccp

wenzuochao

commit sha 05fb1d90b6c12f7146f38056e9b0ed6b26b1c12a

modifyGetExpiretime

view details

push time in 3 days

PR merged aliyun/aliyun-ccp

modifyGetExpiretime
+53 -41

0 comment

3 changed files

wenzuochao

pr closed time in 3 days

PR opened aliyun/aliyun-ccp

improve credential
+32 -6

0 comment

1 changed file

pr created time in 3 days

push eventaliyun/aliyun-ccp

Jackson Tian

commit sha 2e94091cc2ef106e84d928413c45947ce7661476

improve credential

view details

push time in 3 days

create barnchaliyun/aliyun-ccp

branch : credential

created branch time in 3 days

push eventaliyun/aliyun-ccp

wenzuochao

commit sha 6dfe9361a2f62d977790df8e2982ac06a0d7d3f8

rm util

view details

push time in 3 days

PR merged aliyun/aliyun-ccp

rm util
+1 -923

0 comment

16 changed files

wenzuochao

pr closed time in 3 days

push eventaliyun/aliyun-ccp

wenzuochao

commit sha c350f7dc165c07996275f766cf6e7f446db59b87

support 2.x

view details

push time in 3 days

PR merged aliyun/aliyun-ccp

support 2.x
+17148 -15847

1 comment

9 changed files

wenzuochao

pr closed time in 3 days

push eventaliyun/tea-roa-util

wenzuochao

commit sha 12eff8dac4730f9571a69c8238cea55fc1f452f8

add teaignore

view details

push time in 3 days

delete branch aliyun/tea-roa-util

delete branch : addTeaignore

delete time in 3 days

PR merged aliyun/tea-roa-util

add teaignore
+14 -1

0 comment

2 changed files

wenzuochao

pr closed time in 3 days

push eventaliyun/tea-roa-util

wenzuochao

commit sha bf096d8442568d2e71bb827f311a586c7063733d

Release v0.0.1

view details

push time in 3 days

PR merged aliyun/tea-roa-util

Release v0.0.1
+3 -1

0 comment

2 changed files

wenzuochao

pr closed time in 3 days

PR opened aliyun/tea-roa-util

[lang:ts] Bump 1.0.0
+1 -1

0 comment

1 changed file

pr created time in 3 days

create barnchaliyun/tea-roa-util

branch : releases-ts

created branch time in 3 days

created repositoryaliyun/tea-roa-util

created time in 3 days

push eventaliyun/tea-util

wb-hx510875

commit sha 9f6316a6a39f2a59c8ab3c5078cd56a2704b30d0

add podspec file; improve git ignore config;

view details

push time in 3 days

push eventaliyun/tea-swift

wb-hx510875

commit sha 623e10a89f3f28022a8516d4ee5e758c7961f0c8

abandoned TeaUtils

view details

push time in 3 days

delete branch aliyun/tea-swift

delete branch : dev/20200224

delete time in 3 days

PR merged aliyun/tea-swift

abandoned TeaUtils
+26 -230

1 comment

5 changed files

AxiosCros

pr closed time in 3 days

Pull request review commentaliyun/tea-swift

add method&tests

 var defaultUserAgent: String = ""  func getDefaultUserAgent() -> String {     if defaultUserAgent.isEmpty {-        defaultUserAgent += osName() + " " + version() + " TeaDSL/1"+        defaultUserAgent += osName() + " TeaDSL/1" + " " + version()

从职责划分上来说这是不合理的。tea-util 是一个业务相关的库,是可以被替换的。tea-swift 是可以被任何业务所用的。

AxiosCros

comment created time in 3 days

Pull request review commentaliyun/tea-swift

add method&tests

 var defaultUserAgent: String = ""  func getDefaultUserAgent() -> String {     if defaultUserAgent.isEmpty {-        defaultUserAgent += osName() + " " + version() + " TeaDSL/1"+        defaultUserAgent += osName() + " TeaDSL/1" + " " + version()

这种业务性的代码为啥放进 tea-swift 里呢。

AxiosCros

comment created time in 3 days

push eventaliyun/aliyun-ccp

wenzuochao

commit sha c8154b1f2036659556e81fb076c19b5af0c442a4

addROAUtil

view details

push time in 6 days

PR merged aliyun/aliyun-ccp

addROAUtil
+303 -176

1 comment

7 changed files

wenzuochao

pr closed time in 6 days

push eventaliyun/credentials-java

sonny

commit sha 26bb99de26377bbf0afb7b478c53961901f72c8c

add getBearerToken

view details

push time in 6 days

delete branch aliyun/credentials-java

delete branch : changeForTea

delete time in 6 days

PR merged aliyun/credentials-java

add getBearerToken
+281 -8

1 comment

18 changed files

atptro

pr closed time in 6 days

push eventaliyun/aliyun-ccp

wenzuochao

commit sha 7e8d0b7dd8038751bec481ac0799980150acb696

ccp support 2.x

view details

push time in 6 days

PR merged aliyun/aliyun-ccp

ccp support 2.x
+6977 -5955

1 comment

5 changed files

wenzuochao

pr closed time in 6 days

pull request commentaliyun/aliyun-ccp

csharp supported parser2.0

util 和 credential 的测试配置一下

liaoyustudent

comment created time in 7 days

Pull request review commentaliyun/aliyun-ccp

csharp supported parser2.0

     <PackageReference Include="Aliyun.SDK.CCP.BaseClient" Version="0.0.10" />   </ItemGroup> +  <ItemGroup>+    <ProjectReference Include="..\..\credential\csharp\core\ccp-credential.csproj" />

CCP - credential 和 cpp-util 要先发布吧

liaoyustudent

comment created time in 7 days

push eventaliyun/credentials-go

wenzuochao

commit sha 065ea15bae2a58e1f73abec4d831a155e2ddf310

modify config

view details

push time in 8 days

delete branch aliyun/credentials-go

delete branch : modifyConfig

delete time in 8 days

PR merged aliyun/credentials-go

modify config

<!-- Thank you for your pull request. Please provide a description above and review the requirements below.

Bug fixes and new features should include tests and possibly benchmarks.

Contributors guide: https://github.com/aliyun/credentials-go/blob/master/CONTRIBUTING.md -->

You need to complete

<!-- Remove items that do not apply. For completed items, change [ ] to [x]. -->

  • [ ] unit tests and/or feature tests
  • [ ] documentation is changed or added
+373 -20361

1 comment

88 changed files

wenzuochao

pr closed time in 8 days

push eventaliyun/tea-util

wenzuochao

commit sha e08877b25a9beff4a65d7c4bb23ed255f9df727c

add getUserAgent

view details

push time in 8 days

PR merged aliyun/tea-util

add getUserAgent
+36 -9

1 comment

3 changed files

wenzuochao

pr closed time in 8 days

Pull request review commentaliyun/tea-util

add getUserAgent

 import ( 	"io/ioutil" 	"net/http" 	"net/url"+	"runtime" 	"strconv"+	"strings" 	"time"  	"github.com/aliyun/tea-util/golang/utils" ) +var defaultUserAgent = fmt.Sprintf("AlibabaCloud (%s; %s) Golang/%s Core/%s TeaDsl/1", runtime.GOOS, runtime.GOARCH, strings.Trim(runtime.Version(), "go"), "0.01")

TeaDsl => TeaDSL/1

wenzuochao

comment created time in 8 days

Pull request review commentaliyun/tea-util

add getUserAgent

 import ( 	"io/ioutil" 	"net/http" 	"net/url"+	"runtime" 	"strconv"+	"strings" 	"time"  	"github.com/aliyun/tea-util/golang/utils" ) +var defaultUserAgent = fmt.Sprintf("AlibabaCloud (%s; %s) Golang/%s Core/%s", runtime.GOOS, runtime.GOARCH, strings.Trim(runtime.Version(), "go"), "0.01")

没有加 teadsl 的标识

wenzuochao

comment created time in 9 days

push eventaliyun/tea-util

peze

commit sha 894514c7fdcdbf69feb631328c81c64b51ab3d25

add string number assert func

view details

push time in 9 days

PR merged aliyun/tea-util

add string number assert func
+56 -1

0 comment

3 changed files

peze

pr closed time in 9 days

push eventaliyun/alibabacloud-rpc-util-sdk

wenzuochao

commit sha c43202ff25347aab93002464c8d57876988024cd

improve GetOpenPlatFormEndpoint

view details

push time in 9 days

push eventaliyun/aliyun-openapi-java-sdk

sonny

commit sha c4829b139391e683a9cba53ca5eb576a1fa887d9

update readme

view details

push time in 10 days

push eventaliyun/aliyun-openapi-java-sdk

声烦

commit sha 988ea1918dbdefdb37690f6fc5adf72b16a4cafc

update ess java sdk 2.3.3

view details

声烦

commit sha 52b840a91e11b84edb65a9fad70d927ae61eab18

trigger ci

view details

push time in 10 days

PR merged aliyun/aliyun-openapi-java-sdk

Reviewers
update ess java sdk 2.3.3
  1. support desired capacity attribute of scaling group.
  2. support suspend and result scaling group processes.
+5513 -3574

2 comments

213 changed files

TalentNing

pr closed time in 10 days

push eventaliyun/tea-typescript

peze

commit sha dc0b01b4d8a3edfb0134fe6218e315f5e9d21366

add map cast and test case

view details

push time in 10 days

PR merged aliyun/tea-typescript

add map cast and test case
+31 -1

0 comment

2 changed files

peze

pr closed time in 10 days

push eventaliyun/aliyun-openapi-java-sdk

解蠡

commit sha 63bbd426378eef915db5b2c47690ee024d3efa46

BatchCompute support ISV and refresh credentials

view details

push time in 10 days

push eventaliyun/alibabacloud-rpc-util-sdk

wenzuochao

commit sha 17d6937e43e0c14409a9264196c98d21516d3b9e

add GetOpenPlatFormEndpoint

view details

push time in 10 days

push eventaliyun/credentials-php

宋神宗

commit sha cfb38ae232529e62d90ba4e0946f3cf35055491d

Updated Tea (#7) * Updated Tea * Updated Expiration for Tests

view details

push time in 12 days

delete branch aliyun/credentials-php

delete branch : updated_tea

delete time in 12 days

PR merged aliyun/credentials-php

Updated Tea

<!-- Thank you for your pull request. Please provide a description above and review the requirements below.

Bug fixes and new features should include tests and possibly benchmarks.

Contributors guide: https://github.com/aliyun/credentials-php/blob/master/CONTRIBUTING.md -->

You need to complete

<!-- Remove items that do not apply. For completed items, change [ ] to [x]. -->

  • [x] unit tests and/or feature tests
  • [x] documentation is changed or added
+13 -10

0 comment

5 changed files

songshenzong

pr closed time in 12 days

push eventaliyun/tea-util

peze

commit sha 5dcc4ffac16185284bf755ecdd00fb01e33e1dc8

add assertToBoolean func

view details

push time in 12 days

PR merged aliyun/tea-util

add assertToBoolean func
+27 -0

0 comment

3 changed files

peze

pr closed time in 12 days

push eventJacksonTian/kitx

Jackson Tian

commit sha 0ae4d1cb79c6010f080557a7f4bd09e081ee3056

Bump 2.1.0

view details

push time in 13 days

push eventJacksonTian/kitx

Jackson Tian

commit sha 72bd9add8dc62ba8cf9eaecfd06d409887fc2cc5

Add readAll method

view details

push time in 13 days

push eventaliyun/alibabacloud-oss-sdk

wenzuochao

commit sha 13e75c5f6157a6eb689731c59df56a942d07a714

add util

view details

push time in 13 days

PR merged aliyun/alibabacloud-oss-sdk

add util
+120 -2

0 comment

6 changed files

wenzuochao

pr closed time in 13 days

Pull request review commentaliyun/alibaba-cloud-sdk-go

added regional sts endpoints

 const endpointsJson =`{ 			"code": "sts", 			"document_id": "28756", 			"location_service_code": "sts",-			"regional_endpoints": null,+			"regional_endpoints": [+				{+					"region": "eu-central-1",+					"endpoint": "sts.eu-central-1.aliyuncs.com"+				},+				{+					"region": "eu-west-1",+					"endpoint": "sts.eu-west-1.aliyuncs.com"+				},+				{+					"region": "me-east-1",+					"endpoint": "sts.me-east-1.aliyuncs.com"+				},+				{+					"region": "us-east-1",+					"endpoint": "sts.us-east-1.aliyuncs.com"+				},+				{+					"region": "us-west-1",+					"endpoint": "sts.us-west-1.aliyuncs.com"+				},+				{+					"region": "ap-south-1",+					"endpoint": "sts.ap-south-1.aliyuncs.com"+				},+				{+					"region": "ap-northeast-1",+					"endpoint": "sts.ap-northeast-1.aliyuncs.com"+				},+				{+					"region": "ap-southeast-5",+					"endpoint": "sts.ap-southeast-5.aliyuncs.com"+				},+				{+					"region": "ap-southeast-3",+					"endpoint": "sts.ap-southeast-3.aliyuncs.com"+				},+				{+					"region": "ap-southeast-2",+					"endpoint": "sts.ap-southeast-2.aliyuncs.com"+				},+				{+					"region": "ap-southeast-1",+					"endpoint": "sts.ap-southeast-1.aliyuncs.com"+				},+				{+					"region": "cn-hongkong",+					"endpoint": "sts.cn-hongkong.aliyuncs.com"+				},+				{+					"region": "cn-shanghai",+					"endpoint": "sts.cn-shanghai.aliyuncs.com"+				},+				{+					"region": "cn-hangzhou",+					"endpoint": "sts.cn-hangzhou.aliyuncs.com"+				},+				{+					"region": "cn-huhehaote",+					"endpoint": "sts.cn-huhehaote.aliyuncs.com"+				},+				{+					"region": "cn-zhangjiakou",+					"endpoint": "sts.cn-zhangjiakou.aliyuncs.com"+				},+				{+					"region": "cn-beijing",+					"endpoint": "sts.cn-beijing.aliyuncs.com"+				},+				{+					"region": "cn-qingdao",+					"endpoint": "sts.cn-qingdao.aliyuncs.com"+				},+				{

I will trigger STS release a new version SDK to enable endpoint rule.

arafato

comment created time in 13 days

Pull request review commentaliyun/alibaba-cloud-sdk-go

added regional sts endpoints

 const endpointsJson =`{ 			"code": "sts", 			"document_id": "28756", 			"location_service_code": "sts",-			"regional_endpoints": null,+			"regional_endpoints": [+				{+					"region": "eu-central-1",+					"endpoint": "sts.eu-central-1.aliyuncs.com"+				},+				{+					"region": "eu-west-1",+					"endpoint": "sts.eu-west-1.aliyuncs.com"+				},+				{+					"region": "me-east-1",+					"endpoint": "sts.me-east-1.aliyuncs.com"+				},+				{+					"region": "us-east-1",+					"endpoint": "sts.us-east-1.aliyuncs.com"+				},+				{+					"region": "us-west-1",+					"endpoint": "sts.us-west-1.aliyuncs.com"+				},+				{+					"region": "ap-south-1",+					"endpoint": "sts.ap-south-1.aliyuncs.com"+				},+				{+					"region": "ap-northeast-1",+					"endpoint": "sts.ap-northeast-1.aliyuncs.com"+				},+				{+					"region": "ap-southeast-5",+					"endpoint": "sts.ap-southeast-5.aliyuncs.com"+				},+				{+					"region": "ap-southeast-3",+					"endpoint": "sts.ap-southeast-3.aliyuncs.com"+				},+				{+					"region": "ap-southeast-2",+					"endpoint": "sts.ap-southeast-2.aliyuncs.com"+				},+				{+					"region": "ap-southeast-1",+					"endpoint": "sts.ap-southeast-1.aliyuncs.com"+				},+				{+					"region": "cn-hongkong",+					"endpoint": "sts.cn-hongkong.aliyuncs.com"+				},+				{+					"region": "cn-shanghai",+					"endpoint": "sts.cn-shanghai.aliyuncs.com"+				},+				{+					"region": "cn-hangzhou",+					"endpoint": "sts.cn-hangzhou.aliyuncs.com"+				},+				{+					"region": "cn-huhehaote",+					"endpoint": "sts.cn-huhehaote.aliyuncs.com"+				},+				{+					"region": "cn-zhangjiakou",+					"endpoint": "sts.cn-zhangjiakou.aliyuncs.com"+				},+				{+					"region": "cn-beijing",+					"endpoint": "sts.cn-beijing.aliyuncs.com"+				},+				{+					"region": "cn-qingdao",+					"endpoint": "sts.cn-qingdao.aliyuncs.com"+				},+				{

Hi the region list is incomplete.

arafato

comment created time in 13 days

push eventaliyun/aliyun-ccp

wb-hx510875

commit sha 94da48c64d08541a7f867dfa8448165313b25ba9

aliyun ccp sdk for swift

view details

push time in 14 days

PR merged aliyun/aliyun-ccp

aliyun ccp sdk for swift
+9514 -1

0 comment

169 changed files

AxiosCros

pr closed time in 14 days

push eventaliyun/tea-util

Jackson Tian

commit sha 29faf8d209bba44d0429eb9ee9f7238f0022f782

[lang:ts] Bump 1.2.0

view details

push time in 14 days

push eventaliyun/aliyun-openapi-python-sdk

Tynan Young

commit sha 83e544dd8739ac9640b9650ca580a227a8b80d48

Fix time format

view details

push time in 14 days

PR merged aliyun/aliyun-openapi-python-sdk

Fix time format

Using %X (locale) to get the time can result in a format that is not supported by the Alicloud API.

For example, having a locale of t_fmt="%r" for LC_TIME results in the time format of Wed, 12 Feb 2020 01:42:42 AM GMT which does not work with the API between 12.00-01.00 GMT, throwing the below error:

aliyunsdkcore.acs_exception.exceptions.ServerException: HTTP Status: 400 Error:InvalidTimeStamp.Expired Specified time stamp or date value is expired. RequestID: 

I believe the API wants time in the format of Wed, 12 Feb 2020 01:42:42 GMT (no AM/PM), which is what this MR does.

+1 -1

2 comments

1 changed file

tynany

pr closed time in 14 days

push eventaliyun/tea-util

Jackson Tian

commit sha 2e9a14fd4a6f28900233588dc85bd2ad8a2e7169

fix toJSONString

view details

Jackson Tian

commit sha 88aab99fcacc317341c16dbf66fc0d786aff09ef

Add php into tea ignore

view details

Jackson Tian

commit sha a5b9170f6a92febb0f3fd28370498111de3abcd6

Add nyc into dev dependencies for TypeScript

view details

push time in 15 days

PR merged aliyun/tea-util

fix toJSONString
+15 -9

0 comment

7 changed files

JacksonTian

pr closed time in 15 days

push eventaliyun/tea-util

Jackson Tian

commit sha ecabe42036d81dd507594d549a4940c5bb7d1e68

Add nyc into dev dependencies for TypeScript

view details

push time in 15 days

push eventaliyun/tea-util

Jackson Tian

commit sha c86cf12e3512b832965edfbb5ea476d4b8708d3d

Add nyc into dev dependencies for TypeScript

view details

push time in 15 days

push eventaliyun/tea-util

Jackson Tian

commit sha 25b82da2e96321cd2e07cdab1ae4f4d23f24c43e

Add nyc into dev dependencies for TypeScript

view details

push time in 15 days

push eventaliyun/tea-util

Jackson Tian

commit sha afb31a4cd543e24121cea10aaea974deb797ef0a

Add php into tea ignore

view details

push time in 15 days

PR opened aliyun/tea-util

fix toJSONString
+8 -7

0 comment

5 changed files

pr created time in 15 days

create barnchaliyun/tea-util

branch : toJSONString

created branch time in 15 days

Pull request review commentaliyun/tea-util

tea-util for php

+<?php++namespace AlibabaCloud\Tea\Utils;++class Common+{+    /**+     * Convert a string(utf8) to bytes+     *+     * @param string $string+     *+     * @return array the return bytes+     */+    public static function toBytes($string)+    {+        $bytes = array();+        for ($i = 0; $i < strlen($string); $i++) {+            $bytes[] = ord($string[$i]);+        }+        return $bytes;+    }++    /**+     * Convert a bytes to string(utf8)+     *+     * @param array $bytes+     *+     * @return string the return string+     */+    public static function toString($bytes)+    {+        $str = '';+        foreach ($bytes as $ch) {+            $str .= chr($ch);+        }+        return $str;+    }++    /**+     * Parse it by JSON format+     *+     * @param string $jsonString+     *+     * @return array the parsed result+     */+    public static function parseJSON($jsonString)+    {+        return json_decode($jsonString, true);+    }++    /**+     * Read data from a readable stream, and compose it to a bytes+     *+     * @param resource $stream the readable stream+     *+     * @return array the bytes result+     */+    public static function readAsBytes($stream)+    {+        $str = self::readAsString($stream);+        return self::toBytes($str);+    }++    /**+     * Read data from a readable stream, and compose it to a string+     *+     * @param resource the readable stream+     *+     * @return string the string result+     */+    public static function readAsString($stream)+    {+        return stream_get_contents($stream);+    }++    /**+     * Read data from a readable stream, and parse it by JSON format+     *+     * @param resource the readable stream+     *+     * @return array the parsed result+     */+    public static function readAsJSON($stream)+    {+        return self::parseJSON(self::readAsString($stream));+    }++    /**+     * Generate a nonce string+     *+     * @return string the nonce string+     */+    public static function getNonce()+    {+        return md5("alibabacloud.tea.utils" . uniqid(md5(microtime(true)), true));+    }++    /**+     * Get an UTC format string by current date, e.g. 'Thu, 06 Feb 2020 07:32:54 GMT'+     *+     * @return string the UTC format string+     */+    public static function getDateUTCString()+    {+        return gmdate("Y-m-d\TH:i:s\Z");+    }++    /**+     * If not set the real, use default value+     *+     * @param string $real+     * @param string $default+     *+     * @return string+     */+    public static function defaultString($real, $default = "")+    {+        return null == $real ? $default : $real;+    }++    /**+     * If not set the real, use default value+     *+     * @param integer $real+     * @param integer $default+     *+     * @return integer the return number+     */+    public static function defaultNumber($real, $default = 0)+    {+        return empty($real) ? $default : $real;+    }++    /**+     * Format a map to form string, like a=a%20b%20c+     *+     * @param array|object $query+     *+     * @return string the form string+     */+    public static function toFormString($query)+    {+        if (is_object($query)) {+            $query = json_decode(self::toJSONString($query), true);+        }+        ksort($query);+        return str_replace("+", "%20", http_build_query($query));+    }++    /**+     * If not set the real, use default value+     *+     * @param object $object+     *+     * @return string the return string+     */+    public static function toJSONString($object)+    {+        return json_encode($object);+    }++    /**+     * Check the string is empty?+     *+     * @param string $val+     *+     * @return bool if string is null or zero length, return true+     */+    public static function empty($val)+    {+        return empty($val);+    }++    /**+     * Check one string equals another one?+     *+     * @param integer $left+     * @param integer $right+     *+     * @return bool if equals, return true+     */+    public static function equalString($left, $right)+    {+        return $left === $right;+    }++    /**+     * Check one number equals another one?+     *+     * @param integer $left+     * @param integer $right+     *+     * @return bool if equals, return true+     */+    public static function equalNumber($left, $right)+    {+        return $left === $right;+    }++    /**+     * Check one value is unset+     *+     * @param mixed $value+     *+     * @return bool if unset, return true+     */+    public static function isUnset(&$value = null)+    {+        return !isset($value) || is_null($value);+    }++    /**+     * Stringify the value of map+     *+     * @param array $map+     *+     * @return array the new stringified map+     */+    public static function stringifyMapValue($map)+    {+        return $map;

参数一定是 map 结构,value 可能是别的类型。

AxiosCros

comment created time in 15 days

Pull request review commentaliyun/tea-util

tea-util for php

+<?php++namespace AlibabaCloud\Tea\Utils;++class Common+{+    /**+     * Convert a string(utf8) to bytes+     *+     * @param string $string+     *+     * @return array the return bytes+     */+    public static function toBytes($string)+    {+        $bytes = array();+        for ($i = 0; $i < strlen($string); $i++) {+            $bytes[] = ord($string[$i]);+        }+        return $bytes;+    }++    /**+     * Convert a bytes to string(utf8)+     *+     * @param array $bytes+     *+     * @return string the return string+     */+    public static function toString($bytes)+    {+        $str = '';+        foreach ($bytes as $ch) {+            $str .= chr($ch);+        }+        return $str;+    }++    /**+     * Parse it by JSON format+     *+     * @param string $jsonString+     *+     * @return array the parsed result+     */+    public static function parseJSON($jsonString)+    {+        return json_decode($jsonString, true);+    }++    /**+     * Read data from a readable stream, and compose it to a bytes+     *+     * @param resource $stream the readable stream+     *+     * @return array the bytes result+     */+    public static function readAsBytes($stream)+    {+        $str = self::readAsString($stream);+        return self::toBytes($str);+    }++    /**+     * Read data from a readable stream, and compose it to a string+     *+     * @param resource the readable stream+     *+     * @return string the string result+     */+    public static function readAsString($stream)+    {+        return stream_get_contents($stream);+    }++    /**+     * Read data from a readable stream, and parse it by JSON format+     *+     * @param resource the readable stream+     *+     * @return array the parsed result+     */+    public static function readAsJSON($stream)+    {+        return self::parseJSON(self::readAsString($stream));+    }++    /**+     * Generate a nonce string+     *+     * @return string the nonce string+     */+    public static function getNonce()+    {+        return md5("alibabacloud.tea.utils" . uniqid(md5(microtime(true)), true));+    }++    /**+     * Get an UTC format string by current date, e.g. 'Thu, 06 Feb 2020 07:32:54 GMT'+     *+     * @return string the UTC format string+     */+    public static function getDateUTCString()+    {+        return gmdate("Y-m-d\TH:i:s\Z");+    }++    /**+     * If not set the real, use default value+     *+     * @param string $real+     * @param string $default+     *+     * @return string+     */+    public static function defaultString($real, $default = "")+    {+        return null == $real ? $default : $real;+    }++    /**+     * If not set the real, use default value+     *+     * @param integer $real+     * @param integer $default+     *+     * @return integer the return number+     */+    public static function defaultNumber($real, $default = 0)+    {+        return empty($real) ? $default : $real;+    }++    /**+     * Format a map to form string, like a=a%20b%20c+     *+     * @param array|object $query+     *+     * @return string the form string+     */+    public static function toFormString($query)+    {+        if (is_object($query)) {+            $query = json_decode(self::toJSONString($query), true);+        }+        ksort($query);+        return str_replace("+", "%20", http_build_query($query));+    }++    /**+     * If not set the real, use default value+     *+     * @param object $object+     *+     * @return string the return string+     */+    public static function toJSONString($object)+    {+        return json_encode($object);+    }++    /**+     * Check the string is empty?+     *+     * @param string $val+     *+     * @return bool if string is null or zero length, return true+     */+    public static function empty($val)+    {+        return empty($val);+    }++    /**+     * Check one string equals another one?+     *+     * @param integer $left+     * @param integer $right+     *+     * @return bool if equals, return true+     */+    public static function equalString($left, $right)+    {+        return $left === $right;+    }++    /**+     * Check one number equals another one?+     *+     * @param integer $left+     * @param integer $right+     *+     * @return bool if equals, return true+     */+    public static function equalNumber($left, $right)+    {+        return $left === $right;+    }++    /**+     * Check one value is unset+     *+     * @param mixed $value+     *+     * @return bool if unset, return true+     */+    public static function isUnset(&$value = null)+    {+        return !isset($value) || is_null($value);+    }++    /**+     * Stringify the value of map+     *+     * @param array $map+     *+     * @return array the new stringified map+     */+    public static function stringifyMapValue($map)+    {+        return $map;+    }++    /**+     * Assert a value, if it is a map, return it, otherwise throws+     *+     * @param $any+     *+     * @return array the map value+     */+    public static function assertAsMap($any)+    {+        if (is_array($any)) {+            return $any;+        }+        throw new \InvalidArgumentException("should be array.");

错误消息不对。

AxiosCros

comment created time in 15 days

Pull request review commentaliyun/tea-util

tea-util for php

+<?php++namespace AlibabaCloud\Tea\Utils;++class Common+{+    /**+     * Convert a string(utf8) to bytes+     *+     * @param string $string+     *+     * @return array the return bytes+     */+    public static function toBytes($string)+    {+        $bytes = array();+        for ($i = 0; $i < strlen($string); $i++) {+            $bytes[] = ord($string[$i]);+        }+        return $bytes;+    }++    /**+     * Convert a bytes to string(utf8)+     *+     * @param array $bytes+     *+     * @return string the return string+     */+    public static function toString($bytes)+    {+        $str = '';+        foreach ($bytes as $ch) {+            $str .= chr($ch);+        }+        return $str;+    }++    /**+     * Parse it by JSON format+     *+     * @param string $jsonString+     *+     * @return array the parsed result+     */+    public static function parseJSON($jsonString)+    {+        return json_decode($jsonString, true);+    }++    /**+     * Read data from a readable stream, and compose it to a bytes+     *+     * @param resource $stream the readable stream+     *+     * @return array the bytes result+     */+    public static function readAsBytes($stream)+    {+        $str = self::readAsString($stream);+        return self::toBytes($str);+    }++    /**+     * Read data from a readable stream, and compose it to a string+     *+     * @param resource the readable stream+     *+     * @return string the string result+     */+    public static function readAsString($stream)+    {+        return stream_get_contents($stream);+    }++    /**+     * Read data from a readable stream, and parse it by JSON format+     *+     * @param resource the readable stream+     *+     * @return array the parsed result+     */+    public static function readAsJSON($stream)+    {+        return self::parseJSON(self::readAsString($stream));+    }++    /**+     * Generate a nonce string+     *+     * @return string the nonce string+     */+    public static function getNonce()+    {+        return md5("alibabacloud.tea.utils" . uniqid(md5(microtime(true)), true));+    }++    /**+     * Get an UTC format string by current date, e.g. 'Thu, 06 Feb 2020 07:32:54 GMT'+     *+     * @return string the UTC format string+     */+    public static function getDateUTCString()+    {+        return gmdate("Y-m-d\TH:i:s\Z");+    }++    /**+     * If not set the real, use default value+     *+     * @param string $real+     * @param string $default+     *+     * @return string+     */+    public static function defaultString($real, $default = "")+    {+        return null == $real ? $default : $real;+    }++    /**+     * If not set the real, use default value+     *+     * @param integer $real+     * @param integer $default+     *+     * @return integer the return number+     */+    public static function defaultNumber($real, $default = 0)+    {+        return empty($real) ? $default : $real;+    }++    /**+     * Format a map to form string, like a=a%20b%20c+     *+     * @param array|object $query+     *+     * @return string the form string+     */+    public static function toFormString($query)+    {+        if (is_object($query)) {+            $query = json_decode(self::toJSONString($query), true);+        }+        ksort($query);+        return str_replace("+", "%20", http_build_query($query));+    }++    /**+     * If not set the real, use default value+     *+     * @param object $object+     *+     * @return string the return string+     */+    public static function toJSONString($object)+    {+        return json_encode($object);+    }++    /**+     * Check the string is empty?+     *+     * @param string $val+     *+     * @return bool if string is null or zero length, return true+     */+    public static function empty($val)+    {+        return empty($val);+    }++    /**+     * Check one string equals another one?+     *+     * @param integer $left+     * @param integer $right+     *+     * @return bool if equals, return true+     */+    public static function equalString($left, $right)+    {+        return $left === $right;+    }++    /**+     * Check one number equals another one?+     *+     * @param integer $left+     * @param integer $right+     *+     * @return bool if equals, return true+     */+    public static function equalNumber($left, $right)+    {+        return $left === $right;+    }++    /**+     * Check one value is unset+     *+     * @param mixed $value+     *+     * @return bool if unset, return true+     */+    public static function isUnset(&$value = null)+    {+        return !isset($value) || is_null($value);+    }++    /**+     * Stringify the value of map+     *+     * @param array $map+     *+     * @return array the new stringified map+     */+    public static function stringifyMapValue($map)+    {+        return $map;

map 里的 其他类型要转成 字符串类型。

AxiosCros

comment created time in 15 days

Pull request review commentaliyun/tea-util

tea-util for php

+<?php++namespace AlibabaCloud\Tea\Utils;++class Common+{+    /**+     * Convert a string(utf8) to bytes+     *+     * @param string $string+     *+     * @return array the return bytes+     */+    public static function toBytes($string)+    {+        $bytes = array();+        for ($i = 0; $i < strlen($string); $i++) {+            $bytes[] = ord($string[$i]);+        }+        return $bytes;+    }++    /**+     * Convert a bytes to string(utf8)+     *+     * @param array $bytes+     *+     * @return string the return string+     */+    public static function toString($bytes)+    {+        $str = '';+        foreach ($bytes as $ch) {+            $str .= chr($ch);+        }+        return $str;+    }++    /**+     * Parse it by JSON format+     *+     * @param string $jsonString+     *+     * @return array the parsed result+     */+    public static function parseJSON($jsonString)+    {+        return json_decode($jsonString, true);+    }++    /**+     * Read data from a readable stream, and compose it to a bytes+     *+     * @param resource $stream the readable stream+     *+     * @return array the bytes result+     */+    public static function readAsBytes($stream)+    {+        $str = self::readAsString($stream);+        return self::toBytes($str);+    }++    /**+     * Read data from a readable stream, and compose it to a string+     *+     * @param resource the readable stream+     *+     * @return string the string result+     */+    public static function readAsString($stream)+    {+        return stream_get_contents($stream);+    }++    /**+     * Read data from a readable stream, and parse it by JSON format+     *+     * @param resource the readable stream+     *+     * @return array the parsed result+     */+    public static function readAsJSON($stream)+    {+        return self::parseJSON(self::readAsString($stream));+    }++    /**+     * Generate a nonce string+     *+     * @return string the nonce string+     */+    public static function getNonce()+    {+        return md5("alibabacloud.tea.utils" . uniqid(md5(microtime(true)), true));+    }++    /**+     * Get an UTC format string by current date, e.g. 'Thu, 06 Feb 2020 07:32:54 GMT'+     *+     * @return string the UTC format string+     */+    public static function getDateUTCString()+    {+        return gmdate("Y-m-d\TH:i:s\Z");+    }++    /**+     * If not set the real, use default value+     *+     * @param string $real+     * @param string $default+     *+     * @return string+     */+    public static function defaultString($real, $default = "")+    {+        return null == $real ? $default : $real;+    }++    /**+     * If not set the real, use default value+     *+     * @param integer $real+     * @param integer $default+     *+     * @return integer the return number+     */+    public static function defaultNumber($real, $default = 0)+    {+        return empty($real) ? $default : $real;+    }++    /**+     * Format a map to form string, like a=a%20b%20c+     *+     * @param array|object $query+     *+     * @return string the form string+     */+    public static function toFormString($query)+    {+        if (is_object($query)) {+            $query = json_decode(self::toJSONString($query), true);+        }+        ksort($query);

不需要排序吧

AxiosCros

comment created time in 15 days

Pull request review commentaliyun/tea-util

tea-util for php

 jobs:         - npm install         - npm run test-cov       after_success:-        - bash <(curl -s https://codecov.io/bash) -cF node_js\ No newline at end of file+        - bash <(curl -s https://codecov.io/bash) -cF node_js+    - language: php+      php:+        - 7.1+        - 7.2+        - 7.3+      install:+        - composer --version+        - travis_retry composer update --no-interaction --prefer-source+      script:+        - composer test+      after_success:+        - bash <(curl -s https://codecov.io/bash)

要加 -cF flag

AxiosCros

comment created time in 15 days

more