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