From 41b2d2bce77e370400286045e2b3533d83ef47db Mon Sep 17 00:00:00 2001 From: Yuri Kuznetsov Date: Thu, 6 May 2021 15:11:52 +0300 Subject: [PATCH] gr globals --- application/Espo/Core/Console/Commands/Upgrade.php | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/application/Espo/Core/Console/Commands/Upgrade.php b/application/Espo/Core/Console/Commands/Upgrade.php index e65c46a713..8c91cc00f2 100644 --- a/application/Espo/Core/Console/Commands/Upgrade.php +++ b/application/Espo/Core/Console/Commands/Upgrade.php @@ -36,6 +36,7 @@ use Espo\Core\{ Utils\Util, Utils\File\Manager as FileManager, Utils\Config, + Utils\Log, Console\Command, Console\Params, Console\IO, @@ -67,10 +68,13 @@ class Upgrade implements Command private $config; - public function __construct(FileManager $fileManager, Config $config) + private $log; + + public function __construct(FileManager $fileManager, Config $config, Log $log) { $this->fileManager = $fileManager; $this->config = $config; + $this->log = $log; } public function run(Params $params, IO $io): void @@ -290,7 +294,7 @@ class Upgrade implements Command protected function runStepsInSingleProcess(string $upgradeId, array $stepList) { - $GLOBALS['log']->debug('Installation process ['.$upgradeId.']: Single process mode.'); + $this->log->debug('Installation process ['.$upgradeId.']: Single process mode.'); try { foreach ($stepList as $stepName) { @@ -301,7 +305,7 @@ class Upgrade implements Command } } catch (Throwable $e) { try { - $GLOBALS['log']->error('Upgrade Error: ' . $e->getMessage()); + $this->log->error('Upgrade Error: ' . $e->getMessage()); } catch (Throwable $t) {} @@ -324,7 +328,7 @@ class Upgrade implements Command if ($shellResult !== 'true') { try { - $GLOBALS['log']->error('Upgrade Error: ' . $shellResult); + $this->log->error('Upgrade Error: ' . $shellResult); } catch (Throwable $t) {}