Skip to content

Commit a375ab9

Browse files
committed
Fix custom pkg download callable not working bug
1 parent f47c3a2 commit a375ab9

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

src/SPC/store/Downloader.php

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -368,6 +368,11 @@ public static function downloadPackage(string $name, ?array $pkg = null, bool $f
368368
break;
369369
case 'custom': // Custom download method, like API-based download or other
370370
$classes = FileSystem::getClassesPsr4(ROOT_DIR . '/src/SPC/store/pkg', 'SPC\store\pkg');
371+
if (isset($pkg['func']) && is_callable($pkg['func'])) {
372+
$pkg['name'] = $name;
373+
$pkg['func']($force, $pkg, SPC_DOWNLOAD_PACKAGE);
374+
break;
375+
}
371376
foreach ($classes as $class) {
372377
if (is_a($class, CustomPackage::class, true) && $class !== CustomPackage::class) {
373378
$cls = new $class();

0 commit comments

Comments
 (0)