From dbae2f9d15ffd12d652eb140b4fbd056ec9a018e Mon Sep 17 00:00:00 2001 From: fordnox Date: Mon, 3 Nov 2014 11:01:37 +0200 Subject: [PATCH] Try create log file before opening if it does not exist --- src/bb-library/Box/LogStream.php | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/bb-library/Box/LogStream.php b/src/bb-library/Box/LogStream.php index 97f7dd5b8..368664fbc 100644 --- a/src/bb-library/Box/LogStream.php +++ b/src/bb-library/Box/LogStream.php @@ -37,6 +37,10 @@ class Box_LogStream $streamOrUrl = $streamOrUrl['stream']; } + if(!file_exists($streamOrUrl)) { + @touch($streamOrUrl); + } + if (! $this->_stream = @fopen($streamOrUrl, $mode, false)) { throw new \Box_Exception(":stream cannot be opened with mode :mode", array(':stream'=>$streamOrUrl, ':mode'=>$mode)); }