function DrupalApplication::getUri

Same name and namespace in other branches
  1. main core/lib/Drupal/Core/Command/DrupalApplication.php \Drupal\Core\Command\DrupalApplication::getUri()

Gets the URI for the request.

Return value

string The base URL for this request.

1 call to DrupalApplication::getUri()
DrupalApplication::bootstrap in core/lib/Drupal/Core/Command/DrupalApplication.php
Bootstraps Drupal in a way that is appropriate for console commands.

File

core/lib/Drupal/Core/Command/DrupalApplication.php, line 148

Class

DrupalApplication
Customize the Symfony Application for Drupal.

Namespace

Drupal\Core\Command

Code

public function getUri() : string {
  $argv = new ArgvInput();
  return $argv->getParameterOption('--url') ?: $this->context['DRUPAL_URI'] ?? 'http://localhost';
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.