mirror of
https://github.com/crazywhalecc/static-php-cli.git
synced 2026-07-14 04:15:35 +08:00
unwrap cast to unify curlDown with curlExec
This commit is contained in:
@@ -573,14 +573,7 @@ class Downloader
|
|||||||
$check = !defined('DEBUG_MODE') ? 's' : '#';
|
$check = !defined('DEBUG_MODE') ? 's' : '#';
|
||||||
$retry = $retries > 0 ? "--retry {$retries}" : '';
|
$retry = $retries > 0 ? "--retry {$retries}" : '';
|
||||||
$cmd = SPC_CURL_EXEC . " -{$check}fSL {$retry} -o \"{$path}\" {$methodArg} {$headerArg} \"{$url}\"";
|
$cmd = SPC_CURL_EXEC . " -{$check}fSL {$retry} -o \"{$path}\" {$methodArg} {$headerArg} \"{$url}\"";
|
||||||
try {
|
f_passthru($cmd);
|
||||||
f_passthru($cmd);
|
|
||||||
} catch (RuntimeException $e) {
|
|
||||||
if ($e->getCode() === 2 || $e->getCode() === -1073741510) {
|
|
||||||
throw new WrongUsageException('Keyboard interrupted, download failed !');
|
|
||||||
}
|
|
||||||
throw $e;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public static function getPreBuiltLockName(string $source): string
|
public static function getPreBuiltLockName(string $source): string
|
||||||
|
|||||||
Reference in New Issue
Block a user