mirror of
https://github.com/crazywhalecc/static-php-cli.git
synced 2026-07-10 02:15:36 +08:00
Fix custom pkg download callable not working bug
This commit is contained in:
@@ -368,6 +368,11 @@ class Downloader
|
|||||||
break;
|
break;
|
||||||
case 'custom': // Custom download method, like API-based download or other
|
case 'custom': // Custom download method, like API-based download or other
|
||||||
$classes = FileSystem::getClassesPsr4(ROOT_DIR . '/src/SPC/store/pkg', 'SPC\store\pkg');
|
$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) {
|
foreach ($classes as $class) {
|
||||||
if (is_a($class, CustomPackage::class, true) && $class !== CustomPackage::class) {
|
if (is_a($class, CustomPackage::class, true) && $class !== CustomPackage::class) {
|
||||||
$cls = new $class();
|
$cls = new $class();
|
||||||
|
|||||||
Reference in New Issue
Block a user