mirror of
https://github.com/crazywhalecc/static-php-cli.git
synced 2026-03-18 12:54:52 +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\Exception\WrongUsageException;
|
||||||
use StaticPHP\Registry\Registry;
|
use StaticPHP\Registry\Registry;
|
||||||
|
use StaticPHP\Util\FileSystem;
|
||||||
use Symfony\Component\Yaml\Yaml;
|
use Symfony\Component\Yaml\Yaml;
|
||||||
|
|
||||||
class ArtifactConfig
|
class ArtifactConfig
|
||||||
@ -18,7 +19,7 @@ class ArtifactConfig
|
|||||||
throw new WrongUsageException("Directory {$dir} does not exist, cannot load artifact config.");
|
throw new WrongUsageException("Directory {$dir} does not exist, cannot load artifact config.");
|
||||||
}
|
}
|
||||||
$loaded = [];
|
$loaded = [];
|
||||||
$files = glob("{$dir}/*");
|
$files = FileSystem::scanDirFiles($dir, false);
|
||||||
if (is_array($files)) {
|
if (is_array($files)) {
|
||||||
foreach ($files as $file) {
|
foreach ($files as $file) {
|
||||||
self::loadFromFile($file, $registry_name);
|
self::loadFromFile($file, $registry_name);
|
||||||
|
|||||||
@ -7,6 +7,7 @@ namespace StaticPHP\Config;
|
|||||||
use StaticPHP\Exception\WrongUsageException;
|
use StaticPHP\Exception\WrongUsageException;
|
||||||
use StaticPHP\Registry\Registry;
|
use StaticPHP\Registry\Registry;
|
||||||
use StaticPHP\Runtime\SystemTarget;
|
use StaticPHP\Runtime\SystemTarget;
|
||||||
|
use StaticPHP\Util\FileSystem;
|
||||||
use Symfony\Component\Yaml\Yaml;
|
use Symfony\Component\Yaml\Yaml;
|
||||||
|
|
||||||
class PackageConfig
|
class PackageConfig
|
||||||
@ -23,7 +24,7 @@ class PackageConfig
|
|||||||
throw new WrongUsageException("Directory {$dir} does not exist, cannot load pkg.json config.");
|
throw new WrongUsageException("Directory {$dir} does not exist, cannot load pkg.json config.");
|
||||||
}
|
}
|
||||||
$loaded = [];
|
$loaded = [];
|
||||||
$files = glob("{$dir}/*");
|
$files = FileSystem::scanDirFiles($dir, false);
|
||||||
if (is_array($files)) {
|
if (is_array($files)) {
|
||||||
foreach ($files as $file) {
|
foreach ($files as $file) {
|
||||||
self::loadFromFile($file, $registry_name);
|
self::loadFromFile($file, $registry_name);
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user