Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
"openspout/openspout": "~5.3.0",
"packaged/thrift": "^0.15.0",
"php-http/discovery": "^1.0",
"phpseclib/phpseclib": "^3.0",
"phpseclib/phpseclib": "^4.0",
"psr/clock": "^1.0",
"psr/http-client": "^1.0",
"psr/http-factory": "^1.0",
Expand Down
248 changes: 104 additions & 144 deletions composer.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

12 changes: 6 additions & 6 deletions documentation/components/bridges/filesystem-sftp-bridge.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ $sftp = sftp_client($_ENV['SFTP_HOST'], $_ENV['SFTP_USER'], $_ENV['SFTP_PASSWORD
$sftp = sftp_client(
$_ENV['SFTP_HOST'],
$_ENV['SFTP_USER'],
\phpseclib3\Crypt\PublicKeyLoader::load(\file_get_contents($_ENV['SFTP_PRIVATE_KEY'])),
\phpseclib4\Crypt\PublicKeyLoader::load(\file_get_contents($_ENV['SFTP_PRIVATE_KEY'])),
port: 2222,
);

Expand Down Expand Up @@ -114,13 +114,13 @@ $filesystem = sftp_filesystem(

## Lost connections

This bridge does not reconnect on your behalf. phpseclib answers a dropped session with the same
`false` it uses for "no such file", so every operation checks the session before reporting an empty
result, and raises `Flow\Filesystem\Exception\RuntimeException` naming the operation that failed:
This bridge does not reconnect on your behalf. phpseclib raises `InvalidStateException` once a
session is gone and `FileSystemException` when a path is missing or unreadable; the bridge turns the
first into `Flow\Filesystem\Exception\RuntimeException` naming the operation that failed, and keeps
the original exception as `previous`:

```
SFTP session is no longer usable, cannot read /upload/orders.csv. The connection was closed or lost,
this bridge does not reconnect on your behalf.
SFTP session is no longer usable, cannot read /upload/orders.csv
```

Long running pipelines against servers with an idle timeout should keep that in mind and build a
Expand Down
2 changes: 1 addition & 1 deletion src/bridge/filesystem/sftp/composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
"php": "~8.3.0 || ~8.4.0 || ~8.5.0",
"flow-php/filesystem": "self.version",
"flow-php/types": "self.version",
"phpseclib/phpseclib": "^3.0"
"phpseclib/phpseclib": "^4.0"
},
"config": {
"optimize-autoloader": true,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@
use Flow\Filesystem\Bridge\SFTP\SFTPFilesystem;
use Flow\Filesystem\Exception\RuntimeException;
use Flow\Filesystem\Mount;
use phpseclib3\Crypt\Common\PrivateKey;
use phpseclib3\Net\SFTP;
use phpseclib4\Crypt\Common\PrivateKey;
use phpseclib4\Net\SFTP;
use SensitiveParameter;

use function sprintf;
Expand Down
Loading