You need PHP installed with HTTPS file_get_contents()
feature enabled in php.ini
.
Make a new file named azure.php
and copy the PHP code below to the file:
<?php
const BUILDS_REST_API = "https://dev.azure.com/pocketmine/PHP-Builds/_apis/build/builds?api-version=6.0&branchName=refs/heads/stable";
if (count($argv) < 2) {
echo "Operating system argument is required!";
exit(1);
} elseif (!in_array($argv[1], ["Windows", "Linux", "Mac"])) {
echo "Unknown operating system!";
exit(1);
}
$runs = json_decode(file_get_contents(BUILDS_REST_API), true);
$buildId = $runs["value"]["0"]["id"];
echo "https://dev.azure.com/pocketmine/a29511ba-1771-4ad2-a606-23c00a4b8b92/_apis/build/builds/" . $buildId . "/artifacts?artifactName=" . $argv[1] . "&api-version=4.1&%24format=zip";
Run the following commands to get the URL of the latest PocketMine-MP 4 PHP binary (Case sensitive!):
Windows:
$ php azure.php Windows
Linux:
$ php azure.php Linux
Mac OS:
$ php azure.php Mac
It will print the URL in your terminal, or to a file or program if you use shell commands to process the output.