PHP 8.5.0 Alpha 2 available for testing

Voting

: two minus two?
(Example: nine)

The Note You're Voting On

Youz
6 years ago
Adding a function to previous class to connect with key instead of user/password

<?php
public function loginWithKey($username, $publicKey, $privateKey, $passphrase = null)
{
if (!@
ssh2_auth_pubkey_file($this->connection, $username, $publicKey, $privateKey, $passphrase)) {
throw new
Exception("Could not authenticate with given keys or passphrase");
}

$this->sftp = @ssh2_sftp($this->connection);
if (!
$this->sftp) {
throw new
Exception("Could not initialize SFTP subsystem.");
}
}

?>

<< Back to user notes page

To Top