@@ 123-126 (lines=4) @@ | ||
120 | public function get($localFile, $remoteFile) |
|
121 | { |
|
122 | $file = $this->phpFopen($localFile, 'w'); |
|
123 | if (!$file) { |
|
124 | $this->log(Logger::ERROR, 'Unable to open file to write : ' . $localFile, (array)$this->getSettings()); |
|
125 | throw new FtpException('Unable to open file to write : ' . $localFile); |
|
126 | } |
|
127 | $this->phpCurlSetOpt($this->getSession(), CURLOPT_URL, $this->getUrl() . $remoteFile); |
|
128 | $this->phpCurlSetOpt($this->getSession(), CURLOPT_FOLLOWLOCATION, 1); |
|
129 | $this->phpCurlSetOpt($this->getSession(), CURLOPT_RETURNTRANSFER, 1); |
|
@@ 147-150 (lines=4) @@ | ||
144 | public function put($remoteFile, $localFile) |
|
145 | { |
|
146 | $file = $this->phpFopen($localFile, 'r'); |
|
147 | if (!$file) { |
|
148 | $this->log(Logger::ERROR, 'Unable to open file to read : ' . $localFile, (array)$this->getSettings()); |
|
149 | throw new FtpException('Unable to open file to read : ' . $localFile); |
|
150 | } |
|
151 | $this->phpCurlSetOpt($this->getSession(), CURLOPT_URL, $this->getUrl() . $remoteFile); |
|
152 | $this->phpCurlSetOpt($this->getSession(), CURLOPT_UPLOAD, 1); |
|
153 | $this->phpCurlSetOpt($this->getSession(), CURLOPT_INFILE, $file); |