mirror of
https://github.com/crazywhalecc/static-php-cli.git
synced 2026-07-08 01:15:37 +08:00
Add support for custom source check-update callbacks in artifacts
This commit is contained in:
@@ -27,6 +27,9 @@ class Artifact
|
||||
/** @var null|callable Bind custom source fetcher callback */
|
||||
protected mixed $custom_source_callback = null;
|
||||
|
||||
/** @var null|callable Bind custom source check-update callback */
|
||||
protected mixed $custom_source_check_update_callback = null;
|
||||
|
||||
/** @var array<string, callable> Bind custom binary fetcher callbacks */
|
||||
protected mixed $custom_binary_callbacks = [];
|
||||
|
||||
@@ -408,6 +411,19 @@ class Artifact
|
||||
return $this->custom_source_callback ?? null;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set custom source check-update callback.
|
||||
*/
|
||||
public function setCustomSourceCheckUpdateCallback(callable $callback): void
|
||||
{
|
||||
$this->custom_source_check_update_callback = $callback;
|
||||
}
|
||||
|
||||
public function getCustomSourceCheckUpdateCallback(): ?callable
|
||||
{
|
||||
return $this->custom_source_check_update_callback ?? null;
|
||||
}
|
||||
|
||||
public function getCustomBinaryCallback(): ?callable
|
||||
{
|
||||
$current_platform = SystemTarget::getCurrentPlatformString();
|
||||
|
||||
Reference in New Issue
Block a user