| @@ 440-452 (lines=13) @@ | ||
| 437 | /* |
|
| 438 | * Upload file or directory to host. |
|
| 439 | */ |
|
| 440 | function upload(string $source, string $destination, $config = []) |
|
| 441 | { |
|
| 442 | $rsync = Deployer::get()->rsync; |
|
| 443 | $host = currentHost(); |
|
| 444 | $source = parse($source); |
|
| 445 | $destination = parse($destination); |
|
| 446 | ||
| 447 | if ($host instanceof Localhost) { |
|
| 448 | $rsync->call($host, $source, $destination, $config); |
|
| 449 | } else { |
|
| 450 | $rsync->call($host, $source, "{$host->hostname()}:$destination", $config); |
|
| 451 | } |
|
| 452 | } |
|
| 453 | ||
| 454 | /* |
|
| 455 | * Download file or directory from host |
|
| @@ 457-469 (lines=13) @@ | ||
| 454 | /* |
|
| 455 | * Download file or directory from host |
|
| 456 | */ |
|
| 457 | function download(string $source, string $destination, $config = []) |
|
| 458 | { |
|
| 459 | $rsync = Deployer::get()->rsync; |
|
| 460 | $host = currentHost(); |
|
| 461 | $source = parse($source); |
|
| 462 | $destination = parse($destination); |
|
| 463 | ||
| 464 | if ($host instanceof Localhost) { |
|
| 465 | $rsync->call($host, $source, $destination, $config); |
|
| 466 | } else { |
|
| 467 | $rsync->call($host, "{$host->hostname()}:$source", $destination, $config); |
|
| 468 | } |
|
| 469 | } |
|
| 470 | ||
| 471 | /** |
|
| 472 | * Writes an info message. |
|