function _drush_site_install6_stage

8.0.x site_install_6.inc _drush_site_install6_stage($profile, $cli_cookie, $initial_op)
6.x site_install_6.inc _drush_site_install6_stage($profile, $cli_cookie, $initial_op)
7.x site_install_6.inc _drush_site_install6_stage($profile, $cli_cookie, $initial_op)
4.x site_install_6.inc _drush_site_install6_stage($profile, $cli_cookie, $initial_op)
5.x site_install_6.inc _drush_site_install6_stage($profile, $cli_cookie, $initial_op)

Submit a given op to install.php; if a meta "Refresh" tag is returned in the result, then submit that op as well.

1 call to _drush_site_install6_stage()
drush_core_site_install_version in commands/core/drupal/site_install_6.inc
Install Drupal 6.x

File

commands/core/drupal/site_install_6.inc, line 81

Code

function _drush_site_install6_stage($profile, $cli_cookie, $initial_op) {
  $drupal_root = drush_get_context('DRUSH_DRUPAL_ROOT');
  // Remember the install task at the start of the stage
  $install_task = _drush_site_install6_install_task();
  $op = $initial_op;
  while (!empty($op)) {
    $phpcode = _drush_site_install6_cookies($profile, $cli_cookie) . ' $_GET["op"]="' . $op . '"; include("' . $drupal_root . '/install.php");';
    drush_shell_exec('php -r %s', $phpcode);
    $output = implode("\n", drush_shell_exec_output());
    // Check for a "Refresh" back to the do_nojs op; e.g.:
    //   <meta http-equiv="Refresh" content="0; URL=http://default/install.php?locale=en&profile=wk_profile6&id=1&op=do_nojs">
    // If this pattern is NOT found, then go on to the "finished" step.
    $matches = array();
    $match_result = preg_match('/http-equiv="Refresh".*op=([a-zA-Z0-9_]*)/', $output, $matches);
    if ($match_result) {
      $op = $matches[];
    }
    else {
      $op = '';
    }
  }
  if (($install_task == _drush_site_install6_install_task()) && ($initial_op != "finished")) {
    return drush_set_error('DRUSH_SITE_INSTALL_FAILED', dt("The site install task '!task' failed.", array('!task' => $install_task)));
  }
  return TRUE;
}