diff --git a/src/Ssh.php b/src/Ssh.php index c822199..41952b2 100755 --- a/src/Ssh.php +++ b/src/Ssh.php @@ -197,11 +197,15 @@ public function upload(string $sourcePath, string $destinationPath): Process protected function getExtraScpOptions(): string { - $extraOptions = $this->getExtraOptions(); + $extraOptions = $this->extraOptions; + + if (isset($extraOptions['port'])) { + $extraOptions['port'] = str_replace('-p', '-P', $extraOptions['port']); + } $extraOptions[] = '-r'; - return implode(' ', $extraOptions); + return implode(' ', array_values($extraOptions)); } private function getExtraOptions(): array