| Conditions | 2 |
| Paths | 2 |
| Total Lines | 10 |
| Code Lines | 7 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 37 | public function save(Http\FileUpload $fileUpload, $relativePath) |
||
| 38 | { |
||
| 39 | $path = Upload\Utils::makeRelativePath($relativePath); |
||
| 40 | $dir = dirname($relativePath); |
||
| 41 | if($dir !== '.') { |
||
| 42 | $this->ftp->mkDirRecursive($dir); |
||
| 43 | } |
||
| 44 | $this->ftp->put($path, $fileUpload->getTemporaryFile(), FTP_BINARY); |
||
| 45 | @unlink($fileUpload->getTemporaryFile()); |
||
|
|
|||
| 46 | } |
||
| 47 | |||
| 57 | } |
If you suppress an error, we recommend checking for the error condition explicitly: