Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add dynamic build date using time() function in VersionInfo #6473

Open
wants to merge 6 commits into
base: stable
Choose a base branch
from

Conversation

AzaleeX
Copy link

@AzaleeX AzaleeX commented Oct 25, 2024

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.

  • remove from Todos list

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.
@jasonw4331
Copy link
Contributor

jasonw4331 commented Oct 25, 2024

The server isn't built during runtime. It's built during build time. Please ensure the build time is accurate to a time generated during the build step rather than when the server is ran.

@jasonw4331 jasonw4331 added Category: Core Related to internal functionality Status: Waiting on Author Easy task Probably really easy to do, good task for first-time contributors labels Oct 25, 2024
@@ -103,4 +104,8 @@ public static function VERSION() : VersionString{
}
return self::$fullVersion;
}

public static function BUILD_DATE() : int {
return time();
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's supposed to be the time the phar was built, not the time the function was called.
This isn't as simple as just adding an extra function.

$pharPath = \Phar::running(false);
$phar = \Phar::isValidPharFilename($pharPath) ? new \Phar($pharPath) : new \PharData($pharPath);
$meta = $phar->getMetadata();
if (isset($meta["date"])) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This isn't going to magically appear in the phar metadata

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Category: Core Related to internal functionality Easy task Probably really easy to do, good task for first-time contributors Status: Waiting on Author
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants