@@ -27,12 +27,18 @@ class Artifact
2727 /** @var null|callable Bind custom source fetcher callback */
2828 protected mixed $ custom_source_callback = null ;
2929
30+ /** @var null|string Display label describing where the custom source callback came from */
31+ protected ?string $ custom_source_callback_origin = null ;
32+
3033 /** @var null|callable Bind custom source check-update callback */
3134 protected mixed $ custom_source_check_update_callback = null ;
3235
3336 /** @var array<string, callable> Bind custom binary fetcher callbacks */
3437 protected mixed $ custom_binary_callbacks = [];
3538
39+ /** @var array<string, string> Display label per platform describing where the custom binary callback came from */
40+ protected array $ custom_binary_callback_origins = [];
41+
3642 /** @var array<string, callable> Bind custom binary check-update callbacks */
3743 protected array $ custom_binary_check_update_callbacks = [];
3844
@@ -411,17 +417,25 @@ public function getBinaryDir(): ?string
411417
412418 /**
413419 * Set custom source fetcher callback.
420+ *
421+ * @param string $origin Short label shown in progress output (e.g. 'package downloader', 'custom url')
414422 */
415- public function setCustomSourceCallback (callable $ callback ): void
423+ public function setCustomSourceCallback (callable $ callback, string $ origin = ' package downloader ' ): void
416424 {
417425 $ this ->custom_source_callback = $ callback ;
426+ $ this ->custom_source_callback_origin = $ origin ;
418427 }
419428
420429 public function getCustomSourceCallback (): ?callable
421430 {
422431 return $ this ->custom_source_callback ?? null ;
423432 }
424433
434+ public function getCustomSourceCallbackOrigin (): ?string
435+ {
436+ return $ this ->custom_source_callback_origin ;
437+ }
438+
425439 /**
426440 * Set custom source check-update callback.
427441 */
@@ -456,11 +470,19 @@ public function emitCustomBinary(): void
456470 *
457471 * @param string $target_os Target OS platform string (e.g. linux-x86_64)
458472 * @param callable $callback Custom binary fetcher callback
473+ * @param string $origin Short label shown in progress output (e.g. 'package downloader')
459474 */
460- public function setCustomBinaryCallback (string $ target_os , callable $ callback ): void
475+ public function setCustomBinaryCallback (string $ target_os , callable $ callback, string $ origin = ' package downloader ' ): void
461476 {
462477 ConfigValidator::validatePlatformString ($ target_os );
463478 $ this ->custom_binary_callbacks [$ target_os ] = $ callback ;
479+ $ this ->custom_binary_callback_origins [$ target_os ] = $ origin ;
480+ }
481+
482+ public function getCustomBinaryCallbackOrigin (): ?string
483+ {
484+ $ current_platform = SystemTarget::getCurrentPlatformString ();
485+ return $ this ->custom_binary_callback_origins [$ current_platform ] ?? null ;
464486 }
465487
466488 /**
0 commit comments