mirror of
https://github.com/phpseclib/phpseclib.git
synced 2024-09-29 07:39:00 +00:00
System/SSH/Agent: add parameter to constructor
This commit is contained in:
parent
8f2a0e6f0d
commit
fbef6f009f
@ -352,18 +352,20 @@ class System_SSH_Agent
|
|||||||
* @return System_SSH_Agent
|
* @return System_SSH_Agent
|
||||||
* @access public
|
* @access public
|
||||||
*/
|
*/
|
||||||
function __construct()
|
function __construct($address = null)
|
||||||
{
|
{
|
||||||
switch (true) {
|
if (!$address) {
|
||||||
case isset($_SERVER['SSH_AUTH_SOCK']):
|
switch (true) {
|
||||||
$address = $_SERVER['SSH_AUTH_SOCK'];
|
case isset($_SERVER['SSH_AUTH_SOCK']):
|
||||||
break;
|
$address = $_SERVER['SSH_AUTH_SOCK'];
|
||||||
case isset($_ENV['SSH_AUTH_SOCK']):
|
break;
|
||||||
$address = $_ENV['SSH_AUTH_SOCK'];
|
case isset($_ENV['SSH_AUTH_SOCK']):
|
||||||
break;
|
$address = $_ENV['SSH_AUTH_SOCK'];
|
||||||
default:
|
break;
|
||||||
user_error('SSH_AUTH_SOCK not found');
|
default:
|
||||||
return false;
|
user_error('SSH_AUTH_SOCK not found');
|
||||||
|
return false;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
$this->fsock = fsockopen('unix://' . $address, 0, $errno, $errstr);
|
$this->fsock = fsockopen('unix://' . $address, 0, $errno, $errstr);
|
||||||
@ -378,9 +380,9 @@ class System_SSH_Agent
|
|||||||
* @see self::__construct()
|
* @see self::__construct()
|
||||||
* @access public
|
* @access public
|
||||||
*/
|
*/
|
||||||
function System_SSH_Agent()
|
function System_SSH_Agent($address = null)
|
||||||
{
|
{
|
||||||
$this->__construct();
|
$this->__construct($address);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
Loading…
Reference in New Issue
Block a user