function _drush_make_generate_lines

8.0.x generate.contents.make.inc _drush_make_generate_lines($base, $values)
7.x generate.contents.make.inc _drush_make_generate_lines($base, $values)
master generate.contents.make.inc _drush_make_generate_lines($base, $values)

Utility function to generate the line or lines for a key/value pair in the make file.

Parameters

$base: The base for the configuration lines. Values will be appended to it as [$key] = $value, or if value is an array itself it will expand into as many lines as required.

$values: May be a single value or an array.

Return value

An array of strings that represent lines for the make file.

2 calls to _drush_make_generate_lines()

File

commands/make/generate.contents.make.inc, line 266
Functions for the generate makefile command.

Code

function _drush_make_generate_lines($base, $values) {
  $output = array();

  if (is_array($values)) {
    foreach ($values as $key => $value) {
      $newbase = $base . '[' . $key . ']';
      $output = array_merge($output, _drush_make_generate_lines($newbase, $value));
    }
  }
  else {
    $output[$base] = '"' . $values . '"';
  }

  return $output;
}