From 11c7531650ef413b0ecbfcbb8489bd65056ba859 Mon Sep 17 00:00:00 2001 From: "Alexander A. Klimov" Date: Fri, 27 Nov 2015 11:34:53 +0100 Subject: [PATCH] WebCommand::serveAction(): add optional parameters --listen and --port refs #10682 --- application/clicommands/WebCommand.php | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/application/clicommands/WebCommand.php b/application/clicommands/WebCommand.php index 515117528..4a245efa9 100644 --- a/application/clicommands/WebCommand.php +++ b/application/clicommands/WebCommand.php @@ -21,8 +21,14 @@ class WebCommand extends Command } $fork = $this->params->get('daemonize'); + $listen = $this->params->get('listen'); + $port = $this->params->get('port'); $documentRoot = $this->params->shift(); - $socket = $this->params->shift(); + if ($listen === null) { + $socket = $port === null ? $this->params->shift() : '0.0.0.0:' . $port; + } else { + $socket = $listen; + } // TODO: Sanity check!! if ($socket === null) {