From c05cc0c23ada2c0874999924ab1fe88f7dbe9951 Mon Sep 17 00:00:00 2001 From: Christopher Vagnetoft Date: Sat, 17 Jan 2026 18:08:55 +0100 Subject: [PATCH] Show built version in phar --- bin/ntfid | 8 ++++++++ src/NtfiDaemon.php | 2 ++ 2 files changed, 10 insertions(+) diff --git a/bin/ntfid b/bin/ntfid index 7194212..d7ba4e7 100755 --- a/bin/ntfid +++ b/bin/ntfid @@ -21,6 +21,14 @@ $logger = new class extends AbstractLogger } }; + +if (file_exists(__DIR__."/../src/build.php")) { + $build = include(__DIR__."/../src/build.php"); + define("APP_VERSION", $build['version']); +} else { + define("APP_VERSION", "Dev"); +} + $daemon = (new NoccyLabs\Ntfi\NtfiDaemon()) ->setLogger($logger) ->setConfigFile($configFile) diff --git a/src/NtfiDaemon.php b/src/NtfiDaemon.php index abf4e37..7db1304 100644 --- a/src/NtfiDaemon.php +++ b/src/NtfiDaemon.php @@ -92,6 +92,8 @@ class NtfiDaemon { $config = $this->readConfig(); + $this->logger->info("Starting up Ntfi Daemon v".APP_VERSION); + $this->servers = $config['servers']; $this->logger->debug("Configured servers:"); foreach ($this->servers as $server => $info) {