mirror of
https://github.com/crazywhalecc/static-php-cli.git
synced 2026-07-08 17:35:36 +08:00
Add alt download for Downloader (#706)
* Add alt download for Downloader * Test broken url * Break another source * Good! * Rename alt_sources variable * Use SPC_DOWNLOAD_RETRIES instead of SPC_RETRY_TIME * Apply new curlExec args
This commit is contained in:
@@ -477,6 +477,11 @@ class Downloader
|
||||
);
|
||||
break;
|
||||
case 'custom': // Custom download method, like API-based download or other
|
||||
if (isset($source['func']) && is_callable($source['func'])) {
|
||||
$source['name'] = $name;
|
||||
$source['func']($force, $source, $download_as);
|
||||
break;
|
||||
}
|
||||
$classes = FileSystem::getClassesPsr4(ROOT_DIR . '/src/SPC/store/source', 'SPC\store\source');
|
||||
foreach ($classes as $class) {
|
||||
if (is_a($class, CustomSourceBase::class, true) && $class::NAME === $name) {
|
||||
|
||||
Reference in New Issue
Block a user