From d1b138a353833a9618f7937dccb5274f989dbb9e Mon Sep 17 00:00:00 2001 From: Yuri Kuznetsov Date: Sat, 25 Nov 2023 11:21:46 +0200 Subject: [PATCH] before upgrade --- upgrades/8.1/scripts/BeforeUpgrade.php | 62 ++++++++++++++++++++++++++ 1 file changed, 62 insertions(+) create mode 100644 upgrades/8.1/scripts/BeforeUpgrade.php diff --git a/upgrades/8.1/scripts/BeforeUpgrade.php b/upgrades/8.1/scripts/BeforeUpgrade.php new file mode 100644 index 0000000000..a8e9180bdb --- /dev/null +++ b/upgrades/8.1/scripts/BeforeUpgrade.php @@ -0,0 +1,62 @@ +checkLogHandlers($container); + } + + /** + * @throws Error + */ + private function checkLogHandlers(Container $container): void + { + $config = $container->getByClass(Config::class); + + if (!$config->get('logger.handlerList')) { + return; + } + + $msg = "You need to remove logger.handlerList from the `data/config-internal.php` before upgrading. " . + "In EspoCRM v8.1, Monolog library was updated, custom log handlers may be incompatible. ". + "You will be able to return the handlers back after the upgrade."; + + throw new Error($msg); + } +}