Skip to main content

GravityKit\GravityExport\Save\Service\ConnectionManagerService

Service that handles testing of storage services' connection.

Since: 1.0

Source: add-ons/save/src/Service/ConnectionManagerService.php:31

Details

  • Kind: class
  • Namespace: GravityKit\GravityExport\Save\Service

Methods

MethodDescription
__construct()
getFtpAdapter()Returns FTP connection adapter.
getSftpAdapter()Returns SFTP connection adapter.
getDropboxAdapter()Returns Dropbox connection adapter.
testConnection()Tests connection: 1) logging in/listing folder, 2) uploading file, 3) deleting file.

Method Reference

__construct()

public function __construct( PasswordService $password_service )

Parameters

NameTypeDefaultDescription
$password_servicePasswordService

Since: 1.0

Source: add-ons/save/src/Service/ConnectionManagerService.php:61

getFtpAdapter()

public function getFtpAdapter( string $host, int $port, bool $ssl, bool $passive, string $username, string $password, string $path, $timeout=null ): FtpAdapter

Returns FTP connection adapter.

Parameters

NameTypeDefaultDescription
$hoststring
$portint
$sslbool
$passivebool
$usernamestring
$passwordstring
$pathstring
$timeoutnullnull

Returns

  • FtpAdapter

Since: 1.0

Source: add-ons/save/src/Service/ConnectionManagerService.php:85

getSftpAdapter()

public function getSftpAdapter( string $host, int $port, string $username, string $password, string $path, string $private_key=null, string $private_key_passphrase=null, $timeout=null ): SftpAdapter

Returns SFTP connection adapter.

Parameters

NameTypeDefaultDescription
$hoststring
$portint
$usernamestring
$passwordstring
$pathstring
$private_keystring | nullnull
$private_key_passphrasestring | nullnull
$timeoutnullnull

Returns

  • SftpAdapter

Since: 1.0

Source: add-ons/save/src/Service/ConnectionManagerService.php:127

getDropboxAdapter()

public function getDropboxAdapter( TokenProvider $token_provider, string $path='' ): DropboxAdapter

Returns Dropbox connection adapter.

Parameters

NameTypeDefaultDescription
$token_providerTokenProvider
$pathstring''

Returns

  • DropboxAdapter

Since: 1.0

Source: add-ons/save/src/Service/ConnectionManagerService.php:159

testConnection()

public function testConnection( string $service, array $connection_settings ): void

Tests connection: 1) logging in/listing folder, 2) uploading file, 3) deleting file.

Parameters

NameTypeDefaultDescription
$servicestring
$connection_settingsarray

Returns

  • void

Throws

  • SaveException | ExpiredTokenException

Since: 1.0

Source: add-ons/save/src/Service/ConnectionManagerService.php:174