@@ 461-473 (lines=13) @@ | ||
458 | /* |
|
459 | * Upload file or directory to host. |
|
460 | */ |
|
461 | function upload(string $source, string $destination, $config = []) |
|
462 | { |
|
463 | $rsync = Deployer::get()->rsync; |
|
464 | $host = currentHost(); |
|
465 | $source = parse($source); |
|
466 | $destination = parse($destination); |
|
467 | ||
468 | if ($host instanceof Localhost) { |
|
469 | $rsync->call($host, $source, $destination, $config); |
|
470 | } else { |
|
471 | $rsync->call($host, $source, "{$host->getConnectionString()}:$destination", $config); |
|
472 | } |
|
473 | } |
|
474 | ||
475 | /* |
|
476 | * Download file or directory from host |
|
@@ 478-490 (lines=13) @@ | ||
475 | /* |
|
476 | * Download file or directory from host |
|
477 | */ |
|
478 | function download(string $source, string $destination, $config = []) |
|
479 | { |
|
480 | $rsync = Deployer::get()->rsync; |
|
481 | $host = currentHost(); |
|
482 | $source = parse($source); |
|
483 | $destination = parse($destination); |
|
484 | ||
485 | if ($host instanceof Localhost) { |
|
486 | $rsync->call($host, $source, $destination, $config); |
|
487 | } else { |
|
488 | $rsync->call($host, "{$host->getConnectionString()}:$source", $destination, $config); |
|
489 | } |
|
490 | } |
|
491 | ||
492 | /** |
|
493 | * Writes an info message. |