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()