Skip to content

Commit

Permalink
Add dynamic build date using time() function in VersionInfo
Browse files Browse the repository at this point in the history
This update introduces a dynamic build date in the VersionInfo class using the time() function, allowing the build date to be set at runtime. This change ensures that the build date is always current without needing manual updates.
  • Loading branch information
AzaleeX committed Oct 25, 2024
1 parent f1b1a70 commit 67e22b7
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
2 changes: 1 addition & 1 deletion build/generate-build-info-json.php
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@
"channel" => VersionInfo::BUILD_CHANNEL,
"git_commit" => $argv[1],
"mcpe_version" => ProtocolInfo::MINECRAFT_VERSION_NETWORK,
"date" => time(), //TODO: maybe we should embed this in VersionInfo?
"date" => VersionInfo::BUILD_DATE(),
"details_url" => "https://github.com/$argv[3]/releases/tag/$argv[2]",
"download_url" => "https://github.com/$argv[3]/releases/download/$argv[2]/PocketMine-MP.phar",
"source_url" => "https://github.com/$argv[3]/tree/$argv[2]",
Expand Down
4 changes: 4 additions & 0 deletions src/VersionInfo.php
Original file line number Diff line number Diff line change
Expand Up @@ -103,4 +103,8 @@ public static function VERSION() : VersionString{
}
return self::$fullVersion;
}

public static function BUILD_DATE() : int {
return time();
}
}

0 comments on commit 67e22b7

Please sign in to comment.