From 6c406124dd416ec62fc2ce0a4d07d597d3ae53f3 Mon Sep 17 00:00:00 2001 From: K Rahul Reddy Date: Fri, 12 Jun 2020 19:04:48 +0530 Subject: [PATCH] Added setup-website option --- cmake/website.tmpl | 2 +- lib/setup/SetupClass.php | 43 ++++++++++++++++++++++++++++++++++++++++ utils/setup.php | 6 ++++++ 3 files changed, 50 insertions(+), 1 deletion(-) diff --git a/cmake/website.tmpl b/cmake/website.tmpl index 0257aa10..c5173956 100755 --- a/cmake/website.tmpl +++ b/cmake/website.tmpl @@ -1,3 +1,3 @@ removeFlatnodeFile(); } + /** + * Setup settings_test.php in the build/settings directory from build/.env file + * + * @return null + */ + public function setupWebsite() + { + $rOutputFile = fopen(CONST_InstallPath.'/settings/settings-frontend.php', 'w'); + + // Currently using CONST_BasePath and CONST_InstallPath. + // Once dotenv is setup, getenv() can be used, or another + // alternate option is to build settings_test.php using cmake. + + fwrite($rOutputFile, "createCountryNames($aCMDResult); } +if ($aCMDResult['setup-website'] || $aCMDResult['all']) { + $bDidSomething = true; + $oSetup->setupWebsite(); +} + // ****************************************************** // If we did something, repeat the warnings if (!$bDidSomething) { -- 2.45.1