function _pm_parse_version_compound

8.0.x pm.drush.inc _pm_parse_version_compound($parts)
7.x pm.drush.inc _pm_parse_version_compound($parts)
master pm.drush.inc _pm_parse_version_compound($parts)

Build a version string from an array of major, minor and extra parts.

Parameters

array $parts: Array of parts.

Return value

string A Version string.

See also

_pm_parse_version_decompound()

pm_parse_version()

1 call to _pm_parse_version_compound()
pm_parse_version in commands/pm/pm.drush.inc
Parses a version string and returns its components.

File

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

Code

function _pm_parse_version_compound($parts) {
  $project_version = '';
  if ($parts['patch'] != '') {
    $project_version = $parts['major'];
    if ($parts['minor'] != '') {
      $project_version = $project_version . '.' . $parts['minor'];
    }
    if ($parts['patch'] == 'x') {
      $project_version = $project_version . '.x-dev';
    }
    else {
      $project_version = $project_version . '.' . $parts['patch'];
      if ($parts['extra'] != '') {
        $project_version = $project_version . '-' . $parts['extra'];
      }
    }
    if ($parts['offset'] != '') {
      $project_version = $project_version . '+' . $parts['offset'] . '-dev';
    }
  }

  return $project_version;
}