mirror of
https://github.com/crazywhalecc/static-php-cli.git
synced 2026-03-17 20:34:51 +08:00
Avoid using glob in phar mode
This commit is contained in:
parent
7a3f10bd77
commit
0be4e859f3
@ -6,6 +6,7 @@ namespace StaticPHP\Config;
|
||||
|
||||
use StaticPHP\Exception\WrongUsageException;
|
||||
use StaticPHP\Registry\Registry;
|
||||
use StaticPHP\Util\FileSystem;
|
||||
use Symfony\Component\Yaml\Yaml;
|
||||
|
||||
class ArtifactConfig
|
||||
@ -18,7 +19,7 @@ class ArtifactConfig
|
||||
throw new WrongUsageException("Directory {$dir} does not exist, cannot load artifact config.");
|
||||
}
|
||||
$loaded = [];
|
||||
$files = glob("{$dir}/*");
|
||||
$files = FileSystem::scanDirFiles($dir, false);
|
||||
if (is_array($files)) {
|
||||
foreach ($files as $file) {
|
||||
self::loadFromFile($file, $registry_name);
|
||||
|
||||
@ -7,6 +7,7 @@ namespace StaticPHP\Config;
|
||||
use StaticPHP\Exception\WrongUsageException;
|
||||
use StaticPHP\Registry\Registry;
|
||||
use StaticPHP\Runtime\SystemTarget;
|
||||
use StaticPHP\Util\FileSystem;
|
||||
use Symfony\Component\Yaml\Yaml;
|
||||
|
||||
class PackageConfig
|
||||
@ -23,7 +24,7 @@ class PackageConfig
|
||||
throw new WrongUsageException("Directory {$dir} does not exist, cannot load pkg.json config.");
|
||||
}
|
||||
$loaded = [];
|
||||
$files = glob("{$dir}/*");
|
||||
$files = FileSystem::scanDirFiles($dir, false);
|
||||
if (is_array($files)) {
|
||||
foreach ($files as $file) {
|
||||
self::loadFromFile($file, $registry_name);
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user