Master


"May your modules be with you!"

Yoda,
what is your
Problem?

Luke

Leia,
I can't upload an image on that site.
I do see nothing for that!

Leia

Hey Luke,
you have to enable
the tatooine_media feature!

Chewbacca

Awww,
rooarrr,
awwww!

Han Solo

Yeah, Chewy!!
That happened to me, too.
You forgot to uninstall jquery_update.

Young padawan,

a solution, we have!

Main aspects

  • Know what modules have to be enabled to provide the full functionality in your project.
  • Uninstall modules you do not need. They could be reasons for unforeseen side-effects.

Module whitelist

Define the modules you need.

Example:

  • tatooine_base
  • tatooine_news
  • tatooine_media
Notice:
all dependencies are automatically part of that whitelist.

Actual vs. target

Compare actual module list with intended one.

Example:

actualtarget
tatooine_base (user, node) tatooine_base (user, node)
tatooine_news (field, text) tatooine_news (field, text)
comment
field tatooine_media (field, image)

Ensure target status

Modules have to be enabled, disabled or uninstalled to fit the intended state.

Example:

currentaction
tatooine_base (user, node) -
tatooine_news (field, text) -
commentdisable and uninstall comment
field enable image and tatooine_media

Master commands

And those are the commands (for drush).

drush master-status

Shows the current state and modules that shall be enabled or disabled.

drush master-ensure-modules

Enables, disables and uninstalls modules.

Demo

Multiple environments,
we have!

Padme

Anakin,
you only should have enabled that tatooine_dev feature on your local machine!

Obi-Wan

C3PO, you have to enable stage_file_proxy on your stage. This way you get the files from live.

Configuration per Scope


// Master module settings.
$conf['master_modules'] = array(
  'tatooine_base',
  'tatooine_news',
  // [...]
  'tatooine_analytics',
  'tatooine_i18n',
);
$conf['master_modules:local'] = array(
  'stage_file_proxy', 'maillog', 'devel', 'views_ui', 'module_filter',
);
$conf['master_modules:stage'] = array(
  'stage_file_proxy', 'maillog',
);
$conf['master_modules:live'] = array();
        

Using scopes


          drush master-status --scope=local
          drush master-ensure-modules --scope=local
        

Demo