Skip to content

Commit e2f2cdb

Browse files
committed
Merge remote-tracking branch 'upstream/master' into fix-fetchstarterkit
Conflicts: src/PatternLab/Fetch.php
2 parents b1db087 + 725f373 commit e2f2cdb

21 files changed

+645
-565
lines changed

.editorconfig

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
root = true
2+
3+
[*]
4+
charset = utf-8
5+
indent_style = tab
6+
trim_trailing_whitespace = false
7+
end_of_line = lf
8+
insert_final_newline = true

src/PatternLab/Config.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -207,6 +207,7 @@ public static function init($baseDir = "", $verbose = true) {
207207
self::setExposedOption("ishFontSize");
208208
self::setExposedOption("ishMaximum");
209209
self::setExposedOption("ishMinimum");
210+
self::setExposedOption("patternExtension");
210211

211212
}
212213

src/PatternLab/Console/Commands/ServerCommand.php

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,9 @@ public function __construct() {
2424
$this->command = "server";
2525

2626
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>");
2730

2831
}
2932

@@ -39,9 +42,15 @@ public function run() {
3942
$publicDir = Config::getOption("publicDir");
4043
$coreDir = Config::getOption("coreDir");
4144

45+
$host = Console::findCommandOptionValue("host");
46+
$host = $host ? $host : "localhost";
47+
48+
$port = Console::findCommandOptionValue("port");
49+
$host = $port ? $host.":".$port : $host.":8080";
50+
4251
// start-up the server with the router
43-
Console::writeInfo("server started on localhost:8080. use ctrl+c to exit...");
44-
passthru("cd ".$publicDir." && ".$_SERVER["_"]." -S localhost:8080 ".$coreDir."/server/router.php");
52+
Console::writeInfo("server started on ".$host.". use ctrl+c to exit...");
53+
passthru("cd ".$publicDir." && ".$_SERVER["_"]." -S ".$host." ".$coreDir."/server/router.php");
4554

4655
}
4756

src/PatternLab/Console/Commands/WatchCommand.php

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -27,8 +27,9 @@ public function __construct() {
2727

2828
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");
2929
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");
3233
//Console::setCommandOption($this->command,"autoreload","Turn on the auto-reload service.","To turn on auto-reload:","r");
3334

3435
}
@@ -44,7 +45,7 @@ public function run() {
4445
// $options["autoReload"] = Console::findCommandOption("r|autoreload");
4546

4647
// see if the starterKit flag was passed so you know what dir to watch
47-
if (Console::findCommandOption("s|starterkit")) {
48+
if (Console::findCommandOption("sk")) {
4849

4950
// load the starterkit watcher
5051
$w = new Watcher();

0 commit comments

Comments
 (0)