Try create log file before opening if it does not exist

This commit is contained in:
fordnox committed 2014-11-03 11:01:37 +02:00
1 parent 1b0cf67924
commit dbae2f9d15
1 file changed
+4
+4
View File
@@ -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));
}