mirror of
https://github.com/Seldaek/monolog.git
synced 2025-08-09 22:56:41 +02:00
Merge pull request #1287 from cvuorinen/1286-fopen-check
Check file was opened successfully before trying to read/write
This commit is contained in:
@@ -137,6 +137,11 @@ class DeduplicationHandler extends BufferHandler
|
|||||||
}
|
}
|
||||||
|
|
||||||
$handle = fopen($this->deduplicationStore, 'rw+');
|
$handle = fopen($this->deduplicationStore, 'rw+');
|
||||||
|
|
||||||
|
if (!$handle) {
|
||||||
|
throw new \RuntimeException('Failed to open file for reading and writing: ' . $this->deduplicationStore);
|
||||||
|
}
|
||||||
|
|
||||||
flock($handle, LOCK_EX);
|
flock($handle, LOCK_EX);
|
||||||
$validLogs = [];
|
$validLogs = [];
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user