NovikovViktor/SFTPBundle

View on GitHub
SFTP/ConnectionInterface.php

Summary

Maintainability
A
0 mins
Test Coverage
<?php

namespace NW\SFTPBundle\SFTP;

/**
 * Interface ConnectionInterface
 * @package NW\SFTPBundle\SFTP
 * @author Novikov Viktor
 */
interface ConnectionInterface
{
    /**
     * Establish connection with remote host
     *
     * @param $host
     * @param $port
     */
    public function connect($host, $port);

    /**
     * Authenticate user to established connection with username and password
     *
     * @param $username
     * @param string|null $password
     */
    public function login($username, $password = null);

    /**
     * Establish connection with remote host via public and private keys
     *
     * @param $username
     * @param $publicKeyFile
     * @param $privateKeyFile
     * @param string|null $passPhrase
     */
    public function loginWithKey($username, $publicKeyFile, $privateKeyFile, $passPhrase = null);

    /**
     * Implementation of this function should close established connection
     */
    public function disconnect();
}