| Conditions | 4 |
| Paths | 4 |
| Total Lines | 21 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 19 | public function save($directory) |
||
| 20 | { |
||
| 21 | if (empty($this->contents)) { |
||
| 22 | return false; |
||
| 23 | } |
||
| 24 | |||
| 25 | if ($this->exists($directory)) { |
||
| 26 | return true; |
||
| 27 | } |
||
| 28 | |||
| 29 | $compressedPath = $directory . DIRECTORY_SEPARATOR . $this->getOutputFileName(); |
||
| 30 | $this->removeOldVersions($directory); |
||
| 31 | file_put_contents($compressedPath, $this->contents); |
||
| 32 | $extracted = $this->resolver->extract($compressedPath, $directory); |
||
| 33 | |||
| 34 | if ($extracted) { |
||
| 35 | chmod("$directory/{$this->getExtractedName()}", 0777); |
||
| 36 | } |
||
| 37 | |||
| 38 | return $extracted; |
||
| 39 | } |
||
| 40 | |||
| 66 |