From 37351c84c186bd3f1b9da337d0cc68a66c80ef2d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lo=C3=AFc?= <1536036+zoic21@users.noreply.github.com> Date: Tue, 22 Oct 2024 12:18:53 +0200 Subject: [PATCH] Update update.php --- install/update.php | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/install/update.php b/install/update.php index 725ed2f05e..d0f10afb4a 100644 --- a/install/update.php +++ b/install/update.php @@ -100,6 +100,22 @@ $backup_ok = true; } echo "[PROGRESS][10]\n"; + try { + echo "Save cache state of cmd and eqLogic..."; + $data = array('cmd' => array(),'eqLogic' => array()); + foreach(cmd::all() as $cmd){ + $data['cmd'][$cmd->getId()] = $cmd->getCache(); + } + foreach(eqLogic::all() as $eqLogic){ + $data['eqLogic'][$eqLogic->getId()] = $eqLogic->getCache(); + } + file_put_contents('/tmp/jeedom/cache.json',json_encode($data)); + echo "OK"; + } catch (Exception $e) { + echo '***WARNING***' . $e->getMessage(); + } + echo "[PROGRESS][12]\n"; + if (init('core', 1) == 1) { if (init('mode') == 'force') { echo "/!\ Force update /!\ \n";