mirror of
https://github.com/crazywhalecc/static-php-cli.git
synced 2026-03-18 04:44:53 +08:00
Allow loading config dir from registry
This commit is contained in:
parent
dc5bf6dc98
commit
64fde5fd8c
@ -87,7 +87,11 @@ class Registry
|
|||||||
if (isset($data['package']['config']) && is_array($data['package']['config'])) {
|
if (isset($data['package']['config']) && is_array($data['package']['config'])) {
|
||||||
foreach ($data['package']['config'] as $path) {
|
foreach ($data['package']['config'] as $path) {
|
||||||
$path = self::fullpath($path, dirname($registry_file));
|
$path = self::fullpath($path, dirname($registry_file));
|
||||||
PackageConfig::loadFromFile($path);
|
if (is_file($path)) {
|
||||||
|
PackageConfig::loadFromFile($path);
|
||||||
|
} elseif (is_dir($path)) {
|
||||||
|
PackageConfig::loadFromDir($path);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -95,7 +99,11 @@ class Registry
|
|||||||
if (isset($data['artifact']['config']) && is_array($data['artifact']['config'])) {
|
if (isset($data['artifact']['config']) && is_array($data['artifact']['config'])) {
|
||||||
foreach ($data['artifact']['config'] as $path) {
|
foreach ($data['artifact']['config'] as $path) {
|
||||||
$path = self::fullpath($path, dirname($registry_file));
|
$path = self::fullpath($path, dirname($registry_file));
|
||||||
ArtifactConfig::loadFromFile($path);
|
if (is_file($path)) {
|
||||||
|
ArtifactConfig::loadFromFile($path);
|
||||||
|
} elseif (is_dir($path)) {
|
||||||
|
ArtifactConfig::loadFromDir($path);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -232,7 +240,7 @@ class Registry
|
|||||||
*/
|
*/
|
||||||
private static function requireClassFile(string $class, ?string $file_path, string $base_path, bool $auto_require): void
|
private static function requireClassFile(string $class, ?string $file_path, string $base_path, bool $auto_require): void
|
||||||
{
|
{
|
||||||
if (!$auto_require || class_exists($class, true)) {
|
if (!$auto_require || class_exists($class)) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user