You are here

function drush_composer_manager_write_if_changed in Composer Manager 7

Same name and namespace in other branches
  1. 6.2 composer_manager.drush.inc \drush_composer_manager_write_if_changed()
  2. 6 composer_manager.drush.inc \drush_composer_manager_write_if_changed()
  3. 7.2 composer_manager.drush.inc \drush_composer_manager_write_if_changed()

If one or more extensions being acted on contain a composer.json file, prompt the user to automatically run Composer's update command.

See also

composer_manager_write_if_changed()

drush_composer_manager_post_pm_enable()

drush_composer_manager_post_pm_disable()

2 calls to drush_composer_manager_write_if_changed()
drush_composer_manager_post_pm_disable in ./composer_manager.drush.inc
Drush hook; Called after a project is disabled.
drush_composer_manager_post_pm_enable in ./composer_manager.drush.inc
Drush hook; Called after a project is enabled.

File

./composer_manager.drush.inc, line 148
Drush hook implementations for the Composer Manager module.

Code

function drush_composer_manager_write_if_changed() {
  $changed =& drupal_static('composer_manager_write_if_changed', FALSE);
  if (variable_get('composer_manager_autobuild_packages', 1) && $changed) {
    drush_print('One or more extensions have dependencies managed by Composer.');
    if (drush_confirm(dt('Update packages managed by Composer?'))) {
      drush_composer_manager('update');
    }
  }
}