Fix custom pkg download callable not working bug

This commit is contained in:
crazywhalecc 2025-07-25 11:29:53 +08:00 committed by Jerry Ma
parent f47c3a2d20
commit a375ab9780

View File

@ -368,6 +368,11 @@ class Downloader
break;
case 'custom': // Custom download method, like API-based download or other
$classes = FileSystem::getClassesPsr4(ROOT_DIR . '/src/SPC/store/pkg', 'SPC\store\pkg');
if (isset($pkg['func']) && is_callable($pkg['func'])) {
$pkg['name'] = $name;
$pkg['func']($force, $pkg, SPC_DOWNLOAD_PACKAGE);
break;
}
foreach ($classes as $class) {
if (is_a($class, CustomPackage::class, true) && $class !== CustomPackage::class) {
$cls = new $class();