'1', 'browser' => true, 'redirect-port' => self::REQ]) { // Redispatch if called against a remote-host so a browser is started on the // the *local* machine. $aliasRecord = $this->siteAliasManager()->getSelf(); if ($aliasRecord->isRemote()) { $return = drush_invoke_process($aliasRecord, 'user-login', [$path], Drush::redispatchOptions(), ['integrate' => false]); if ($return['error_status']) { throw new \Exception('Unable to execute user login.'); } else { $link = is_string($return['object']) ?: current($return['object']); } } else { if (!Drush::bootstrapManager()->doBootstrap(DRUSH_BOOTSTRAP_DRUPAL_FULL)) { throw new \Exception(dt('Unable to bootstrap Drupal.')); } if ($options['name'] == 1) { $account = User::load(1); } elseif (!$account = user_load_by_name($options['name'])) { throw new \Exception(dt('Unable to load user: !user', ['!user' => $options['name']])); } $link = user_pass_reset_url($account). '/login'; if ($path) { $link .= '?destination=' . $path; } } $port = $options['redirect-port']; $this->startBrowser($link, false, $port, $options['browser']); // Use an array for backwards compat. drush_backend_set_result([$link]); return $link; } }