1 | <?php |
||
12 | class System { |
||
13 | private $smbclient; |
||
14 | |||
15 | private $net; |
||
16 | |||
17 | private $stdbuf; |
||
18 | |||
19 | private $date; |
||
20 | |||
21 | public static function getFD($num) { |
||
22 | $folders = array( |
||
23 | '/proc/self/fd', |
||
24 | '/dev/fd' |
||
25 | ); |
||
26 | foreach ($folders as $folder) { |
||
27 | if (file_exists($folder)) { |
||
28 | return $folder . '/' . $num; |
||
29 | } |
||
30 | } |
||
31 | throw new Exception('Cant find file descriptor path'); |
||
32 | } |
||
33 | |||
34 | public function getSmbclientPath() { |
||
35 | if (!$this->smbclient) { |
||
36 | $this->smbclient = trim(`which smbclient`); |
||
37 | } |
||
38 | return $this->smbclient; |
||
39 | } |
||
40 | |||
41 | public function getNetPath() { |
||
42 | if (!$this->net) { |
||
43 | $this->net = trim(`which net`); |
||
44 | } |
||
45 | return $this->net; |
||
46 | } |
||
47 | |||
48 | public function getDatePath() { |
||
54 | |||
55 | public function hasStdBuf() { |
||
56 | if (!$this->stdbuf) { |
||
57 | $result = null; |
||
64 | } |
||
65 |