default extract for pie sources

This commit is contained in:
henderkes
2026-07-21 13:28:02 +07:00
parent 15e2b7bc8a
commit b437b2fad7
17 changed files with 2 additions and 17 deletions

View File

@@ -22,12 +22,13 @@ class PIE implements DownloadTypeInterface, CheckUpdateInterface
if (!$dist_url || !$dist_type) {
throw new DownloaderException("failed to find {$name} dist info from packagist");
}
$extract = $config['extract'] ?? ('php-src/ext/' . strtolower(preg_replace('/^ext-/i', '', $name)));
$name = str_replace('/', '_', $config['repo']);
$version = $first['version'] ?? 'unknown';
$filename = "{$name}-{$version}." . ($dist_type === 'zip' ? 'zip' : 'tar.gz');
$path = DOWNLOAD_PATH . DIRECTORY_SEPARATOR . $filename;
default_shell()->executeCurlDownload($dist_url, $path, retries: $downloader->getRetry());
return DownloadResult::archive($filename, $config, $config['extract'] ?? null, version: $version, downloader: static::class);
return DownloadResult::archive($filename, $config, $extract, version: $version, downloader: static::class);
}
public function checkUpdate(string $name, array $config, ?string $old_version, ArtifactDownloader $downloader): CheckUpdateResult