Skip to content

Commit

Permalink
use 'pretty' version for package version
Browse files Browse the repository at this point in the history
'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]>
  • Loading branch information
lavarou committed Sep 16, 2024
1 parent 060303e commit 5de8e7f
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion agent/lib_composer.c
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,11 @@ static void nr_execute_handle_autoload_composer_get_packages_information(
= ""
"(function() {"
" try {"
" return \\Composer\\InstalledVersions::getVersion(\"%s\");"
" $v = \\Composer\\InstalledVersions::getPrettyVersion(\"%s\");"
" if ($v != null && strlen($v) > 0) {"
" $v = ltrim($v, 'v');"
" }"
" return $v;"
" } catch (Exception $e) {"
" return NULL;"
" }"
Expand Down

0 comments on commit 5de8e7f

Please sign in to comment.