From feb90bf3ad23131dc2d12fbd4ad74d654a033992 Mon Sep 17 00:00:00 2001 From: AzaleeX Date: Mon, 28 Oct 2024 10:44:56 +0100 Subject: [PATCH] Release 1.0.0 test --- src/VersionInfo.php | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/src/VersionInfo.php b/src/VersionInfo.php index ab474a28778..56c595368d6 100644 --- a/src/VersionInfo.php +++ b/src/VersionInfo.php @@ -106,6 +106,18 @@ public static function VERSION() : VersionString{ } public static function BUILD_DATE() : int { - return time(); + static $buildDate = null; + if ($buildDate === null) { + $buildDate = time(); + if (\Phar::running(true) !== "") { + $pharPath = \Phar::running(false); + $phar = \Phar::isValidPharFilename($pharPath) ? new \Phar($pharPath) : new \PharData($pharPath); + $meta = $phar->getMetadata(); + if (isset($meta["date"])) { + $buildDate = $meta["date"]; + } + } + } + return $buildDate; } }