public function getAuthentication($passphrase = null, $user = null)
    {
        if (is_null($user) && !isset($this->config['user'])) {
            throw new RuntimeException("Can not authenticate for '{$this->host}' could not find user to authenticate as");
        }
        $user = $user ?: $this->config['user'];
        if (isset($this->config['identityfile'])) {
            return new Authentication\PublicKeyFile(
                $user,
                $this->config['identityfile'] . '.pub',
                $this->config['identityfile'],
                $passphrase
            );
        } else {
            return new Authentication\None(
                $user
            );
        }
    }
public function getAuthentication($passphrase = null, $user = null)
    {
        if (is_null($user) && !isset($this->config['user'])) {
            throw new RuntimeException("Can not authenticate for '{$this->host}' could not find user to authenticate as");
        }
        $user = $user ?: $this->config['user'];
        if (isset($this->config['identityfile'])) {
            return new Authentication\PublicKeyFile(
                $user,
                $this->config['identityfile'] . '.pub',
                $this->config['identityfile'],
                $passphrase
            );
        } else {
            return new Authentication\None(
                $user
            );
        }
    }
public function getAuthentication ( $ passphrase = null , $ user = null ) { if ( is_null ( $ user ) && ! isset ( $ this -> config [ 'user' ] ) ) { throw new RuntimeException ( "Can not authenticate for '{$this->host}' could not find user to authenticate as" ) ; } $ user = $ user ? : $ this -> config [ 'user' ] ; if ( isset ( $ this -> config [ 'identityfile' ] ) ) { return new Authentication \ PublicKeyFile ( $ user , $ this -> config [ 'identityfile' ] . '.pub' , $ this -> config [ 'identityfile' ] , $ passphrase ) ; } else { return new Authentication \ None ( $ user ) ; } }
Return an authentication mechanism based on the configuration file
@param  string|null $passphrase
@param  string|null $user
@return PublicKeyFile|None
Return an authentication mechanism based on the configuration file