| @@ 229-236 (lines=8) @@ | ||
| 226 | ||
| 227 | private function backupFile($targetFile) |
|
| 228 | { |
|
| 229 | if($this->enableBackup === true) |
|
| 230 | { |
|
| 231 | if($this->sources->has($targetFile)) |
|
| 232 | { |
|
| 233 | $backupFile = $targetFile . Application::BACKUP_SUFFIX; |
|
| 234 | $this->sources->write($backupFile, $this->sources->read($targetFile), true); |
|
| 235 | } |
|
| 236 | } |
|
| 237 | } |
|
| 238 | ||
| 239 | public function rollback() |
|
| @@ 256-265 (lines=10) @@ | ||
| 253 | $targetFile = substr($file, 0, strlen($this->suffix) * -1); |
|
| 254 | $backupFile = $targetFile . Application::BACKUP_SUFFIX; |
|
| 255 | ||
| 256 | if($this->sources->has($backupFile)) |
|
| 257 | { |
|
| 258 | $this->info(" Writing $targetFile"); |
|
| 259 | ||
| 260 | if($this->dryRun === false) |
|
| 261 | { |
|
| 262 | $backupContent = $this->sources->read($backupFile); |
|
| 263 | $this->sources->write($targetFile, $backupContent, true); |
|
| 264 | } |
|
| 265 | } |
|
| 266 | } |
|
| 267 | } |
|