mirror of
https://codeberg.org/icewind/SMB.git
synced 2026-06-03 17:24:07 +02:00
server factory tests
This commit is contained in:
parent
fc9963f738
commit
fc9f0bd408
4 changed files with 93 additions and 2 deletions
|
|
@ -54,4 +54,11 @@ interface ISystem {
|
|||
* @return string|bool
|
||||
*/
|
||||
public function getStdBufPath();
|
||||
|
||||
/**
|
||||
* Whether or not the smbclient php extension is enabled
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
public function libSmbclientAvailable();
|
||||
}
|
||||
|
|
|
|||
|
|
@ -61,6 +61,6 @@ class NativeServer extends AbstractServer {
|
|||
* @return bool
|
||||
*/
|
||||
public static function available(ISystem $system) {
|
||||
return function_exists('smbclient_state_new');
|
||||
return $system->libSmbclientAvailable();
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -45,7 +45,11 @@ class System implements ISystem {
|
|||
return $this->getBinaryPath('stdbuf');
|
||||
}
|
||||
|
||||
private function getBinaryPath($binary) {
|
||||
public function libSmbclientAvailable() {
|
||||
return function_exists('smbclient_state_new');
|
||||
}
|
||||
|
||||
protected function getBinaryPath($binary) {
|
||||
if (!isset($this->paths[$binary])) {
|
||||
$result = null;
|
||||
$output = array();
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue