no message
This commit is contained in:
1 parent
9ad13bfdde
commit
5b079de70b
16 files changed
+1193
-368
No files matched your search
@@ -94,9 +94,44 @@ class FreenodeController extends Controller
|
||||
|
||||
TeleSlave::log()->enableSlaveQueue(false)->send("新fn文章:".$sHtmlUrl);
|
||||
|
||||
self::_delLast();
|
||||
|
||||
return $sHtmlUrl;
|
||||
}
|
||||
|
||||
private function _delLast()
|
||||
{
|
||||
$iLastTime = strtotime("+365 day"); // 这边保存1年
|
||||
// $sLastDate = date("Y-m-d", $iLastTime);
|
||||
$sLastDateCode = date("Ymd", $iLastTime);
|
||||
|
||||
// 删除file
|
||||
foreach (self::$sEnding as $sClient => $sEnding) {
|
||||
$sFilePath = "sub/".$sLastDateCode."-".$sClient.$sEnding;
|
||||
|
||||
if (file_exists($sFilePath)) {
|
||||
if (unlink($sFilePath)) {
|
||||
// echo " - 文件删除成功".$sFilePath."\n";
|
||||
} else {
|
||||
$sMsg = " - 文件删除失败 -> ".$sFilePath."\n";
|
||||
TeleSlave::warn()->send($sMsg);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// 删除html
|
||||
$sHtmlPath = "fn/".$sLastDateCode.".html";
|
||||
if (file_exists($sHtmlPath)) {
|
||||
if (unlink($sHtmlPath)) {
|
||||
// echo " - 文件删除成功".$sHtmlPath."\n";
|
||||
} else {
|
||||
$sMsg = " - 文件删除失败 -> ".$sHtmlPath."\n";
|
||||
TeleSlave::warn()->send($sMsg);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
private function _saveHtml($sDateCode)
|
||||
{
|
||||
$sFreenodeNewUrl = env("APP_URL")."/fn/single/".$sDateCode;
|
||||
|
||||
Reference in new issue
Block a user