Skip to content

Commit

Permalink
Improve extension matching in installer
Browse files Browse the repository at this point in the history
As suggested in #1846.
  • Loading branch information
bwoebi committed Jan 12, 2023
1 parent 64f8694 commit 5c01a63
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions datadog-setup.php
Original file line number Diff line number Diff line change
Expand Up @@ -226,8 +226,10 @@ function install($options)
foreach (scandir($phpProperties[INI_SCANDIR]) as $ini) {
$path = "{$phpProperties[INI_SCANDIR]}/$ini";
if (is_file($path)) {
if (preg_match('(^\s*extension\s*=.+ddtrace\.so)m', file_get_contents($path))) {
$iniFileName = $ini;
if (preg_match("(^\s*extension\s*=\s*(\S*ddtrace)\b)m", file_get_contents($path), $res)) {
if (basename($res[1]) == "ddtrace") {
$iniFileName = $ini;
}
}
}
}
Expand Down

0 comments on commit 5c01a63

Please sign in to comment.