Skip to content

Commit 40fde89

Browse files
lavaroumfulb
andcommitted
use 'pretty' version for package version
'pretty' (without `'v'` prefix) is what `composer show` outputs so have the agent report that as package version. -- Co-authored-by: Michael Fulbright <[email protected]>
1 parent 97e8332 commit 40fde89

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

agent/lib_composer.c

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,11 @@ static void nr_execute_handle_autoload_composer_get_packages_information(
110110
= ""
111111
"(function() {"
112112
" try {"
113-
" return \\Composer\\InstalledVersions::getVersion(\"%s\");"
113+
" $v = \\Composer\\InstalledVersions::getPrettyVersion(\"%s\");"
114+
" if ($v != null && strlen($v) > 0) {"
115+
" $v = ltrim($v, 'v');"
116+
" }"
117+
" return $v;"
114118
" } catch (Exception $e) {"
115119
" return NULL;"
116120
" }"

0 commit comments

Comments
 (0)