1 | <?php |
||
5 | class Output |
||
6 | { |
||
7 | public const NO_FILE = '/dev/null'; |
||
8 | |||
9 | /** @var bool */ |
||
10 | private $noOutput = false; |
||
11 | |||
12 | /** @var string */ |
||
13 | private $stdOutFile; |
||
14 | |||
15 | /** @var bool */ |
||
16 | private $stdOutAppend; |
||
17 | |||
18 | /** @var string */ |
||
19 | private $stdErrFile; |
||
20 | |||
21 | /** @var bool */ |
||
22 | private $stdErrAppend; |
||
23 | |||
24 | public function suppressOutput(): self |
||
30 | |||
31 | public function setStandardOutFile(string $filePath): self |
||
38 | |||
39 | public function appendStandardOutToFile(string $filePath): self |
||
46 | |||
47 | /** |
||
48 | * @param bool $append Either append or rewrite log file |
||
49 | */ |
||
50 | public function setStandardErrorFile(string $filePath, bool $append = false): self |
||
57 | |||
58 | public function appendStandardErrorToFile(string $filePath): self |
||
65 | |||
66 | public function format(): string |
||
74 | |||
75 | private function redirectStandardOutTo($filePath): string |
||
79 | |||
80 | private function redirectOutputTo($out, $isAppend, $filePath): string |
||
86 | |||
87 | private function redirectStandardErrorTo($filePath): string |
||
91 | |||
92 | private function createOutput(): string |
||
106 | } |
||
107 |