Agent.php (600B)
1 <?php 2 3 namespace Ssh\Authentication; 4 5 use Ssh\Authentication; 6 7 /** 8 * SSH Agent authentication 9 * 10 * @author Cam Spiers <camspiers@gmail.com> 11 */ 12 class Agent implements Authentication 13 { 14 protected $username; 15 16 /** 17 * Constructor 18 * 19 * @param string $username The authentication username 20 */ 21 public function __construct($username) 22 { 23 $this->username = $username; 24 } 25 26 /** 27 * {@inheritDoc} 28 */ 29 public function authenticate($session) 30 { 31 return ssh2_auth_agent( 32 $session, 33 $this->username 34 ); 35 } 36 }