From 7d3f2d13a49d9af93bb968f698e9e2f2fca7ff1e Mon Sep 17 00:00:00 2001 From: Ro Date: Mon, 2 Aug 2021 13:52:12 -0700 Subject: [PATCH] adds externalAPI key in settings if not present in original settings file when restoring --- brain/utility/Setup.inc.php | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/brain/utility/Setup.inc.php b/brain/utility/Setup.inc.php index 05d2cfa..4018863 100644 --- a/brain/utility/Setup.inc.php +++ b/brain/utility/Setup.inc.php @@ -127,10 +127,24 @@ class SetUp $zip->extractTo("../content"); //move to appropriate spots + /* rename( "../content/settings/settings.json", "../config/settings.json" ); + */ + + //load up old config file + $newConfig = json_decode( + file_get_contents("../content/settings/settings.json"), + true + ); + //check for key, add if not there + if (!isset($newConfig["global"]["externalAPI"])) { + $newConfig["global"]["externalAPI"] = "false"; + } + //write new config file + DocTools::writeSettings("../config/settings.json", $newConfig); //rename("../content/settings/folks.json", "../config/folks.json"); DocTools::writeSettings("../config/folks.json", $newFolks);