From 749d3cb5e708a14acac8c1bcf95cec833a851232 Mon Sep 17 00:00:00 2001 From: dg9vh Date: Sat, 14 May 2016 21:46:13 +0000 Subject: [PATCH 1/3] Test of version output for modified MMDVMHost by G0WFV --- include/functions.php | 9 ++++++++- index.php | 2 +- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/include/functions.php b/include/functions.php index 0df532b..2e76e7c 100644 --- a/include/functions.php +++ b/include/functions.php @@ -1,10 +1,17 @@ &1", $output); + return substr($output[1],10,8)." (compiled ".getMMDVMHostFileVersion().")"; +} + +function getMMDVMHostFileVersion() { // returns creation-time of MMDVMHost as version-number $filename = MMDVMHOSTPATH . "MMDVMHost"; if (file_exists($filename)) { - return date("Y-m-d", filectime($filename)); + return date("d M y", filectime($filename)); } } diff --git a/index.php b/index.php index cf3cc53..b422412 100644 --- a/index.php +++ b/index.php @@ -33,7 +33,7 @@ include "include/functions.php"; echo "Hotspot"; } ?>: -

MMDVMHost v by G4KLX

+

MMDVMHost by G4KLX Version:

Date: Sun, 15 May 2016 18:05:52 +0300 Subject: [PATCH 2/3] Change version output to work with -v command line argument (#12) Pull Request #70 on MMDVMHost To be honest, thinking about it, I don't think you need the 2>&1 now as I coded the version output to be printed to STDERR - one for you to test ;-) --- include/functions.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/include/functions.php b/include/functions.php index 2e76e7c..4e6d75b 100644 --- a/include/functions.php +++ b/include/functions.php @@ -3,8 +3,8 @@ function getMMDVMHostVersion() { // returns creation-time of MMDVMHost as version-number $filename = MMDVMHOSTPATH . "MMDVMHost"; - exec($filename." 2>&1", $output); - return substr($output[1],10,8)." (compiled ".getMMDVMHostFileVersion().")"; + exec($filename." -v 2>&1", $output); + return substr($output[0],18,8)." (compiled ".getMMDVMHostFileVersion().")"; } function getMMDVMHostFileVersion() { @@ -400,4 +400,4 @@ function getActualReflector($logLines, $mode) { $mmdvmconfigs = getMMDVMConfig(); $logLines = getLog(); $lastHeard = getLastHeard($logLines); -?> \ No newline at end of file +?> From b63154b7ed983d08c5885074958f36b4b442e3a2 Mon Sep 17 00:00:00 2001 From: dg9vh Date: Sun, 15 May 2016 18:45:23 +0000 Subject: [PATCH 3/3] better version-info of MMDVMHost since MMDVMHost-build 20160515. --- include/functions.php | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/include/functions.php b/include/functions.php index 4e6d75b..17bfaa4 100644 --- a/include/functions.php +++ b/include/functions.php @@ -4,7 +4,11 @@ function getMMDVMHostVersion() { // returns creation-time of MMDVMHost as version-number $filename = MMDVMHOSTPATH . "MMDVMHost"; exec($filename." -v 2>&1", $output); - return substr($output[0],18,8)." (compiled ".getMMDVMHostFileVersion().")"; + if (substr($output[0],18,8) == ".ini fil") { + return getMMDVMHostFileVersion(); + } else { + return substr($output[0],18,8)." (compiled ".getMMDVMHostFileVersion().")"; + } } function getMMDVMHostFileVersion() {