コード例 #1
0
 /**
  * testReturnObjectIsInstanceOf method
  *
  * @return void
  */
 public function testReturnObjectIsInstanceOf()
 {
     $this->assertInstanceOf('\\NetDeviceLib\\Auth\\Credentials', AuthFactory::credentials());
     $this->assertInstanceOf('\\NetDeviceLib\\Auth\\Credentials', AuthFactory::credentials('Credentials'));
     $this->assertInstanceOf('\\NetDeviceLib\\Auth\\SshPublicKeyCredentials', AuthFactory::credentials('SshPublicKeyCredentials'));
     $this->assertInstanceOf('\\NetDeviceLib\\Auth\\SnmpCredentials', AuthFactory::credentials('SnmpCredentials'));
     $this->assertInstanceOf('\\NetDeviceLib\\Auth\\SnmpV3Credentials', AuthFactory::credentials('SnmpV3Credentials'));
 }
コード例 #2
0
ファイル: Client.php プロジェクト: pronique/netdevicelib
 public function __construct($config = [])
 {
     $this->config($config);
     if ($this->config('ssh.authType') == 'password') {
         $this->_credentials = AuthFactory::credentials('Credentials', $this->config('ssh.credentials'));
     } elseif ($this->config('ssh.authType') == 'publicKey') {
         $this->_credentials = AuthFactory::credentials('SshPublicKeyCredentials', $this->config('ssh.credentials'));
     } else {
         throw new \Exception("Invalid authType '" . $this->config('ssh.authType') . "' specified");
     }
 }
コード例 #3
0
ファイル: Client.php プロジェクト: pronique/netdevicelib
 public function __construct($config = [])
 {
     $this->config($config);
     $this->_credentials = AuthFactory::credentials('Credentials', $this->config('credentials'));
     //$this->_socket = new Socket($this->config('socket'));
 }