Exemple #1
0
 /**
  * Add the 'rm' command to remove the uncrypted file.
  *
  * @param \phpbu\App\Cli\Process $process
  */
 protected function addDeleteCommand(Process $process)
 {
     if ($this->deleteUncrypted) {
         $cmd = new Cmd('rm');
         if (!$this->showStdErr) {
             $cmd->silence();
             // i kill you
         }
         $cmd->addArgument($this->sourceFile);
         $process->addCommand($cmd);
     }
 }
Exemple #2
0
 /**
  * Process generator
  */
 protected function createProcess()
 {
     // check source and target settings
     if (empty($this->path)) {
         throw new Exception('no directory to compress');
     }
     if (empty($this->tarPathname)) {
         throw new Exception('no target filename set');
     }
     $process = new Process();
     $tar = new Cmd($this->binary);
     // no std error unless it is activated
     if (!$this->showStdErr) {
         $tar->silence();
         // i kill you
     }
     $tar->addOption('-' . $this->compression . 'cf');
     $tar->addArgument($this->tarPathname);
     $tar->addOption('-C', $this->path, ' ');
     $tar->addArgument('.');
     $process->addCommand($tar);
     // delete the source data if requested
     if ($this->removeSourceDir) {
         $process->addCommand($this->getRmCommand());
     }
     return $process;
 }