Skip to content

Instantly share code, notes, and snippets.

@rfay
Created February 16, 2011 01:45
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save rfay/828693 to your computer and use it in GitHub Desktop.
Save rfay/828693 to your computer and use it in GitHub Desktop.
// Attempt to determine the Drupal core API version.
$api = array();
foreach ($branch->taxonomy as $tid => $term) {
if (in_array($tid, $api_versions)) {
$api['version'] = array_shift(explode('.', $term->name, 2));
$api['tid'] = $term->tid;
break;
}
}
// If the API version not found then ignore this branch.
if (empty($api)) {
watchdog('pift', 'Project release node [@nid] does not have a Drupal core API taxonomy term.', array('@nid' => $branch->nid), WATCHDOG_ERROR);
continue;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment