| @@ 109-119 (lines=11) @@ | ||
| 106 | // silence phpseclib |
|
| 107 | $old = error_reporting(0); |
|
| 108 | $sftp = new phpseclib\Net\SFTP($this->host); |
|
| 109 | if (!$sftp->login($this->user, $this->password)) { |
|
| 110 | error_reporting($old); |
|
| 111 | throw new Exception( |
|
| 112 | sprintf( |
|
| 113 | 'authentication failed for %s@%s%s', |
|
| 114 | $this->user, |
|
| 115 | $this->host, |
|
| 116 | empty($this->password) ? '' : ' with password ****' |
|
| 117 | ) |
|
| 118 | ); |
|
| 119 | } |
|
| 120 | // restore old error reporting |
|
| 121 | error_reporting($old); |
|
| 122 | ||
| @@ 78-88 (lines=11) @@ | ||
| 75 | ); |
|
| 76 | } |
|
| 77 | ||
| 78 | if (!ftp_login($ftpConnection, $this->user, $this->password)) { |
|
| 79 | error_reporting($old); |
|
| 80 | throw new Exception( |
|
| 81 | sprintf( |
|
| 82 | 'authentication failed for %s@%s%s', |
|
| 83 | $this->user, |
|
| 84 | $this->host, |
|
| 85 | empty($this->password) ? '' : ' with password ****' |
|
| 86 | ) |
|
| 87 | ); |
|
| 88 | } |
|
| 89 | ||
| 90 | $remoteFilename = $target->getFilename(); |
|
| 91 | $localFile = $target->getPathname(); |
|