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