function make_projects

8.0.x make.drush.inc make_projects($recursion, $contrib_destination, $info, $build_path, $make_dir)
6.x make.drush.inc make_projects($recursion, $contrib_destination, $info, $build_path, $make_dir)
7.x make.drush.inc make_projects($recursion, $contrib_destination, $info, $build_path, $make_dir)
5.x make.drush.inc make_projects($recursion, $contrib_destination, $info, $build_path)
master make.drush.inc make_projects($recursion, $contrib_destination, $info, $build_path, $make_dir)

Process all projects specified in the make file.

2 calls to make_projects()
DrushMakeProject::recurse in commands/make/make.project.inc
Recurse to process additional makefiles that may be found during processing.
drush_make in commands/make/make.drush.inc
Drush callback; make based on the makefile.
1 string reference to 'make_projects'
_make_write_project_json in commands/make/make.drush.inc
Writes out project data to temporary files.

File

commands/make/make.drush.inc, line 557
Drush Make commands.

Code

function make_projects($recursion, $contrib_destination, $info, $build_path, $make_dir) {
  $projects = make_prepare_projects($recursion, $info, $contrib_destination, $build_path, $make_dir);
  // Abort if there was an error processing projects.
  if ($projects === FALSE) {
    return FALSE;
  }

  // Core is built in place, rather than using make-process.
  if (!empty($projects['core']) && count($projects['core'])) {
    $project = current($projects['core']);
    $project = DrushMakeProject::getInstance('core', $project);
    $project->make();
  }

  // Process all projects concurrently using make-process.
  if (isset($projects['contrib'])) {
    $concurrency = drush_get_option('concurrency', 1);
    // Generate $concurrency sub-processes to do the actual work.
    $invocations = array();
    $thread = 0;
    foreach ($projects['contrib'] as $project) {
      $thread = ++$thread % $concurrency;
      // Ensure that we've set this sub-process up.
      if (!isset($invocations[$thread])) {
        $invocations[$thread] = array(
          'args' => array(
            make_tmp(),
          ),
          'options' => array(
            'projects' => array(),
          ),
          'site' => array(),
        );
      }
      // Add the project to this sub-process.
      $invocations[$thread]['options']['projects'][] = $project;
      // Add the manifest so recursive downloads do not override projects.
      $invocations[$thread]['options']['manifest'] = array_keys($projects['contrib']);
    }
    if (!empty($invocations)) {
      // Backend options.
      $backend_options = array(
        'concurrency' => $concurrency,
        'method' => 'POST',
      );

      // Store projects in temporary files since passing this much data on the
      // pipe buffer can break on certain systems.
      _make_write_project_json($invocations);

      $common_options = drush_redispatch_get_options();
      // Merge in stdin options since we process makefiles recursively. See http://drupal.org/node/1510180.
      $common_options = array_merge($common_options, drush_get_context('stdin'));
      // Package handler should use 'wget'.
      $common_options['package-handler'] = 'wget';

      // Avoid any prompts from CLI.
      $common_options['yes'] = TRUE;

      // Use cache unless explicitly turned off.
      if (!drush_get_option('no-cache', FALSE)) {
        $common_options['cache'] = TRUE;
      }
      // Unless --verbose or --debug are passed, quiter backend output.
      if (empty($common_options['verbose']) && empty($common_options['debug'])) {
        $backend_options['#output-label'] = FALSE;
        $backend_options['integrate'] = TRUE;
      }
      $results = drush_backend_invoke_concurrent($invocations, $common_options, $backend_options, 'make-process', '@none');
      if (count($results['error_log'])) {
        return FALSE;
      }
    }
  }
  return TRUE;
}