function drush_browse

8.0.x browse.drush.inc drush_browse($path = '')
6.x browse.drush.inc drush_browse($path = '')
7.x browse.drush.inc drush_browse($path = '')

Command callback.

File

commands/core/browse.drush.inc, line 31

Code

function drush_browse($path = '') {
  // Redispatch if called against a remote-host so a browser is started on the
  // the *local* machine.
  $alias = drush_get_context('DRUSH_TARGET_SITE_ALIAS');
  if (drush_sitealias_is_remote_site($alias)) {
    $site_record = drush_sitealias_get_record($alias);
    $return = drush_invoke_process($site_record, 'browse', func_get_args(), drush_redispatch_get_options(), array('integrate' => TRUE));
    if ($return['error_status']) {
      return drush_set_error('Unable to execute site browse.');
    }
    else {
      $link = $return['object'];
    }
  }
  else {
    if (!drush_bootstrap(DRUSH_BOOTSTRAP_DRUPAL_FULL)) {
      // Fail gracefully if unable to bootstrap Drupal. drush_bootstrap() has
      // already logged an error.
      return FALSE;
    }
    $link = url($path, array('absolute' => TRUE));
  }

  drush_start_browser($link);
  return $link;
}