From 2c8887398dcc8842fb279f8ccb7728e498403236 Mon Sep 17 00:00:00 2001 From: Pierre Goiffon Date: Thu, 3 Oct 2019 14:30:13 +0200 Subject: [PATCH] :art: Log classes : PHPDoc & fix wrong self:: uses --- core/log.class.inc.php | 16 ++++++++++++---- setup/setuppage.class.inc.php | 6 ++++-- 2 files changed, 16 insertions(+), 6 deletions(-) diff --git a/core/log.class.inc.php b/core/log.class.inc.php index 1902bad56..cfa973edb 100644 --- a/core/log.class.inc.php +++ b/core/log.class.inc.php @@ -27,6 +27,13 @@ class FileLog { protected $m_sFile = ''; // log is disabled if this is empty + /** + * FileLog constructor. + * + * @param string $sFileName + * + * @since 2.7.0 allow to rotate file (N°2518) + */ public function __construct($sFileName = '') { $this->m_sFile = $sFileName; @@ -34,22 +41,22 @@ class FileLog public function Error($sText) { - self::Write("Error | ".$sText); + $this->Write("Error | ".$sText); } public function Warning($sText) { - self::Write("Warning | ".$sText); + $this->Write("Warning | ".$sText); } public function Info($sText) { - self::Write("Info | ".$sText); + $this->Write("Info | ".$sText); } public function Ok($sText) { - self::Write("Ok | ".$sText); + $this->Write("Ok | ".$sText); } protected function Write($sText) @@ -73,6 +80,7 @@ abstract class LogAPI { public static function Enable($sTargetFile) { + // m_oFileLog is not defined as a class attribute so that each impl will have its own static::$m_oFileLog = new FileLog($sTargetFile); } diff --git a/setup/setuppage.class.inc.php b/setup/setuppage.class.inc.php index b6210b469..66a923fc2 100644 --- a/setup/setuppage.class.inc.php +++ b/setup/setuppage.class.inc.php @@ -37,7 +37,8 @@ class SetupPage extends NiceWebPage parent::__construct($sTitle); $this->add_linked_script("../js/jquery.blockUI.js"); $this->add_linked_script("../setup/setup.js"); - $this->add_style(" + $this->add_style( + <<