コード例 #1
0
ファイル: Rsync.php プロジェクト: todiadiyatmo/phpbu
 /**
  * Create the Exec to run the 'rsync' command.
  *
  * @param  \phpbu\App\Backup\Target $target
  * @return \phpbu\App\Cli\Executable
  */
 public function getExecutable(Target $target)
 {
     if (null == $this->executable) {
         $this->executable = new Executable\Rsync($this->pathToRsync);
         if (!empty($this->args)) {
             $this->executable->useArgs(Util\Str::replaceTargetPlaceholders($this->args, $target->getPathname()));
         } else {
             $this->executable->syncFrom($this->getSyncSource($target))->toHost($this->host)->toPath($this->path)->asUser($this->user)->compressed(!$target->shouldBeCompressed())->removeDeleted($this->delete)->exclude($this->excludes);
         }
     }
     return $this->executable;
 }