2

I'm trying to find how to get the latest version release -number- of Drupal, not actually download it. I appreciate that I can read the contents of the ftp projects page then selectively pick out latest, but I wondered if there was an easier way of doing it.

The reason I'm looking is for an external (non-drupal) page I'm writing that gives current versions of the server's current drupal installations, and whether they're up to date or need to be upgraded - that's why I don't want to actually do a wget of the tarball.

  • I wonder how drush is getting its update information. Maybe scanning its source code might be worth for your issue. – Wtower Oct 16 '14 at 14:12
3

For Drupal 7, fetch the XML at https://www.drupal.org/node/3060/release/feed?api_version[0]=103 to get the release history. The first item's title contains the latest version.

<?xml version="1.0" encoding="utf-8" ?>
<rss version="2.0" xml:base="https://www.drupal.org/node/3060/release?
    api_version[103]=103" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>Releases for Drupal core</title>
    <link>https://www.drupal.org/node/3060/release?api_version[103]=103</link>
    <description></description>
    <language>en</language>
      <item>
    <title>drupal 7.32</title>
    <link>https://www.drupal.org/drupal-7.32-release-notes</link>
    <description>...

If you want information for all major versions (including 8 and 9), you may simply use https://www.drupal.org/node/3060/release/feed. You are then required to go through the items until yo find a release for the major version you are looking for.

2

You can get a list of the most recent releases of Drupal or any contrib project with the Drush command pm-releases.

$ drush pm-releases drupal
 Project  Release  Date         Status                           
 drupal   7.x-dev  2014-Oct-15  Development                      
 drupal   7.32     2014-Oct-15  Supported, Recommended, Security

If you want to see just the version numbers:

$ drush pm-releases drupal --fields=Release --field-labels=0
 7.x-dev 
 7.32    

Regrettably, this command is missing an option to remove the dev release. This is an oversight that we should add to Drush.

Postscript:

You might also want to try running the command drush pm-updatestatus, perhaps with the --security-only flag, and compare against your requirements.

0

In /includes/bootstrap.inc you have access to;

define('VERSION', '7.32');

Is this what you're looking for?

  • This will give you YOUR version installed on YOUR machine. I think OP wants to retrieve the version number of the latest release available on d.o – Paul Oct 16 '14 at 14:09
  • I believe the OP is asking for the latest Drupal version in drupal.org, not the current drupal version of the site. – Wtower Oct 16 '14 at 14:10
  • 1
    I really didn't read that properly... – Pobtastic Oct 16 '14 at 15:52

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.