Skip to content

Commit

Permalink
Added composer version.
Browse files Browse the repository at this point in the history
  • Loading branch information
ch-tm committed Dec 19, 2023
1 parent b919d1a commit 9e8e5cf
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
3 changes: 2 additions & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
"description": "HTTP and console health checks for microservices",
"keywords": ["rest", "yii2", "microservices", "api"],
"type": "package",
"version": "1.0.0",
"license": "MIT",
"autoload": {
"psr-4": {
Expand Down Expand Up @@ -32,4 +33,4 @@
"yiisoft/yii2-composer": true
}
}
}
}
2 changes: 2 additions & 0 deletions src/healthchecks/Module.php
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,8 @@ public function doHealthChecks()
$result[] = $model;
}
}
$package = \Composer\InstalledVersions::getRootPackage();
$result['version'] = $package['pretty_version'] ?? '%VERSION%';
return $result;
}

Expand Down

0 comments on commit 9e8e5cf

Please sign in to comment.