| Conditions | 1 |
| Paths | 1 |
| Total Lines | 15 |
| Code Lines | 9 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 52 | protected function makeZip(string $path): void |
||
| 53 | { |
||
| 54 | $encryption = config('backup-shield.encryption'); |
||
| 55 | |||
| 56 | $zipArchive = new ZipArchive; |
||
| 57 | |||
| 58 | $zipArchive->open($path, ZipArchive::OVERWRITE); |
||
| 59 | $zipArchive->addFile($path, 'backup.zip'); |
||
| 60 | $zipArchive->setPassword($this->password); |
||
| 61 | Collection::times($zipArchive->numFiles, function ($i) use ($zipArchive, $encryption) { |
||
| 62 | $zipArchive->setEncryptionIndex($i - 1, $encryption); |
||
| 63 | }); |
||
| 64 | $zipArchive->close(); |
||
| 65 | |||
| 66 | $this->path = $path; |
||
| 67 | } |
||
| 69 |