Skip to content

Commit

Permalink
check for mongo extension (#194)
Browse files Browse the repository at this point in the history
if platform requirements are ignored, then trying to load this module causes a fatal error.
that's particularly bad because it happens during composer autoloading, so add an extra
check and do not try to run without the extension.
  • Loading branch information
brettmc authored Sep 20, 2023
1 parent a973a41 commit e19259f
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/Instrumentation/MongoDB/_register.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,5 +8,8 @@
if (class_exists(Sdk::class) && Sdk::isInstrumentationDisabled(MongoDBInstrumentation::NAME) === true) {
return;
}
if (!extension_loaded('mongodb')) {
return;
}

MongoDBInstrumentation::register();

0 comments on commit e19259f

Please sign in to comment.