@@ -277,25 +277,25 @@ discard block |
||
| 277 | 277 | |
| 278 | 278 | system_log($renew_log ?: sprintf("在%s这个时刻,并没有需要续期的域名,写这条日志是为了证明我确实执行了。今次取得的域名信息如是:\n%s", date('Y-m-d H:i:s'), var_export($domains, true))); |
| 279 | 279 | if ($this->notRenewed || $this->renewed) { |
| 280 | - if (static::$config['telegram']['enable'] == 'true') { |
|
| 281 | - $this->sendTelegram( |
|
| 282 | - [ |
|
| 283 | - $this->renewed ? '续期成功:' . $this->renewed . '<br>' : '', |
|
| 284 | - $this->notRenewed ? '续期出错:' . $this->notRenewed . '<br>' : '', |
|
| 285 | - $this->domainsInfo ?: '啊咧~没看到其它域名呢。' |
|
| 286 | - ] |
|
| 287 | - ); |
|
| 288 | - } else { |
|
| 289 | - $this->sendEmail( |
|
| 290 | - '主人,我刚刚帮你续期域名啦~', |
|
| 291 | - [ |
|
| 292 | - $this->renewed ? '续期成功:' . $this->renewed . '<br>' : '', |
|
| 293 | - $this->notRenewed ? '续期出错:' . $this->notRenewed . '<br>' : '', |
|
| 294 | - $this->domainsInfo ?: '啊咧~没看到其它域名呢。' |
|
| 295 | - ] |
|
| 296 | - ); |
|
| 297 | - } |
|
| 298 | - } |
|
| 280 | + if (static::$config['telegram']['enable'] == 'true') { |
|
| 281 | + $this->sendTelegram( |
|
| 282 | + [ |
|
| 283 | + $this->renewed ? '续期成功:' . $this->renewed . '<br>' : '', |
|
| 284 | + $this->notRenewed ? '续期出错:' . $this->notRenewed . '<br>' : '', |
|
| 285 | + $this->domainsInfo ?: '啊咧~没看到其它域名呢。' |
|
| 286 | + ] |
|
| 287 | + ); |
|
| 288 | + } else { |
|
| 289 | + $this->sendEmail( |
|
| 290 | + '主人,我刚刚帮你续期域名啦~', |
|
| 291 | + [ |
|
| 292 | + $this->renewed ? '续期成功:' . $this->renewed . '<br>' : '', |
|
| 293 | + $this->notRenewed ? '续期出错:' . $this->notRenewed . '<br>' : '', |
|
| 294 | + $this->domainsInfo ?: '啊咧~没看到其它域名呢。' |
|
| 295 | + ] |
|
| 296 | + ); |
|
| 297 | + } |
|
| 298 | + } |
|
| 299 | 299 | |
| 300 | 300 | $curl->close(); |
| 301 | 301 | |
@@ -394,17 +394,17 @@ discard block |
||
| 394 | 394 | } catch (LlfException $e) { |
| 395 | 395 | system_log($e->getMessage()); |
| 396 | 396 | if (static::$config['telegram']['enable'] == 'true') { |
| 397 | - FREENOM::instance()->sendTelegram( |
|
| 398 | - [$e->getMessage(),$e->getFile(),$e->getLine(),$e->getMessage()] |
|
| 399 | - ); |
|
| 397 | + FREENOM::instance()->sendTelegram( |
|
| 398 | + [$e->getMessage(),$e->getFile(),$e->getLine(),$e->getMessage()] |
|
| 399 | + ); |
|
| 400 | 400 | } else { |
| 401 | - FREENOM::instance()->sendEmail( |
|
| 402 | - '主人,' . $e->getMessage(), |
|
| 403 | - sprintf('具体是在%s文件的%d行,抛出了一个异常。异常的内容是%s,快去看看吧。', $e->getFile(), $e->getLine(), $e->getMessage()), |
|
| 404 | - '', |
|
| 405 | - 'llfexception' |
|
| 406 | - ); |
|
| 407 | - } |
|
| 401 | + FREENOM::instance()->sendEmail( |
|
| 402 | + '主人,' . $e->getMessage(), |
|
| 403 | + sprintf('具体是在%s文件的%d行,抛出了一个异常。异常的内容是%s,快去看看吧。', $e->getFile(), $e->getLine(), $e->getMessage()), |
|
| 404 | + '', |
|
| 405 | + 'llfexception' |
|
| 406 | + ); |
|
| 407 | + } |
|
| 408 | 408 | } catch (\Exception $e) { |
| 409 | 409 | system_log(sprintf('#%d - %s', $e->getCode(), $e->getMessage())); |
| 410 | 410 | } |