mirror of
https://github.com/phpseclib/phpseclib.git
synced 2024-12-27 19:54:57 +00:00
Merge branch '1.0' into 2.0
This commit is contained in:
commit
1bb2826ab1
@ -117,18 +117,20 @@ class Agent
|
|||||||
* @return \phpseclib\System\SSH\Agent
|
* @return \phpseclib\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);
|
||||||
|
Loading…
Reference in New Issue
Block a user