You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: src/PatternLab/Console/Commands/ServerCommand.php
+11-2Lines changed: 11 additions & 2 deletions
Original file line number
Diff line number
Diff line change
@@ -24,6 +24,9 @@ public function __construct() {
24
24
$this->command = "server";
25
25
26
26
Console::setCommand($this->command,"Start the PHP-based server","The server command will start PHP's web server for you.","s");
27
+
Console::setCommandOption($this->command,"host:","Provide a custom hostname. Default value is <path>localhost</path>.","To use a custom hostname and the default port:","","<host>");
28
+
Console::setCommandOption($this->command,"port:","Provide a custom port. Default value is <path>8080</path>.","To use a custom port and the default hostname:","","<port>");
29
+
Console::setCommandSample($this->command,"To provide both a custom hostname and port:","--host <host> --port <port>");
27
30
28
31
}
29
32
@@ -39,9 +42,15 @@ public function run() {
39
42
$publicDir = Config::getOption("publicDir");
40
43
$coreDir = Config::getOption("coreDir");
41
44
45
+
$host = Console::findCommandOptionValue("host");
46
+
$host = $host ? $host : "localhost";
47
+
48
+
$port = Console::findCommandOptionValue("port");
49
+
$host = $port ? $host.":".$port : $host.":8080";
50
+
42
51
// start-up the server with the router
43
-
Console::writeInfo("server started on localhost:8080. use ctrl+c to exit...");
Copy file name to clipboardExpand all lines: src/PatternLab/Console/Commands/WatchCommand.php
+4-3Lines changed: 4 additions & 3 deletions
Original file line number
Diff line number
Diff line change
@@ -27,8 +27,9 @@ public function __construct() {
27
27
28
28
Console::setCommand($this->command,"Watch for changes and regenerate","The watch command builds Pattern Lab, watches for changes in <path>source/</path> and regenerates Pattern Lab when there are any.","w");
29
29
Console::setCommandOption($this->command,"patternsonly","Watches only the patterns. Does NOT clean <path>public/</path>.","To watch and generate only the patterns:","p");
30
-
Console::setCommandOption($this->command,"nocache","Set the cacheBuster value to 0.","To turn off the cacheBuster:","n");
31
-
Console::setCommandOption($this->command,"starterkit","Watch for changes to the StarterKit and copy to <path>source/</path>. The <info>--starterkit</info> flag should only be used if one is actively developing a StarterKit.","To watch for changes to the StarterKit:","s");
30
+
Console::setCommandOption($this->command,"nocache","Set the cacheBuster value to 0.","To watch and turn off the cache buster:","n");
31
+
Console::setCommandOption($this->command,"sk","Watch for changes to the StarterKit and copy to <path>source/</path>. The <info>--sk</info> flag should only be used if one is actively developing a StarterKit.","To watch for changes to the StarterKit:");
32
+
Console::setCommandSample($this->command,"To watch only patterns and turn off the cache buster:","--patternsonly --nocache");
32
33
//Console::setCommandOption($this->command,"autoreload","Turn on the auto-reload service.","To turn on auto-reload:","r");
0 commit comments