public function writeLogToDisk() { // 没有统计数据则返回 if (empty($this->logBuffer)) { return; } // 写入磁盘 file_put_contents(Config::$dataPath . $this->logDir . date('Y-m-d'), $this->logBuffer, FILE_APPEND | LOCK_EX); $this->logBuffer = ''; }