Last active
February 22, 2017 14:23
-
-
Save astrolox/bd40d66bb900dbd87f2e6723632a6278 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/php | |
<?php | |
$xml = simplexml_load_file('https://updates.drupal.org/release-history/drupal/8.x'); | |
$latest = null; | |
foreach($xml->releases->release as $release) { | |
if ($release->status != 'published') { | |
continue; | |
} | |
if (property_exists($release, 'version_extra') && $release->version_extra != '') { | |
continue; | |
} | |
if (!isset($latest) || $release->date > $latest->date) { | |
$latest = $release; | |
} | |
} | |
if (isset($latest) && property_exists($latest, 'download_link')) { | |
echo $latest->download_link ."\n"; | |
} else { | |
error_log("ERROR: Drupal latest release download link not found"); | |
exit(999); | |
} |
Author
astrolox
commented
Feb 22, 2017
•
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment