Some prerequisites for refactor

This commit is contained in:
crazywhalecc
2025-03-24 19:25:38 +08:00
parent 371a588396
commit 8909b62dc4
7 changed files with 29 additions and 22 deletions

View File

@@ -106,6 +106,21 @@ class Config
return self::$lib;
}
/**
* @throws WrongUsageException
* @throws FileSystemException
*/
public static function getExtTarget(string $name): ?array
{
if (self::$ext === null) {
self::$ext = FileSystem::loadConfigArray('ext');
}
if (!isset(self::$ext[$name])) {
throw new WrongUsageException('ext [' . $name . '] is not supported yet');
}
return self::$ext[$name]['target'] ?? ['static', 'shared'];
}
/**
* @throws FileSystemException
* @throws WrongUsageException