From 5ae2aa04f5a2326f30dd913d37772d235ab402e1 Mon Sep 17 00:00:00 2001 From: Nightfly Date: Fri, 24 Dec 2021 13:39:50 +0200 Subject: [PATCH] try to fix logging on PHP7 --- RELEASE | 2 +- api/libs/api.olltv.php | 8 ++------ 2 files changed, 3 insertions(+), 7 deletions(-) diff --git a/RELEASE b/RELEASE index c8ca9e88f..ef29d27c5 100644 --- a/RELEASE +++ b/RELEASE @@ -1 +1 @@ -1.2.3 rev 8282 +1.2.3 rev 8283 diff --git a/api/libs/api.olltv.php b/api/libs/api.olltv.php index 4ff109b1e..9b068487b 100644 --- a/api/libs/api.olltv.php +++ b/api/libs/api.olltv.php @@ -270,14 +270,10 @@ protected function _toLog($message, $type = 1) { if ($type > $this->_logLevel) { return false; } - // verify path to log file and write access -// if (!is_writable($this->_log)) { -// return false; -// } // prepare message type $type = $this->_logType[$type] . ': '; // append write to file and get result - $res = file_put_contents($this->_log, date('Y-m-d H:i:s') . ' ' . $type . $message . ";\n", FILE_APPEND | LOCK_EX); + $res = file_put_contents($this->_log, date('Y-m-d H:i:s') . ' ' . $type . $message . ";\n", FILE_APPEND); return (bool) $res; } @@ -429,7 +425,7 @@ protected function _return() { // log warnings if (!empty($this->_result->warnings)) { - $this->_toLog('[' . __FUNCTION__ . '] - API warnings: ' . (string) $this->_result->warnings); + $this->_toLog('[' . __FUNCTION__ . '] - API warnings: ' . print_r($this->_result->warnings, true)); } // verify result status