// 读取上次报错时间 try { $fhRead = @fopen("timestamp/$this->id.txt", "r"); if($fhRead) { // echo "时间记录文件第一行".fgets($fhRead)."
"; // echo "时间记录文件第二行".fgets($fhRead)."
"; $lastSendEmail = strtotime(fgets($fhRead)); $lastSendSms = strtotime(fgets($fhRead)); }else { $this->logMesg("文件有误, 无法读取"); } }catch (Exception $e) { $this->logMesg("读取报错时间记录文件遇到错误:".$e); }
// 记录报错时间. try { $fhMarkTime = @fopen("timestamp/$this->id.txt", "w"); if($fhMarkTime) { fwrite($fhMarkTime, date("Y-m-d H:i:s",$upadtedLastSendEmail)."\n"); fwrite($fhMarkTime, date("Y-m-d H:i:s",$updatedLastSendSms)); }else { echo "文件写入错误."; } }catch (Exception $e) { echo "文件写入错误: ".$e; }
// Proudly powered by Apache, PHP, MySQL, WordPress, Bootstrap, etc,.