PHPackages                             liip/drushversionmanagercommand - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. liip/drushversionmanagercommand

ActiveDrupal-drush

liip/drushversionmanagercommand
===============================

This module provides a drush command to maintain module versions.

151PHP

Since Jun 1Pushed 12y ago61 watchersCompare

[ Source](https://github.com/liip/LiipDrushVersionManagerCommand)[ Packagist](https://packagist.org/packages/liip/drushversionmanagercommand)[ RSS](/packages/liip-drushversionmanagercommand/feed)WikiDiscussions master Synced 1mo ago

READMEChangelogDependenciesVersions (3)Used By (0)

LiipDrushVersionManagerCommand
==============================

[](#liipdrushversionmanagercommand)

Purpose
-------

[](#purpose)

This drush extension implementes commands to check for new versions of installed modules and update them without issuing *drush dis module &amp;&amp; drush pm-uninstall module*. On update it uses a custom hook called `hook_vm_update()`. With this the module can decide if there is something to do on update. And return true on success or false on failure. It has the advantage that the `hook_install()` and `hook_uninstall()` is not issued. (E.g. loosing all data if the `hook_uninstall()` cleans a table in the database.

Travis build status
-------------------

[](#travis-build-status)

[![Build Status](https://camo.githubusercontent.com/85413ef8c652b2cf0f39984bc0100f19f46962792fab7ae58fc94f45de754bd1/68747470733a2f2f7472617669732d63692e6f72672f6c6969702f4c696970447275736856657273696f6e4d616e61676572436f6d6d616e642e706e673f6272616e63683d6d6173746572)](https://travis-ci.org/liip/LiipDrushVersionManagerCommand)

Obtain sources
--------------

[](#obtain-sources)

### Get it from packagist.org

[](#get-it-from-packagistorg)

To obtain the sources via composer add the following lines to your composer.json file or complete the list of dependencies.

```
"require": {
    "liip/drushversionmanagercommand": "1.*"
}
...
"extra": {
    "installer-paths": {
        "path/2/drush/commands/{$name}/": [
            "liip/drushversionmanagercommand"
        ],
```

Then execute the following commands on the command line:

```
$> curl -s http://getcomposer.org/installer | php
$> php composer.phar install
```

Getting started
---------------

[](#getting-started)

Sources fetched? Brilliant.. now we can start using the module updater. In your *ModuleName.install* file implement the *hook\_vm\_update()*.

```
/**
 * Update script
 *
 * @return bool
 */
function ModuleName_vm_update()
{
    // clean out no longer used variables
    variable_set('ModuleName_some_variable', 'myValue')

    // this update was successful
    return (bool) variable_get('ModuleName_some_variable', false);
}
```

Add a *version* to the *ModuleName.info* file:

```
// ...
version = 1.0
// ...
```

Let composer *post\_install* or *post\_update* handle module updates
--------------------------------------------------------------------

[](#let-composer-post_install-or-post_update-handle-module-updates)

```
#!/bin/bash
DRUSH="drush"

# store version number from installed modules
$DRUSH php-script scripts/invoke_module_update 

# update modules if needed
$DRUSH php-script scripts/update_module_versions
```

Command line examples
---------------------

[](#command-line-examples)

### Get help

[](#get-help)

General usage:

```
$ drush help vm-update
Print information about the specified module(s).

Examples:
 drush versionmanager-update --all   Update every named module to the new version.

Arguments:
 modules                             A comma delimited list of module names
                                     (e.g. module1,module2,module2)

Options:
 --all                               Run the update on all installed and enabled modules where an
                                     update is available.

Aliases: vm-update
```

```
$ drush help vm-info
Print information about the specified module(s).

Examples:
 drush versionmanager-information --all    Display information about any provided module if there
                                           is an update available.

Arguments:
 modules                                   A comma delimited list of module names

Options:
 --all                                     Run the update on all installed and enabled modules
 --full                                    show extended information about the module (this is the default)
 --short                                   show basic information about the module

Aliases: vm-info
```

### Update all modules

[](#update-all-modules)

```
$ drush vm-update --all
Updating ModuleName1 ...                                                                   [success]
Nothing to update for module »ModuleName2«                                                 [warning]
```

### Update a subset of all enabled modules

[](#update-a-subset-of-all-enabled-modules)

```
$ drush vm-update ModuleName1, ModuleName2
Updating ModuleName1 ...                                                                   [success]
Updating ModuleName2 ...                                                                   [success]
```

### Get short list of all modules were an update is available

[](#get-short-list-of-all-modules-were-an-update-is-available)

The neat thing is that you can copy and paste the out put directly to `vm-update` and not using the *--all* switch there. This will make it segnificantly faster.

```
$ drush vm-info --all --short
ModuleName1, ModuleName2, ..., ModuleNameN
```

### Get full information about module updates

[](#get-full-information-about-module-updates)

The *--full* switch is not only optional but also the default if *--short* is not declared. As you'd guess ModuleName2 has no update available.

```
$ drush vm-info --full --all
Title                         :  Title of ModuleName1
Name                          :  ModuleName1
Version                       :  0.1 
Update available to version   :  1.5
 
Title     :  Title of ModuleName2
Name      :  ModuleName2
Version   :  7.x-2.x-dev 
 
...
```

###  Health Score

22

—

LowBetter than 22% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity6

Limited adoption so far

Community16

Small or concentrated contributor base

Maturity44

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 62.1% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

### Community

Maintainers

![](https://www.gravatar.com/avatar/e04d485c2445123bbe8f625a73f21b6b8f66b83c6612b40b4e3953b9f404d0a6?d=identicon)[pjezek](/maintainers/pjezek)

---

Top Contributors

[![pjezek](https://avatars.githubusercontent.com/u/147792?v=4)](https://github.com/pjezek "pjezek (18 commits)")[![lapistano](https://avatars.githubusercontent.com/u/95115?v=4)](https://github.com/lapistano "lapistano (11 commits)")

### Embed Badge

![Health badge](/badges/liip-drushversionmanagercommand/health.svg)

```
[![Health](https://phpackages.com/badges/liip-drushversionmanagercommand/health.svg)](https://phpackages.com/packages/liip-drushversionmanagercommand)
```

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
