Calling all Drupal developers!
Help us get this on the first page of Digg. DIGG NOW!
Help us get this on the first page of Digg. DIGG NOW!
drush_pm_get_project_path($projects)
contributions/drush/drush_pm/drush_pm.module, line 448
We need to set the project path by looking at the module location. Ideally, update.module would do this for us.
<?php
function drush_pm_get_project_path($projects) {
foreach ($projects as $project => $info) {
if (!isset($info['path']) && $project != 'drupal') {
// looks for an enabled module.
foreach ($info['includes'] as $module => $name) {
if ($path = drupal_get_path('module', $module)) {
continue;
}
}
// As some modules are not located in their project's root directory
// but in a subdirectory (e.g. all the ecommerce modules), we take the module's
// info file's path, and then move up until we are at a directory with the
// project's name.
$parts = explode('/', $path);
$i = count($parts) - 1;
$stop = array_search($project, $parts);
while ($i > $stop) {
unset($parts[$i]);
$i--;
}
$projects[$project]['path'] = implode('/', $parts);
}
}
return $projects;
}
?>