This commit is contained in:
Peter Ivanov 2024-08-26 17:32:17 +03:00
parent cbaa87ebd9
commit 6c3e9cf4cc
2 changed files with 14 additions and 3 deletions

View file

@ -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'));
}

View file

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