mirror of
https://codeberg.org/icewind/SMB.git
synced 2026-06-03 17:24:07 +02:00
Pass a connection to a command instead of the share
This commit is contained in:
parent
0b2dd15499
commit
2be5320595
6 changed files with 22 additions and 40 deletions
|
|
@ -56,7 +56,7 @@ class Share {
|
|||
* @return array
|
||||
*/
|
||||
public function dir($path) {
|
||||
return (new Command\Dir($this))->run(array('path' => $path));
|
||||
return (new Command\Dir($this->connection))->run(array('path' => $path));
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -66,7 +66,7 @@ class Share {
|
|||
* @return bool
|
||||
*/
|
||||
public function mkdir($path) {
|
||||
return (new Command\Mkdir($this))->run(array('path' => $path));
|
||||
return (new Command\Mkdir($this->connection))->run(array('path' => $path));
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -76,7 +76,7 @@ class Share {
|
|||
* @return bool
|
||||
*/
|
||||
public function rmdir($path) {
|
||||
return (new Command\Rmdir($this))->run(array('path' => $path));
|
||||
return (new Command\Rmdir($this->connection))->run(array('path' => $path));
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -86,7 +86,7 @@ class Share {
|
|||
* @return bool
|
||||
*/
|
||||
public function del($path) {
|
||||
return (new Command\Del($this))->run(array('path' => $path));
|
||||
return (new Command\Del($this->connection))->run(array('path' => $path));
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -97,7 +97,7 @@ class Share {
|
|||
* @return bool
|
||||
*/
|
||||
public function rename($from, $to) {
|
||||
return (new Command\Rename($this))->run(array('path1' => $from, 'path2' => $to));
|
||||
return (new Command\Rename($this->connection))->run(array('path1' => $from, 'path2' => $to));
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -108,7 +108,7 @@ class Share {
|
|||
* @return bool
|
||||
*/
|
||||
public function put($source, $target) {
|
||||
return (new Command\Put($this))->run(array('path1' => $source, 'path2' => $target));
|
||||
return (new Command\Put($this->connection))->run(array('path1' => $source, 'path2' => $target));
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -119,25 +119,7 @@ class Share {
|
|||
* @return bool
|
||||
*/
|
||||
public function get($source, $target) {
|
||||
return (new Command\Get($this))->run(array('path1' => $source, 'path2' => $target));
|
||||
}
|
||||
|
||||
/**
|
||||
* send input to smbclient
|
||||
*
|
||||
* @param string $input
|
||||
*/
|
||||
public function write($input) {
|
||||
$this->connection->write($input);
|
||||
}
|
||||
|
||||
/**
|
||||
* get all unprocessed output from smbclient
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public function read() {
|
||||
return $this->connection->read();
|
||||
return (new Command\Get($this->connection))->run(array('path1' => $source, 'path2' => $target));
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue