mirror of
https://github.com/Karaka-Management/phpOMS.git
synced 2026-02-08 21:28:40 +00:00
Fix locking
This commit is contained in:
parent
7b36dafa57
commit
7bd0bc7067
|
|
@ -311,8 +311,10 @@ class FileLogger implements LoggerInterface
|
||||||
$this->createFile();
|
$this->createFile();
|
||||||
$this->fp = fopen($this->path, 'a');
|
$this->fp = fopen($this->path, 'a');
|
||||||
|
|
||||||
if ($this->fp !== false) {
|
if (flock($this->fp, LOCK_EX) && $this->fp !== false) {
|
||||||
fwrite($this->fp, $message . "\n");
|
fwrite($this->fp, $message . "\n");
|
||||||
|
fflush($this->fp);
|
||||||
|
flock($this->fp, LOCK_UN);
|
||||||
fclose($this->fp);
|
fclose($this->fp);
|
||||||
$this->fp = false;
|
$this->fp = false;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user