Skip to main content
Drupal API
User account menu
  • Log in

Breadcrumb

  1. Drupal Core 11.1.x
  2. ServerCommand.php

function ServerCommand::configure

Overrides Command::configure

File

core/lib/Drupal/Core/Command/ServerCommand.php, line 49

Class

ServerCommand
Runs the PHP webserver for a Drupal site for local testing/development.

Namespace

Drupal\Core\Command

Code

protected function configure() {
    $this->setDescription('Starts up a webserver for a site.')
        ->addOption('host', NULL, InputOption::VALUE_OPTIONAL, 'Provide a host for the server to run on.', '127.0.0.1')
        ->addOption('port', NULL, InputOption::VALUE_OPTIONAL, 'Provide a port for the server to run on. Will be determined automatically if none supplied.')
        ->addOption('suppress-login', 's', InputOption::VALUE_NONE, 'Disable opening a login URL in a browser.')
        ->addUsage('--host localhost --port 8080')
        ->addUsage('--host my-site.com --port 80');
}
RSS feed
Powered by Drupal