Class Client
SFTP-Client
$host = 'example.com'; $user = new \Alvine\Security\Authentication\User('root'); $credential = new \Alvine\Security\Authentication\Credential\Password('geheim'); $config = new \Alvine\Infrastructure\Linux\SSH\Configuration(); $connection = new \Alvine\Infrastructure\Linux\SSH\SFTP\Client($host, $user, $credential, 22, $config); $status = $connection->getStatus(new \Alvine\IO\File\File('/tmp/example.txt')); // Enthält Status-Objekt echo (string) $status->getPermissions(); $list = $connection->getDirectoryList(new \Alvine\IO\File\Directory('/etc')); // Liefert Collection zurück echo \implode("\r\n", \explode(',', (string) $list)); // Datei umbenennen $connection->rename(new \Alvine\IO\File\File('/tmp/example.txt'), new \Alvine\IO\File\File('/tmp/example.txt.backup'));
- Alvine\Core\Alvine
- Alvine\Infrastructure\Linux\SSH\Client implements Alvine\Infrastructure\Linux\System\Execute
- Alvine\Infrastructure\Linux\SSH\SFTP\Client
Namespace: Alvine\Infrastructure\Linux\SSH\SFTP
Package: Alvine\Infrastructure\Linux
Category: Alvine
License: Alvine Nutzungslizenz
Author: schukai GmbH info@schukai.de
Version: $Revision:$
Since: 20160822
Link: alvine.io
Located at ssh/sftp/Client.class.php
Package: Alvine\Infrastructure\Linux
Category: Alvine
License: Alvine Nutzungslizenz
Author: schukai GmbH info@schukai.de
Version: $Revision:$
Since: 20160822
Link: alvine.io
Located at ssh/sftp/Client.class.php
public
|
#
__construct( string $host, Alvine\Security\Authentication\User $user, Alvine\Security\Authentication\Credential $credential, integer $port = 22,
Die Verbindung zum Server besteht über die gesamte Lebenszeit des Objektes. Die Verbindung kann jedoch auch vorzeitig durch die Methode Client::disconnect() geschlossen werden. In diesem Fall wird beim ausführen von Befehlen eine Exception geworfen. |
public
|
|
public
|
|
public
|
|
public
|
|
public
Alvine\IO\File\File
|
|
public
Alvine\IO\File\File
|
|
public
|
|
public
|
|
public
|
|
public
|
#
sendFile( Alvine\IO\File\File $localFile, string $remoteFile, integer $mode = 0660 )
Lokale Datei übertragen |
public
|
|
public
Alvine\Types\Collection
|
__destruct(),
disconnect(),
doAuthentification(),
execute(),
getError(),
getFingerprint(),
receive(),
send()
|
protected
resource
|
$sftp
SFTP Resource |
$config,
$credential,
$fingerprint,
$host,
$port,
$session,
$user
|