Commit 61fb44a3 by xmy

feat:构建成功通知

parent d3c1ea4d
...@@ -5,7 +5,7 @@ ...@@ -5,7 +5,7 @@
* Date: 2018/7/16 * Date: 2018/7/16
* Time: 11:09 * Time: 11:09
*/ */
$basePath = dirname(__DIR__,3); $basePath = dirname(__DIR__, 3);
/** /**
* 用于自建组件扫描路径配置(键值是方便开发人员理解,代码中无意义) * 用于自建组件扫描路径配置(键值是方便开发人员理解,代码中无意义)
...@@ -15,7 +15,41 @@ $basePath = dirname(__DIR__,3); ...@@ -15,7 +15,41 @@ $basePath = dirname(__DIR__,3);
* *
* ]; * ];
*/ */
function notice($msg)
{
$jsonStr = json_encode([
'msgtype' => 'text',
'text' => [
'content' => $msg
]
]);
$url = "https://qyapi.weixin.qq.com/cgi-bin/webhook/send?key=97225115-5aa1-47e9-a029-04d0c25abb47";
$ch = curl_init();
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_POSTFIELDS, $jsonStr);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_HTTPHEADER, array(
'Content-Type: application/json; charset=utf-8',
'Content-Length: ' . strlen($jsonStr)
)
);
$response = curl_exec($ch);
$httpCode = curl_getinfo($ch, CURLINFO_HTTP_CODE);
curl_close($ch);
return array($httpCode, $response);
}
try {
$msg = "环境:" . env("ENVIRONMENT") . " 项目名称:" . APP_NAME . "————构建成功!";
notice($msg);
} catch (Exception $e) {
var_dump($e->getMessage());
}
return [ return [
'commonPath' => $basePath.'/Common', 'commonPath' => $basePath . '/Common',
]; ];
\ No newline at end of file
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