Skip to content

Commit fe955c3

Browse files
author
Greg Bowler
authored
Merge pull request #7 from PhpGt/6-run-port
Change server port when calling "run" command
2 parents 4b4a2e2 + dad0568 commit fe955c3

File tree

1 file changed

+16
-2
lines changed

1 file changed

+16
-2
lines changed

src/Command/RunCommand.php

Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,12 @@
77

88
class RunCommand extends AbstractWebEngineCommand {
99
public function run(ArgumentValueList $arguments = null):void {
10+
$port = $arguments->get("port", 8080);
11+
$bind = $arguments->get("bind", "0.0.0.0");
12+
1013
$this->executeScript(
1114
$arguments,
12-
["serve"],
15+
["serve", "--port", $port, "--bind", $bind],
1316
["build", "--default", "vendor/phpgt/webengine/build.default.json", "--watch"],
1417
["cron", "--now", "--watch"]
1518
);
@@ -40,6 +43,17 @@ public function getRequiredParameterList():array {
4043

4144
/** @return Parameter[] */
4245
public function getOptionalParameterList():array {
43-
return [];
46+
return [
47+
new Parameter(
48+
true,
49+
"port",
50+
"p"
51+
),
52+
new Parameter(
53+
true,
54+
"bind",
55+
"b"
56+
),
57+
];
4458
}
4559
}

0 commit comments

Comments
 (0)