Skip to content

Commit

Permalink
添加简略注释
Browse files Browse the repository at this point in the history
  • Loading branch information
VAGH committed Feb 24, 2020
1 parent 965bcf0 commit 9341906
Show file tree
Hide file tree
Showing 209 changed files with 32,944 additions and 2 deletions.
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
/vender
/vendor
.idea
32 changes: 31 additions & 1 deletion sender.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,14 @@
use AlibabaCloud\Client\Exception\ServerException;
use GuzzleHttp\Client;

// 初始化阿里云 SDK 实例
// 参数分别是你阿里云的 accessKeyId 和 accessKeySecret
AlibabaCloud::accessKeyClient('**********', '**********')
->regionId('cn-hangzhou')
->asDefaultClient();

try {
// 你对小可爱的昵称 有多少就列多少
$name_arr = [
'小彭彭',
'小傻瓜',
Expand All @@ -25,6 +28,7 @@
'搞黄彭',
];

// 随机取一个昵称
$name_str = $name_arr[array_rand($name_arr)];
// format lucky number between 0~9
$number_str = rand(0,9);
Expand All @@ -48,7 +52,9 @@
->options([
'query' => [
'RegionId' => "cn-hangzhou",
// 以下短信模板请自己申请
'PhoneNumbers' => "17627828449",
// 签名也需要申请
'SignName' => "余大能耐",
'TemplateCode' => "SMS_176539584",
'TemplateParam' => json_encode($sms_content),
Expand All @@ -62,7 +68,12 @@
echo $e->getErrorMessage() . PHP_EOL;
}


/**
* 获取天气信息
* @return string
* @author yuzhihao <[email protected]>
* @since 2020/2/24
*/
function getWeather()
{
$location = "Beijing";
Expand All @@ -86,6 +97,12 @@ function getWeather()
return $str;
}

/**
* 获取当前温度信息
* @return string
* @author yuzhihao <[email protected]>
* @since 2020/2/24
*/
function getAirNow()
{
$location = "Beijing";
Expand Down Expand Up @@ -134,12 +151,25 @@ function getAirNow()
return $mess;
}

/**
* 计算在一起多长时间
* @return false|float|int
* @author yuzhihao <[email protected]>
* @since 2020/2/24
*/
function getDays()
{
// 在一起的时间
$d1 = strtotime("2019-10-30 00:00:00");
return ceil((time()-$d1)/60/60/24) - 1;
}

/**
* 获取自己的昵称
* @return string
* @author yuzhihao <[email protected]>
* @since 2020/2/24
*/
function getFromName()
{
$day = getDays();
Expand Down
29 changes: 29 additions & 0 deletions vendor/adbario/php-dot-notation/composer.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
{
"name": "adbario/php-dot-notation",
"description": "PHP dot notation access to arrays",
"keywords": ["dotnotation", "arrayaccess"],
"homepage": "https://github.com/adbario/php-dot-notation",
"license": "MIT",
"authors": [
{
"name": "Riku Särkinen",
"email": "[email protected]"
}
],
"require": {
"php": ">=5.5",
"ext-json": "*"
},
"require-dev": {
"phpunit/phpunit": "^4.0|^5.0|^6.0",
"squizlabs/php_codesniffer": "^3.0"
},
"autoload": {
"files": [
"src/helpers.php"
],
"psr-4": {
"Adbar\\": "src"
}
}
}
Loading

0 comments on commit 9341906

Please sign in to comment.