/** * Simulates the backup. * * @param \phpbu\App\Backup\Source $source * @param \phpbu\App\Backup\Target $target * @param \phpbu\App\Result $result * @throws \phpbu\App\Exception */ protected function simulate(SourceExe $source, Target $target, Result $result) { if ($source instanceof Simulator) { $status = $source->simulate($target, $result); $this->compress($status, $target, $result); } }
/** * Executes the backup and compression. * * @param \phpbu\App\Backup\Source $source * @param \phpbu\App\Backup\Target $target * @param \phpbu\App\Result $result * @throws \phpbu\App\Exception */ public function run(SourceExe $source, Target $target, Result $result) { $status = $source->backup($target, $result); if ($target->shouldBeCompressed()) { if (is_a($status, '\\phpbu\\App\\Backup\\Source\\Status') && !$status->handledCompression()) { $this->handleCompression($target, $result, $status->getDataPath()); } } }