function _drush_pm_generate_info_ini_metadata

8.0.x pm.drush.inc _drush_pm_generate_info_ini_metadata($version, $project_name, $datestamp)
7.x pm.drush.inc _drush_pm_generate_info_ini_metadata($version, $project_name, $datestamp)
master pm.drush.inc _drush_pm_generate_info_ini_metadata($version, $project_name, $datestamp)

Generate version information for `.info` files in ini format.

Taken with some modifications from: http://drupalcode.org/project/drupalorg.git/blob/refs/heads/6.x-3.x:/dru...

1 call to _drush_pm_generate_info_ini_metadata()
drush_pm_inject_info_file_metadata in commands/pm/pm.drush.inc
Inject metadata into all .info files for a given project.

File

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

Code

function _drush_pm_generate_info_ini_metadata($version, $project_name, $datestamp) {
  $matches = array();
  $extra = '';
  if (preg_match('/^((\d+)\.x)-.*/', $version, $matches) && $matches[2] >= 6) {
    $extra .= "\ncore = \"$matches[1]\"";
  }
  if (!drush_get_option('no-gitprojectinfo', FALSE)) {
    $extra = "\nproject = \"$project_name\"";
  }
  $date = date('Y-m-d', $datestamp);
  $info = <<<METADATA

; Information added by drush on {$date}
version = "{$version}"{$extra}
datestamp = "{$datestamp}"
METADATA;
  return $info;
}