版权声明:本文为博主原创文章,未经博主允许不得转载。 https://blog.csdn.net/ufan94/article/details/81286801
$logDir = dirname($this->conf["log_file"]);
if (!is_dir($logDir))
{
mkdir($logDir, 0777, true);
}
$this->fileHandle = fopen($this->conf["log_file"], "a");
“a” 写入方式打开,将文件指针指向文件末尾。如果文件不存在则尝试创建之。