| @@ 59-69 (lines=11) @@ | ||
| 56 | // silence phpseclib |
|
| 57 | $old = error_reporting(0); |
|
| 58 | $sftp = new phpseclib\Net\SFTP($this->host); |
|
| 59 | if (!$sftp->login($this->user, $this->password)) { |
|
| 60 | error_reporting($old); |
|
| 61 | throw new Exception( |
|
| 62 | sprintf( |
|
| 63 | 'authentication failed for %s@%s%s', |
|
| 64 | $this->user, |
|
| 65 | $this->host, |
|
| 66 | empty($this->password) ? '' : ' with password ****' |
|
| 67 | ) |
|
| 68 | ); |
|
| 69 | } |
|
| 70 | error_reporting($old); |
|
| 71 | ||
| 72 | $remoteFilename = $target->getFilename(); |
|
| @@ 80-90 (lines=11) @@ | ||
| 77 | ); |
|
| 78 | } |
|
| 79 | ||
| 80 | if (!ftp_login($ftpConnection, $this->user, $this->password)) { |
|
| 81 | error_reporting($old); |
|
| 82 | throw new Exception( |
|
| 83 | sprintf( |
|
| 84 | 'authentication failed for %s@%s%s', |
|
| 85 | $this->user, |
|
| 86 | $this->host, |
|
| 87 | empty($this->password) ? '' : ' with password ****' |
|
| 88 | ) |
|
| 89 | ); |
|
| 90 | } |
|
| 91 | ||
| 92 | $remoteFilename = $target->getFilename(); |
|
| 93 | $localFile = $target->getPathname(); |
|