You are here

function _hosting_migrate_get_target_profile_name in Hostmaster (Aegir) 6

2 calls to _hosting_migrate_get_target_profile_name()
drush_hosting_clone_pre_hosting_task in modules/hosting/clone/hosting_clone.drush.inc
@file Drush include for the site cloning module.
drush_hosting_migrate_pre_hosting_task in modules/hosting/migrate/hosting_migrate.drush.inc
@file Implement drush hooks for the hosting migrate module.

File

modules/hosting/migrate/hosting_migrate.drush.inc, line 34
Implement drush hooks for the hosting migrate module.

Code

function _hosting_migrate_get_target_profile_name($task) {

  // load the original install profile
  $profile = node_load($task->ref->profile);

  // get the profile instance we are migrating to.
  $profile_instance = hosting_package_instance_load(array(
    'i.rid' => $task->task_args['target_platform'],
    'p.short_name' => $profile->short_name,
  ));
  if (!sizeof($profile_instance)) {

    // get a possible upgrade path for the profile.
    $profile_instance = hosting_package_instance_load(array(
      'i.rid' => $task->task_args['target_platform'],
      'p.old_short_name' => $profile->short_name,
    ));
  }
  return $profile_instance;
}