Esempio n. 1
0
 /**
  * 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);
     }
 }
Esempio n. 2
0
 /**
  * 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());
         }
     }
 }