function _pm_get_project_path

4.x pm.drush.inc _pm_get_project_path($data, $lookup)

Completes projects' update data with the path to install location on disk.

Given an array of release info for available projects, find the path to the install location.

3 calls to _pm_get_project_path()
_pm_get_update_info in commands/pm/update_info/drupal.inc
Get update information for all installed projects.
_pm_get_update_info in commands/pm/update_info/drupal_6.inc
Get update information for all installed projects.
_pm_get_update_info in commands/pm/update_info/drupal_5.inc
Get update information for all installed projects.

File

commands/pm/pm.drush.inc, line 1101
The drush Project Manager

Code

function _pm_get_project_path($data, $lookup) {
  foreach ($data as $name => $release) {
    if ($name == 'drupal') {
      continue;
    }
    // Array of extensions (modules/themes) within the project.
    $extensions = array_keys($release[$lookup]);
    $path = _pm_find_common_path($release['project_type'], $extensions);
    $reserved = array('modules', 'sites', 'themes');
    if ((in_array(basename($path), $reserved)) && (!in_array($name, $reserved))) {
      drush_log(dt('Error while trying to find the common path for enabled extensions of project !project. Extensions are: !extensions.', array('!project' => $name, '!extensions' => implode(', ', $extensions))), 'error');
      unset($data[$name]);
    }
    else {
      $data[$name]['path'] = $path;
    }
  }

  return $data;
}