Merge branch '1.0' into 2.0

This commit is contained in:
terrafrost 2018-12-01 22:46:13 -06:00
commit 1bb2826ab1

View File

@ -117,8 +117,9 @@ class Agent
* @return \phpseclib\System\SSH\Agent * @return \phpseclib\System\SSH\Agent
* @access public * @access public
*/ */
function __construct() function __construct($address = null)
{ {
if (!$address) {
switch (true) { switch (true) {
case isset($_SERVER['SSH_AUTH_SOCK']): case isset($_SERVER['SSH_AUTH_SOCK']):
$address = $_SERVER['SSH_AUTH_SOCK']; $address = $_SERVER['SSH_AUTH_SOCK'];
@ -130,6 +131,7 @@ class Agent
user_error('SSH_AUTH_SOCK not found'); user_error('SSH_AUTH_SOCK not found');
return false; return false;
} }
}
$this->fsock = fsockopen('unix://' . $address, 0, $errno, $errstr); $this->fsock = fsockopen('unix://' . $address, 0, $errno, $errstr);
if (!$this->fsock) { if (!$this->fsock) {