-
Notifications
You must be signed in to change notification settings - Fork 61
Expand file tree
/
Copy pathGenerateCommand.php
More file actions
49 lines (34 loc) · 1.38 KB
/
GenerateCommand.php
File metadata and controls
49 lines (34 loc) · 1.38 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
<?php
/*!
* Console Generate Command Class
*
* Copyright (c) 2014 Dave Olsen, http://dmolsen.com
* Licensed under the MIT license
*
*/
namespace PatternLab\Console\Commands;
use \PatternLab\Config;
use \PatternLab\Console;
use \PatternLab\Console\Command;
use \PatternLab\Generator;
use \PatternLab\Saying;
use \PatternLab\Timer;
class GenerateCommand extends Command {
public function __construct() {
parent::__construct();
$this->command = "generate";
Console::setCommand($this->command,"Generate Pattern Lab","The generate command generates an entire site a single time. By default it removes old content in <path>public/</path>, compiles the patterns and moves content from <path>source/</path> into <path>public/</path>","g");
Console::setCommandOption($this->command,"patternsonly","Generate only the patterns. Does NOT clean <path>public/</path>.","To generate only the patterns:","p");
Console::setCommandOption($this->command,"nocache","Set the cacheBuster value to 0.","To turn off the cacheBuster:","n");
}
public function run() {
// set-up required vars
$options = array();
$options["moveStatic"] = (Console::findCommandOption("p|patternsonly")) ? false : true;
$options["noCacheBuster"] = Console::findCommandOption("n|nocache");
$g = new Generator();
$g->generate($options);
$s = new Saying();
$s->say();
}
}