| Conditions | 3 |
| Paths | 3 |
| Total Lines | 24 |
| Code Lines | 12 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php namespace Nwidart\DbExporter; |
||
| 17 | public function upload($what) |
||
| 18 | { |
||
| 19 | $localPath = "{$what}Path"; |
||
| 20 | |||
| 21 | $dir = scandir($localPath); |
||
| 22 | $remotePath = config('db-exporter.remote.' . $what); |
||
| 23 | |||
| 24 | foreach($dir as $file) { |
||
| 25 | if (in_array($file, $this->ignoredFiles)) { |
||
| 26 | continue; |
||
| 27 | } |
||
| 28 | |||
| 29 | // Capture the uploaded files for display later |
||
| 30 | self::$uploadedFiles[$what][] = $remotePath . $file; |
||
| 31 | |||
| 32 | // Copy the files |
||
| 33 | SSH::into($this->getRemoteName())->put( |
||
| 34 | $localPath .'/' . $file, |
||
| 35 | $remotePath . $file |
||
| 36 | ); |
||
| 37 | } |
||
| 38 | |||
| 39 | return true; |
||
| 40 | } |
||
| 41 | |||
| 47 | } |