mirror of
https://github.com/crazywhalecc/static-php-cli.git
synced 2026-07-02 22:35:43 +08:00
add more tests
This commit is contained in:
@@ -14,13 +14,13 @@ class FileSystem
|
||||
/**
|
||||
* @throws FileSystemException
|
||||
*/
|
||||
public static function loadConfigArray(string $config): array
|
||||
public static function loadConfigArray(string $config, ?string $config_dir = null): array
|
||||
{
|
||||
$whitelist = ['ext', 'lib', 'source'];
|
||||
if (!in_array($config, $whitelist)) {
|
||||
throw new FileSystemException('Reading ' . $config . '.json is not allowed');
|
||||
}
|
||||
$tries = [
|
||||
$tries = $config_dir !== null ? [FileSystem::convertPath($config_dir . '/' . $config . '.json')] : [
|
||||
WORKING_DIR . '/config/' . $config . '.json',
|
||||
ROOT_DIR . '/config/' . $config . '.json',
|
||||
];
|
||||
|
||||
@@ -27,7 +27,7 @@ $with_libs = match (PHP_OS_FAMILY) {
|
||||
// You can use `common`, `bulk`, `minimal` or `none`.
|
||||
// note: combination is only available for *nix platform. Windows must use `none` combination
|
||||
$base_combination = match (PHP_OS_FAMILY) {
|
||||
'Linux', 'Darwin' => 'bulk',
|
||||
'Linux', 'Darwin' => 'minimal',
|
||||
'Windows' => 'none',
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user