mirror of
https://github.com/deployphp/deployer.git
synced 2025-02-24 09:12:51 +01:00
Merge pull request #1264 from Exotherme/uploadAndDownloadUndefinedIndexNotice
Upload and download undefined index notice
This commit is contained in:
commit
b654659f54
@ -423,13 +423,15 @@ function upload($source, $destination, array $config = [])
|
||||
$host = Context::get()->getHost();
|
||||
$source = parse($source);
|
||||
$destination = parse($destination);
|
||||
$config['options'] = is_array($config['options']) ? $config['options'] : [];
|
||||
|
||||
if ($host instanceof Localhost) {
|
||||
$rsync->call($host->getHostname(), $source, $destination, $config);
|
||||
} else {
|
||||
$sshArguments = $host->getSshArguments()->getCliArguments();
|
||||
if (empty($sshArguments) === false) {
|
||||
if (!isset($config['options']) || !is_array($config['options'])) {
|
||||
$config['options'] = [];
|
||||
}
|
||||
$config['options'][] = "-e 'ssh $sshArguments'";
|
||||
}
|
||||
$rsync->call($host->getHostname(), $source, "$host:$destination", $config);
|
||||
@ -449,13 +451,15 @@ function download($source, $destination, array $config = [])
|
||||
$host = Context::get()->getHost();
|
||||
$source = parse($source);
|
||||
$destination = parse($destination);
|
||||
$config['options'] = is_array($config['options']) ? $config['options'] : [];
|
||||
|
||||
if ($host instanceof Localhost) {
|
||||
$rsync->call($host->getHostname(), $source, $destination, $config);
|
||||
} else {
|
||||
$sshArguments = $host->getSshArguments()->getCliArguments();
|
||||
if (empty($sshArguments) === false) {
|
||||
if (!isset($config['options']) || !is_array($config['options'])) {
|
||||
$config['options'] = [];
|
||||
}
|
||||
$config['options'][] = "-e 'ssh $sshArguments'";
|
||||
}
|
||||
$rsync->call($host->getHostname(), "$host:$source", $destination, $config);
|
||||
|
Loading…
x
Reference in New Issue
Block a user