for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
/**
* Copyright (c) 2014 Robin Appelman <[email protected]>
* This file is licensed under the Licensed under the MIT license:
* http://opensource.org/licenses/MIT
*/
namespace Icewind\SMB;
class System {
private $smbclient;
private $net;
public static function getFD($num) {
$folders = [
'/proc/self/fd/',
'/proc/curproc/'
];
foreach ($folders as $folder) {
if (file_exists($folder . $num)) {
return $folder . $num;
}
return '/dev/fd/' . $num;
public function getSmbclientPath() {
if (!$this->smbclient) {
$this->smbclient = trim(`which smbclient`);
return $this->smbclient;
public function getNetPath() {
if (!$this->net) {
$this->net = trim(`which net`);
return $this->net;