| @@ 137-148 (lines=12) @@ | ||
| 134 | * @param bool $recursive |
|
| 135 | * @return mixed |
|
| 136 | */ |
|
| 137 | public function copy($src, $dest, $recursive = true) |
|
| 138 | { |
|
| 139 | $this->dispatcher->dispatch(TransporterEvents::TRANSPORTER_COPY, new TransporterEvent($this, array('dest' => $dest, 'src' => $src))); |
|
| 140 | ||
| 141 | $filesystem = new Filesystem(); |
|
| 142 | ||
| 143 | if ($recursive) { |
|
| 144 | $filesystem->mirror($src, $dest); |
|
| 145 | } else { |
|
| 146 | $filesystem->copy($src, $dest); |
|
| 147 | } |
|
| 148 | } |
|
| 149 | ||
| 150 | /** |
|
| 151 | * Removes a file/directory on the remote host |
|
| @@ 226-237 (lines=12) @@ | ||
| 223 | * @param bool $recursive |
|
| 224 | * @return mixed |
|
| 225 | */ |
|
| 226 | public function copy($src, $dest, $recursive = true) |
|
| 227 | { |
|
| 228 | $this->dispatcher->dispatch(TransporterEvents::TRANSPORTER_COPY, new TransporterEvent($this, array('dest' => $dest, 'src' => $src))); |
|
| 229 | ||
| 230 | $filesystem = new Filesystem(); |
|
| 231 | ||
| 232 | if ($recursive) { |
|
| 233 | $filesystem->mirror($src, $dest); |
|
| 234 | } else { |
|
| 235 | $filesystem->copy($src, $dest); |
|
| 236 | } |
|
| 237 | } |
|
| 238 | ||
| 239 | /** |
|
| 240 | * Removes a file/directory on the remote host |
|