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