您好,登錄后才能下訂單哦!
/*
*檢查路徑是否存在
*/
function checkDir($dir)
{
exec("/bin/ls $dir", $info, $status);
$sta = empty($info) ? $sta = 1 : $sta = 0;//1路徑不存在,0路徑存在
return $sta;
}
//倉庫是git還是svn
function warehouseCheck($warehouse)
{
if (preg_match("/.git$/i", $warehouse)) {
$sta = 1; //1為git
}
if (preg_match("/^svn:\/\//i", $warehouse)) {
$sta = 2; //2為svn
}
return $sta;
}
//環(huán)境選擇
function envCheck($env_name, $ser_tmp)
{
if (strpos($env_name, "測試") !== false) {
$dir_tmp = "$ser_tmp/cs";
} elseif (strpos($env_name, "預發(fā)布") !== false) {
$dir_tmp = "$ser_tmp/yfb";
} elseif (strpos($env_name, "正式") !== false || strpos($env_name, "線上") !== false) {
$dir_tmp = "$ser_tmp/zs";
} else {
$dir_tmp = "";
}
return $dir_tmp;
}
//發(fā)郵件
function sendMail($to, $subject, $content,$send_user){
header("content-type:text/html;charset=utf-8");
ini_set("magic_quotes_runtime",0);
vendor("Phpmailer.phpmailer");
try {
$mail = new PHPMailer(true);//實例化
$mail->IsSMTP();// 啟用SMTP
$mail->CharSet='UTF-8'; //設置郵件的字符編碼,這很重要,不然中文亂碼
$mail->SMTPAuth = true; //開啟認證
$mail->Port = 25;
$mail->Host = "smtp.exmail.qq.com";
$mail->Username = "ops@feibo.cn";
$mail->Password = "feibo54321";
//$mail->IsSendmail(); //如果沒有sendmail組件就注釋掉,否則出現(xiàn)“Could not execute: /var/qmail/bin/sendmail ”的錯誤提示
//$mail->AddReplyTo("phpddt1990@163.com","mckee");//回復地址
$mail->From = "ops@feibo.cn";
$mail->FromName = $send_user;
//$to = "linc@feibo.cn";
//dump($to);die;
foreach($to as $v){
$mail->AddAddress($v);
}
$content = str_replace('\n',"\n",$content);
$mail->IsHTML(true); //支持html格式內(nèi)容
$mail->Subject = $subject;
$mail->Body = $content;
//$mail->AltBody = "To view the message, please use an HTML compatible email viewer!"; //當郵件不支持html時備用顯示,可以省略
$mail->WordWrap = 80; // 設置每行字符串的長度
//$mail->AddAttachment("f:/test.png"); //可以添加附件
$mail->Send();
} catch (phpmailerException $e) {
echo "郵件發(fā)送失敗:".$e->errorMessage();
}
}
免責聲明:本站發(fā)布的內(nèi)容(圖片、視頻和文字)以原創(chuàng)、轉(zhuǎn)載和分享為主,文章觀點不代表本網(wǎng)站立場,如果涉及侵權請聯(lián)系站長郵箱:is@yisu.com進行舉報,并提供相關證據(jù),一經(jīng)查實,將立刻刪除涉嫌侵權內(nèi)容。