1
|
|
|
<?php |
2
|
|
|
/** |
3
|
|
|
* Lichtenwallner (https://lichtenwallner.at) |
4
|
|
|
* |
5
|
|
|
* @see https://github.com/jolicht/markdown-cms for the canonical source repository |
6
|
|
|
* @license https://github.com/jolicht/markdown-cms/blob/master/LICENSE MIT |
7
|
|
|
* @copyright Copyright (c) Johannes Lichtenwallner |
8
|
|
|
*/ |
9
|
|
|
declare(strict_types = 1); |
10
|
|
|
namespace Jolicht\MarkdownCms\Command; |
11
|
|
|
|
12
|
|
|
use Symfony\Component\Console\Command\Command; |
13
|
|
|
use Symfony\Component\Console\Input\InputInterface; |
14
|
|
|
use Symfony\Component\Console\Output\OutputInterface; |
15
|
|
|
use Jolicht\MarkdownCms\Parser\ParseContentExecutor; |
16
|
|
|
|
17
|
|
|
class ParseContentCommand extends Command |
18
|
|
|
{ |
19
|
|
|
/** |
20
|
|
|
* Parse content executor |
21
|
|
|
* |
22
|
|
|
* @var ParseContentExecutor |
23
|
|
|
*/ |
24
|
|
|
private $parseContentExecutor; |
25
|
|
|
|
26
|
|
|
/** |
27
|
|
|
* Set parse content executor |
28
|
|
|
* |
29
|
|
|
* @param ParseContentExecutor $parseContentExecutor |
30
|
|
|
*/ |
31
|
|
|
public function setParseContentExecutor(ParseContentExecutor $parseContentExecutor) |
32
|
|
|
{ |
33
|
|
|
$this->parseContentExecutor = $parseContentExecutor; |
34
|
|
|
} |
35
|
|
|
|
36
|
|
|
/** |
37
|
|
|
* Get parse content executor |
38
|
|
|
* |
39
|
|
|
* @return ParseContentExecutor |
40
|
|
|
*/ |
41
|
|
|
public function getParseContentExecutor() : ParseContentExecutor |
42
|
|
|
{ |
43
|
|
|
return $this->parseContentExecutor; |
44
|
|
|
} |
45
|
|
|
|
46
|
|
|
protected function configure() |
47
|
|
|
{ |
48
|
|
|
$this->setName('markdown-cms:parse') |
49
|
|
|
->setDescription('parse markdown documents in content directory'); |
50
|
|
|
} |
51
|
|
|
|
52
|
|
|
protected function execute(InputInterface $input, OutputInterface $output) |
53
|
|
|
{ |
54
|
|
|
($this->getParseContentExecutor())(); |
55
|
|
|
} |
56
|
|
|
} |