From 50a02a0fc51e64a1604a8c6a042025b692935cc0 Mon Sep 17 00:00:00 2001 From: deutor Date: Wed, 7 Sep 2016 08:33:24 +0200 Subject: [PATCH] refactor: IRC bot .version response (#4355) * IRCbot more verbose .version response * Using local_sha instead of git call * Corrected substr starting position --- LibreNMS/IRCBot.php | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/LibreNMS/IRCBot.php b/LibreNMS/IRCBot.php index 1d5959c1f9..237028d686 100644 --- a/LibreNMS/IRCBot.php +++ b/LibreNMS/IRCBot.php @@ -569,7 +569,12 @@ class IRCBot private function _version($params) { - return $this->respond($this->config['project_name_version'].', PHP: '.PHP_VERSION); + $versions = version_info(false); + $schema_version = $versions['db_schema']; + $version = substr($versions['local_sha'], 0, 7); + + $msg = $this->config['project_name_version'].', Version: '.$version.', DB schema: #'.$schema_version.', PHP: '.PHP_VERSION; + return $this->respond($msg); }//end _version()