fix(vikon): use cURL streaming for ZIP downloads to avoid memory/timeout issues

This commit is contained in:
F4ilji
2026-07-05 13:26:10 +05:00
parent a18765aafa
commit b9ff255878
5 changed files with 76 additions and 15 deletions
@@ -43,15 +43,14 @@ class UpdateCoreAction
return;
}
$zipContent = $this->http->downloadWithToken(
'pull_updates/generateEmptyModuleCore/' . $moduleId,
$accessToken
);
File::makeDirectory($tempPath, 0755, true, true);
$zipFile = $tempPath . '/module.zip';
file_put_contents($zipFile, $zipContent);
$this->http->downloadToFile(
'pull_updates/generateEmptyModuleCore/' . $moduleId,
$accessToken,
$zipFile
);
$this->extractZip($zipFile, $tempPath);
@@ -62,16 +62,15 @@ class UpdatePartAction
}
// Step 4: Download ZIP
$zipContent = $this->http->downloadWithToken(
"pull_updates/downloadPartByNewCoreResult?operation_identity={$operationIdentity}&part={$part}",
$accessToken
);
$tempPath = $this->storagePath . '/temp/' . $config['path'] . '_part';
File::makeDirectory($tempPath, 0755, true, true);
$zipFile = $tempPath . '/part.zip';
file_put_contents($zipFile, $zipContent);
$this->http->downloadToFile(
"pull_updates/downloadPartByNewCoreResult?operation_identity={$operationIdentity}&part={$part}",
$accessToken,
$zipFile
);
$zip = new ZipArchive();
if ($zip->open($zipFile) !== true) {