Skip to content

Commit

Permalink
fix(config-provider): ensure class_exists before instantiation (#105)
Browse files Browse the repository at this point in the history
preservefix(config-provider): ensure class_exists before instantiation
Fixed an issue in ConfigProvider where a class was being instantiated
without first checking if it exists. Exists when executing `php bin/hyperf.php server:watch`command
  • Loading branch information
People-Sea authored Jun 28, 2024
1 parent 3f9e693 commit 7da4a4a
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/ConfigProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ public function __invoke()
foreach ($mineJsonPaths as $jsonPath) {
if (file_exists($jsonPath->getPath() . '/' . Plugin::INSTALL_LOCK_FILE)) {
$info = json_decode(file_get_contents($jsonPath->getRealPath()), true);
if (! empty($info['composer']['config'])) {
if (! empty($info['composer']['config']) && class_exists($info['composer']['config'])) {
$provider = (new ($info['composer']['config']))();
$initialConfig = array_merge_recursive($provider, $initialConfig);
}
Expand Down

0 comments on commit 7da4a4a

Please sign in to comment.