Update module the next generation

Submitted by Anonymous (not verified) on Wed, 02/09/2015 - 13:48

<p>In a post last week I discussed <a href="http://tim.millwoodonline.co.uk/post/127563720855/versioning-in-drupal&…; target="_blank">versioning in Drupal</a> and briefly touched on version numbers in info files. A lot of my focus over the last few months has been around composer and Drupal, one issue for Drupal when using composer for contrib modules is that the info file is pulled from git and therefore doesn’t have the version number, project name or datestamp in the info.yml file that is added by the drupal.org packager.</p><!-- more --><p>I am <a href="https://www.drupal.org/node/2559313&quot; target="_blank">currently working on a patch</a> for the update module which will get the project name from the module’s composer.json. This is just the first step because the project name is what’s needed for the module to show on the update status page.</p><p>The patch adds a composer parser service, which like the info parser service that parses the info.yml file of a module, this parses the composer.json file of a module. From here we can get the project name such as “drupal/devel”, then by exploding that we can get the project name from the second element in the array.</p><p>Composer.json files sometimes include a version number so we could use that too, but this is vary rare. The only real option for the version number is the git branch or git tag, this is how the <a href="https://www.drupal.org/project/git_deploy&quot; target="_blank">git deploy module</a> works.</p>

Add new comment