/**
  * {@inheritdoc}
  */
 public function isConnected()
 {
     if ($this->connection instanceof SFTP) {
         return $this->connection->isConnected();
     }
     return false;
 }
Esempio n. 2
0
 /**
  * @return SFTP
  * @throws ComponentException
  */
 public function persistConnection()
 {
     if (!$this->Connection->isConnected()) {
         $this->openConnection($this->Host, $this->Port, $this->Timeout);
         if (null === $this->Key) {
             $this->loginCredential($this->Username, $this->Password);
         } else {
             $this->loginCredentialKey($this->Username, $this->Key, $this->Password);
         }
     }
     return $this;
 }
Esempio n. 3
0
 protected function isConnected()
 {
     return $this->sftp->isConnected();
 }