Beispiel #1
0
 /**
  * Add exclude (pattern) list to rsync command
  *
  * @param CommandBuilder $command  Rsync Command
  * @param array          $list     List of excludes
  */
 protected function rsyncAddExcludeList(CommandBuilder $command, $list)
 {
     $rsyncFilter = $this->tempDir . '/.rsync-exclude';
     PhpUtility::filePutContents($rsyncFilter, implode("\n", $list));
     $command->addArgumentTemplate('--exclude-from=%s', $rsyncFilter);
     // cleanup rsync file
     $command->getExecutor()->addFinisherCallback(function () use($rsyncFilter) {
         unlink($rsyncFilter);
     });
 }