Implement caching for config file parsing to improve performance

This commit is contained in:
crazywhalecc
2026-04-07 17:10:33 +08:00
parent 8e91e02806
commit baa21d6e94
5 changed files with 111 additions and 14 deletions

View File

@@ -64,7 +64,7 @@ class Registry
}
$data = match (pathinfo($registry_file, PATHINFO_EXTENSION)) {
'json' => json_decode($yaml, true),
'yaml', 'yml' => Yaml::parse($yaml),
'yaml', 'yml' => extension_loaded('yaml') ? yaml_parse($yaml) : Yaml::parse($yaml),
default => throw new RegistryException("Unsupported registry file format: {$registry_file}"),
};
if (!is_array($data)) {