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