Add hidden feature to pack.php to return version info as JSON

This will be useful for a development version badge.
This commit is contained in:
Starbeamrainbowlabs 2019-08-28 23:55:45 +01:00
parent d19c8712db
commit 53dd5e3d70
Signed by: sbrl
GPG Key ID: 1BE5172E637709C2
1 changed files with 8 additions and 0 deletions

View File

@ -1,5 +1,13 @@
<?php
if(isset($_GET["determine-latest-version"])) {
header("content-type: application/json");
exit(json_encode([
"latest_version" => trim(file_get_contents("https://raw.githubusercontent.com/sbrl/Pepperminty-Wiki/master/version")),
"local_version" => trim(file_get_contents("version"))
]));
}
/**
* Logs a string to stdout, but only on the CLI.
* @param string $line The line to log.