@@ 425-437 (lines=13) @@ | ||
422 | /* |
|
423 | * Upload file or directory to host. |
|
424 | */ |
|
425 | function upload(string $source, string $destination, $config = []) |
|
426 | { |
|
427 | $rsync = Deployer::get()->rsync; |
|
428 | $host = currentHost(); |
|
429 | $source = parse($source); |
|
430 | $destination = parse($destination); |
|
431 | ||
432 | if ($host instanceof Localhost) { |
|
433 | $rsync->call($host, $source, $destination, $config); |
|
434 | } else { |
|
435 | $rsync->call($host, $source, "{$host->hostname()}:$destination", $config); |
|
436 | } |
|
437 | } |
|
438 | ||
439 | /* |
|
440 | * Download file or directory from host |
|
@@ 442-454 (lines=13) @@ | ||
439 | /* |
|
440 | * Download file or directory from host |
|
441 | */ |
|
442 | function download(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, "{$host->hostname()}:$source", $destination, $config); |
|
453 | } |
|
454 | } |
|
455 | ||
456 | /** |
|
457 | * Writes an info message. |