From 754c174e9df7d4e3f97dc3e8e8f9ec5073d48f0f Mon Sep 17 00:00:00 2001 From: "o.pinke" Date: Tue, 12 Mar 2024 19:19:19 +0100 Subject: [PATCH] use new log class --- conlite/classes/contenido/class.module.php | 25 +++++++++++-------- .../classes/exeptions/class.pim.exeption.php | 8 ++++-- 2 files changed, 21 insertions(+), 12 deletions(-) diff --git a/conlite/classes/contenido/class.module.php b/conlite/classes/contenido/class.module.php index e4faabc..6553d20 100644 --- a/conlite/classes/contenido/class.module.php +++ b/conlite/classes/contenido/class.module.php @@ -19,6 +19,10 @@ * * $Id$ */ + +use ConLite\Log\LogWriter; +use ConLite\Log\Log; + if (!defined('CON_FRAMEWORK')) { die('Illegal call'); } @@ -148,9 +152,9 @@ class cApiModule extends Item { try { mkdir($this->_aModFileEditConf['modPath'], 0777, true); } catch (Exception $ex) { - $oWriter = cLogWriter::factory("File", ['destination' => $sPathErrorLog]); - $oLog = new cLog($oWriter); - $oLog->log($ex->getFile() . " (" . $ex->getLine() . "): " . $ex->getMessage(), cLog::WARN); + $writer = LogWriter::factory("File", ['destination' => $sPathErrorLog]); + $log = new Log($writer); + $log->log($ex->getFile() . " (" . $ex->getLine() . "): " . $ex->getMessage(), Log::WARN); } } @@ -160,9 +164,9 @@ class cApiModule extends Item { try { mkdir($this->getModulePath(), 0777); } catch (Exception $ex) { - $oWriter = cLogWriter::factory("File", ['destination' => $sPathErrorLog]); - $oLog = new cLog($oWriter); - $oLog->log($ex->getFile() . " (" . $ex->getLine() . "): " . $ex->getMessage(), cLog::WARN); + $writer = LogWriter::factory("File", ['destination' => $sPathErrorLog]); + $log = new Log($writer); + $log->log($ex->getFile() . " (" . $ex->getLine() . "): " . $ex->getMessage(), Log::WARN); } if (is_writable($this->getModulePath())) { @@ -171,9 +175,9 @@ class cApiModule extends Item { umask($this->_oldumask); } } else { - $oWriter = cLogWriter::factory("File", ['destination' => $sPathErrorLog]); - $oLog = new cLog($oWriter); - $oLog->log(__FILE__ . " (" . __LINE__ . "): " . 'Error: Cannot create mod path '.$this->getModulePath(), cLog::WARN); + $writer = LogWriter::factory("File", ['destination' => $sPathErrorLog]); + $log = new Log($writer); + $log->log(__FILE__ . " (" . __LINE__ . "): " . 'Error: Cannot create mod path '.$this->getModulePath(), Log::WARN); } return FALSE; } @@ -244,7 +248,8 @@ class cApiModule extends Item { * * @return array Found strings for this module */ - public function parseModuleForStrings() { + public function parseModuleForStrings(): bool|array + { global $cfg; if ($this->virgin == true) { return false; diff --git a/conlite/plugins/pluginmanager/classes/exeptions/class.pim.exeption.php b/conlite/plugins/pluginmanager/classes/exeptions/class.pim.exeption.php index 76397ad..eb0fbde 100644 --- a/conlite/plugins/pluginmanager/classes/exeptions/class.pim.exeption.php +++ b/conlite/plugins/pluginmanager/classes/exeptions/class.pim.exeption.php @@ -1,4 +1,8 @@ cRegistry::getConfigValue('path', 'data') . 'logs/exception.log' )); - $this->_logger = new cLog($writer); + $this->_logger = new Log($writer); // determine if exception should be logged if (false === $this->_log_exception