Skip to content

Commit

Permalink
Fix thephpleague#116 - replaced input parameter of the method ensureP…
Browse files Browse the repository at this point in the history
…arentDirectoryExists in the upload
  • Loading branch information
Oldrich Kaucky committed Jan 29, 2021
1 parent dcd572e commit addff91
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion SftpAdapter.php
Original file line number Diff line number Diff line change
Expand Up @@ -75,10 +75,11 @@ public function fileExists(string $path): bool
*/
private function upload(string $path, $contents, Config $config): void
{
$this->ensureParentDirectoryExists($path, $config);
$connection = $this->connectionProvider->provideConnection();
$location = $this->prefixer->prefixPath($path);

$this->ensureParentDirectoryExists($location, $config);

if ( ! $connection->put($location, $contents, SFTP::SOURCE_STRING)) {
throw UnableToWriteFile::atLocation($path, 'not able to write the file');
}
Expand Down

0 comments on commit addff91

Please sign in to comment.