| @@ 66-87 (lines=22) @@ | ||
| 63 | * @param \phpbu\App\Backup\Target |
|
| 64 | * @return \phpbu\App\Cli\Executable |
|
| 65 | */ |
|
| 66 | public function getExecutable(Target $target) |
|
| 67 | { |
|
| 68 | if (null == $this->executable) { |
|
| 69 | $this->executable = new Executable\Rsync($this->pathToRsync); |
|
| 70 | if (!empty($this->args)) { |
|
| 71 | $this->executable->useArgs( |
|
| 72 | Util\Str::replaceTargetPlaceholders( |
|
| 73 | $this->args, |
|
| 74 | $target->getPathnamePlain() |
|
| 75 | ) |
|
| 76 | ); |
|
| 77 | } else { |
|
| 78 | $this->executable->fromHost($this->host) |
|
| 79 | ->fromUser($this->user) |
|
| 80 | ->fromPath($this->path) |
|
| 81 | ->toPath($this->getRsyncLocation($target)) |
|
| 82 | ->removeDeleted($this->delete) |
|
| 83 | ->exclude($this->excludes); |
|
| 84 | } |
|
| 85 | } |
|
| 86 | return $this->executable; |
|
| 87 | } |
|
| 88 | ||
| 89 | /** |
|
| 90 | * Create backup status. |
|
| @@ 87-109 (lines=23) @@ | ||
| 84 | * @param \phpbu\App\Backup\Target |
|
| 85 | * @return \phpbu\App\Cli\Executable |
|
| 86 | */ |
|
| 87 | public function getExecutable(Target $target) |
|
| 88 | { |
|
| 89 | if (null == $this->executable) { |
|
| 90 | $this->executable = new Executable\Rsync($this->pathToRsync); |
|
| 91 | if (!empty($this->args)) { |
|
| 92 | $this->executable->useArgs( |
|
| 93 | Util\Str::replaceTargetPlaceholders( |
|
| 94 | $this->args, |
|
| 95 | $target->getPathname() |
|
| 96 | ) |
|
| 97 | ); |
|
| 98 | } else { |
|
| 99 | $this->executable->fromPath($this->getRsyncLocation($target)) |
|
| 100 | ->toHost($this->host) |
|
| 101 | ->toPath($this->path) |
|
| 102 | ->toUser($this->user) |
|
| 103 | ->compressed(!$target->shouldBeCompressed()) |
|
| 104 | ->removeDeleted($this->delete) |
|
| 105 | ->exclude($this->excludes); |
|
| 106 | } |
|
| 107 | } |
|
| 108 | return $this->executable; |
|
| 109 | } |
|
| 110 | } |
|
| 111 | ||