| @@ 104-111 (lines=8) @@ | ||
| 101 | $this->sculpin->run($this->dataSource, $this->sourceSet); |
|
| 102 | $httpServer = $this->httpServerFactory->create($docroot); |
|
| 103 | ||
| 104 | if ($watch) { |
|
| 105 | $httpServer->addPeriodicTimer(1, function () { |
|
| 106 | clearstatcache(); |
|
| 107 | $this->sourceSet->reset(); |
|
| 108 | ||
| 109 | $this->sculpin->run($this->dataSource, $this->sourceSet); |
|
| 110 | }); |
|
| 111 | } |
|
| 112 | ||
| 113 | $httpServer->run(); |
|
| 114 | } else { |
|
| @@ 114-124 (lines=11) @@ | ||
| 111 | } |
|
| 112 | ||
| 113 | $httpServer->run(); |
|
| 114 | } else { |
|
| 115 | do { |
|
| 116 | $this->sculpin->run($this->dataSource, $this->sourceSet); |
|
| 117 | ||
| 118 | if ($watch) { |
|
| 119 | sleep(2); |
|
| 120 | clearstatcache(); |
|
| 121 | $this->sourceSet->reset(); |
|
| 122 | } |
|
| 123 | } while ($watch); |
|
| 124 | } |
|
| 125 | } |
|
| 126 | ||
| 127 | private function clean(OutputInterface $output, string $dir) |
|