function updatexml_determine_project_type

6.x updatexml.inc updatexml_determine_project_type($xml)
5.x updatexml.inc updatexml_determine_project_type($xml)

Determine a project type from its update service xml.

2 calls to updatexml_determine_project_type()
release_info_check_project in commands/pm/release_info/updatexml.inc
Check if a project is available in a update service.
release_info_fetch in commands/pm/release_info/updatexml.inc
Obtain the most appropiate release for the requested project.

File

commands/pm/release_info/updatexml.inc, line 587
Drush release info engine for update.drupal.org and compatible services.

Code

function updatexml_determine_project_type($xml) {
  $project_types = array(
    'core' => 'project_core',
    'profile' => 'project_distribution',
    'module' => 'project_module',
    'theme' => 'project_theme',
    'theme engine' => 'project_theme_engine',
    'translation' => 'project_translation',
  );

  $type = (string) $xml->type;
  // Probably unused but kept for possible legacy compat.
  $type = ($type == 'profile-legacy') ? 'profile' : $type;
  $type = array_search($type, $project_types);
  return $type;
}