You are here

function hosting_platform_composer_drush_context_import in Aegir Deploy 7.3

Implements hook_drush_context_import().

File

modules/platform_composer/hosting_platform_composer.drush.inc, line 24
Provision hooks to store data in the platform context/alias.

Code

function hosting_platform_composer_drush_context_import($context, &$node) {
  if ($context->type == 'platform') {
    foreach ([
      'composer_project_path',
      'composer_project_package',
      'composer_project_version',
    ] as $option) {
      if (isset($context->{$option}) && !empty($context->{$option})) {
        $field = 'field_' . $option;
        $node->{$field}[$node->language][0]['value'] = $context->{$option};
      }
    }
  }
}