mirror of
https://github.com/crazywhalecc/static-php-cli.git
synced 2026-07-08 01:15:37 +08:00
Avoid using glob in phar mode
This commit is contained in:
@@ -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);
|
||||||
|
|||||||
Reference in New Issue
Block a user