1 | <?php |
||
15 | class WindowsSystem |
||
|
|||
16 | { |
||
17 | const PATH_SEPARATOR = ';'; |
||
18 | |||
19 | const FORBIDDEN_CHARS = '<>:"/\|?*'; |
||
20 | |||
21 | /** |
||
22 | * @var WindowsSystem |
||
23 | */ |
||
24 | private static $instance; |
||
25 | |||
26 | /** |
||
27 | * @var array |
||
28 | */ |
||
29 | private $exts; |
||
30 | |||
31 | /** |
||
32 | * an instance is bootstrapped in to prevent initialization overhead |
||
33 | * |
||
34 | * @return WindowsSystem |
||
35 | */ |
||
36 | private static function getInstance() |
||
37 | { |
||
38 | self::$instance || self::$instance = new WindowsSystem(); |
||
39 | |||
40 | return self::$instance; |
||
41 | } |
||
42 | |||
43 | private function __construct() |
||
46 | |||
47 | /** |
||
48 | * @return array keys are uppercase extensions incl. dot |
||
49 | */ |
||
50 | private function getExecuteableExtesions() |
||
60 | |||
61 | /** |
||
62 | * a name is executable based on it's extension |
||
63 | * |
||
64 | * @param string $name |
||
65 | * |
||
66 | * @return bool |
||
67 | */ |
||
68 | public static function isExecutableName($name) |
||
85 | |||
86 | /** |
||
87 | * a program (by it's basename) is available on system for execution |
||
88 | * |
||
89 | * @param string $program |
||
90 | * @return bool |
||
91 | */ |
||
92 | public static function isProgramInstalled($program) |
||
127 | } |
||
128 |