version and git helper improvements (#14412)

* Fix up version and git helpers
Improve method names
Move all git calls into the git helper
Allow runtime and external cache of results where appropriate
Consolidate version headers for discovery, poller, and validate

* Style fixes

* improve consistency in git calls

* fix style

* don't send name inconsistently

* Improve database versions

* No need to cache Version it is not used more than once currently.
This commit is contained in:
Tony Murray
2022-10-02 00:41:56 -05:00
committed by GitHub
parent 964a67289a
commit e4451714e2
20 changed files with 441 additions and 337 deletions

View File

@@ -64,19 +64,7 @@ if (isset($options['i']) && $options['i'] && isset($options['n'])) {
}
if (Debug::set(isset($options['d']), false) || isset($options['v'])) {
$versions = version_info();
echo <<<EOH
===================================
Version info:
Commit SHA: {$versions['local_sha']}
Commit Date: {$versions['local_date']}
DB Schema: {$versions['db_schema']}
PHP: {$versions['php_ver']}
Database: {$versions['database_ver']}
RRDTool: {$versions['rrdtool_ver']}
SNMP: {$versions['netsnmp_ver']}
==================================
EOH;
echo \LibreNMS\Util\Version::get()->header();
echo "DEBUG!\n";
Debug::setVerbose(isset($options['v']));