From 6c3e9cf4cc76a28c0e35fbbd50cb48c77fe01f86 Mon Sep 17 00:00:00 2001 From: Peter Ivanov Date: Mon, 26 Aug 2024 17:32:17 +0300 Subject: [PATCH] update --- web/Modules/Microweber/Jobs/DownloadMicroweber.php | 7 +++++-- .../Microweber/MicroweberComposerClientHelper.php | 10 +++++++++- 2 files changed, 14 insertions(+), 3 deletions(-) diff --git a/web/Modules/Microweber/Jobs/DownloadMicroweber.php b/web/Modules/Microweber/Jobs/DownloadMicroweber.php index 434678c..2373441 100644 --- a/web/Modules/Microweber/Jobs/DownloadMicroweber.php +++ b/web/Modules/Microweber/Jobs/DownloadMicroweber.php @@ -35,18 +35,21 @@ class DownloadMicroweber implements ShouldQueue ShellApi::exec('chmod +x ' . $shellPath . '/*'); $mwComposerClientHelper = new MicroweberComposerClientHelper(); + $instance = $mwComposerClientHelper->getComposerClientInstance(); + $instance->prepareHeaders(); + // Download core app $status = $mwComposerClientHelper->getMicroweberDownloaderInstance()->download(config('microweber.sharedPaths.app')); // Download modules $modulesDownloader = new MicroweberModuleConnectorsDownloader(); - $modulesDownloader->setComposerClient($mwComposerClientHelper->getComposerClientInstance()); + $modulesDownloader->setComposerClient($instance); $status = $modulesDownloader->download(config('microweber.sharedPaths.modules')); // Download templates $templatesDownloader = new MicroweberTemplatesDownloader(); - $templatesDownloader->setComposerClient($mwComposerClientHelper->getComposerLicensedInstance()); + $templatesDownloader->setComposerClient($instance); $status = $templatesDownloader->download(config('microweber.sharedPaths.templates')); } diff --git a/web/Modules/Microweber/MicroweberComposerClientHelper.php b/web/Modules/Microweber/MicroweberComposerClientHelper.php index 0f8ef81..ff8421a 100644 --- a/web/Modules/Microweber/MicroweberComposerClientHelper.php +++ b/web/Modules/Microweber/MicroweberComposerClientHelper.php @@ -13,9 +13,17 @@ class MicroweberComposerClientHelper $composerClient = new Client(); $composerClient->packageServers = [ 'https://market.microweberapi.com/packages/microweberserverpackages/packages.json', + 'https://packages.microweberapi.com/packages/microweber/packages.json', ]; - return $composerClient; + $lic = setting('whitelabel_license_key'); + + if($lic) { + $composerClient->addLicense([ + 'local_key' => $lic + ]); + } + return $composerClient; } public function getComposerLicensedInstance()