1 | <?php |
||
5 | abstract class System |
||
6 | { |
||
7 | protected $force_ansi; |
||
8 | |||
9 | /** |
||
10 | * Force ansi on or off |
||
11 | * |
||
12 | * @param bool $force |
||
13 | */ |
||
14 | 8 | public function forceAnsi($force = true) |
|
15 | { |
||
16 | 8 | $this->force_ansi = $force; |
|
17 | 8 | } |
|
18 | |||
19 | /** |
||
20 | * @return integer|null |
||
21 | */ |
||
22 | abstract public function width(); |
||
23 | |||
24 | /** |
||
25 | * @return integer|null |
||
26 | */ |
||
27 | abstract public function height(); |
||
28 | |||
29 | /** |
||
30 | * Check if the stream supports ansi escape characters. |
||
31 | * |
||
32 | * @return bool |
||
33 | */ |
||
34 | abstract protected function systemHasAnsiSupport(); |
||
35 | |||
36 | /** |
||
37 | * Check if we are forcing ansi, fallback to system support |
||
38 | * |
||
39 | * @return bool |
||
40 | */ |
||
41 | 8 | public function hasAnsiSupport() |
|
49 | |||
50 | /** |
||
51 | * Wraps exec function, allowing the dimension methods to decouple |
||
52 | * |
||
53 | * @param string $command |
||
54 | * @param boolean $full |
||
55 | * |
||
56 | * @return string|array |
||
57 | */ |
||
58 | public function exec($command, $full = false) |
||
68 | } |
||
69 |