Last updated 18 July 2012. Created on 19 December 2008.
Edited by hejazee, quicksketch, clemens.tolboom, rsvelko. Log in to edit this page.

The Drush Module Manager module (drush_mm) is a Drush module addon which allows you to:

* enable or disable modules from the UNIX command line
* list all enabled or disabled modules on your site
* generate a dot file of your modules (for processing with graphviz - easily convertible to a PNG image of all you modules with the dependency graph)

Examples:

( we assume you have an installed Drupal with drush and drush_mm enabled and access to a UNIX shell and you are in the Drupal main dir )

( use drush help in the shell to remind you of options )


$ drush mm list

missing: privatemsg simpletest sms

enabled: admin_menu adminrole ... views views_ui

disabled: blogapi book charts ...

So you can copy the space-separated list of modules and give it to a "enable" or "disable" command.


$ drush mm enable blogapi book charts

With a :


$ drush mm disable blogapi book charts

you disable those back ...


NOTE!:
If you are going to do a Drupal core update, and you issue a "drush mm list" command you will get a list of ALL enabled modules and will have to get out of it the core modules ...
So I made a BASH script for this and attached it below - drlist_contribs.sh_.txt . It gives you only enabled contribs! And you can copy the output to "drush mm disable" ! And after that, you would run "drush mm enable"! Voilla!

The last command is "dot":


$  drush mm dot >backup/site1.dot # ( the backup dir is created by drush after the 1st module update - there it stores old versions of modules - and it makes sense to put your dot files there too. We assume that you have a multisite and site1 needs its modules dumped to a list ...  )
...
  "tracker" [ style=filled, color=green ];
  "tracker" -> "comment"
  "translation" [ style=filled, color=green ];
  "translation" -> "locale"
  "trigger" [ style=filled, color=green ];
  "trigger"
  "update" [ style=filled, color=green ];
  "update"
...

This is meta text with all dependencies and enabled (green), disabled (yellow). To get a png file just:


$ sudo apt-get install graphviz # ( install graphviz on debian-based linux - this may differ on your distro )
$ man dot # ( the manual of the dot viewer )

$ cd backup/
$ dot -Tpng -o site1.png site1.dot      # for a top down graph - a very wide image

or 

$ neato -T png -Goverlap=false -o site1.neato.png site1.dot   # with non overlapping nodes - both quite wide and high image

So now we have a dot image file with all our modules with all in it except the versions.

AttachmentSize
site.png35.12 KB
drlist_contribs.sh_.txt901 bytes

Looking for support? Visit the Drupal.org forums, or join #drupal-support in IRC.

Comments

poka_dan’s picture

If you are an experienced Drupal developer and you already know what modules you want installed for your project you may want to use: www.drupalmashup.interestsphere.com

Excerpt from the site:

"This site comes to the aid of experienced Drupal developers who have discovered that they rely on much the same collection of modules for a particular type of site. Once you've mashed up your collection you can view the generated drush commands and/or download the (UNIX shell) script."

reed.richards’s picture

Copy the files into the to a .drush folder in your HOME folder, or to /path/to/drush/commands (not a Smart Thing, but it would work).