| 1 | <?php |
||
| 12 | class System implements ISystem { |
||
| 13 | /** @var (string|bool)[] */ |
||
| 14 | private $paths = []; |
||
| 15 | |||
| 16 | /** |
||
| 17 | * Get the path to a file descriptor of the current process |
||
| 18 | * |
||
| 19 | * @param int $num the file descriptor id |
||
| 20 | * @return string |
||
| 21 | * @throws Exception |
||
| 22 | */ |
||
| 23 | 777 | public function getFD($num) { |
|
| 24 | $folders = [ |
||
| 25 | 777 | '/proc/self/fd', |
|
| 26 | '/dev/fd' |
||
| 27 | ]; |
||
| 28 | 777 | foreach ($folders as $folder) { |
|
| 29 | 777 | if (file_exists($folder)) { |
|
| 30 | 777 | return $folder . '/' . $num; |
|
| 31 | } |
||
| 32 | } |
||
| 33 | throw new Exception('Cant find file descriptor path'); |
||
| 34 | } |
||
| 35 | |||
| 36 | 780 | public function getSmbclientPath() { |
|
| 39 | |||
| 40 | 768 | public function getNetPath() { |
|
| 43 | |||
| 44 | 765 | public function getStdBufPath() { |
|
| 47 | |||
| 48 | 1 | public function libSmbclientAvailable() { |
|
| 51 | |||
| 52 | 780 | protected function getBinaryPath($binary) { |
|
| 61 | } |
||
| 62 |