Skip to content

Add support for phpseclib v3 and v4 - #12

Merged
TavoNiievez merged 9 commits into
Codeception:masterfrom
W0rma:update-phpseclib
Nov 3, 2026
Merged

TavoNiievez merged 9 commits into
Codeception:masterfrom
W0rma:update-phpseclib

Conversation

@W0rma

@W0rma W0rma commented Nov 3, 2026

Copy link
Copy Markdown
Contributor

Fixes #11

W0rma added 8 commits November 3, 2026 07:29
composer.json only allows phpseclib ^2.0, so the PEAR-style Net_SFTP,
Crypt_RSA and NET_SFTP_LOCAL_FILE code paths are unreachable.
size() was removed in phpseclib v4, filesize() is available in v2, v3 and v4.
The constant is defined on phpseclib\Net\SFTP (v2), phpseclib3\Net\SFTP (v3)
and phpseclib4\Net\SFTP (v4), so read it from the instantiated class.
The signature is mkdir($dir, $mode = -1, $recursive = false) in phpseclib
v2, v3 and v4, so `true` was passed as $mode and directories were never
created recursively. With strict_types and phpseclib v4's typed $mode
parameter this also causes a TypeError.
Without the recursive flag phpseclib removes the path as a file, which
fails for directories. The FTP implementation already deletes recursively.
The SFTP test was always skipped. Start an atmoz/sftp service container
in CI and configure the test via SFTP_* environment variables. The test
is still skipped if SFTP_HOST is not set.
@W0rma
W0rma force-pushed the update-phpseclib branch 3 times, most recently from 8868552 to 8ad134f Compare November 3, 2026 07:41
@TavoNiievez
TavoNiievez merged commit de6bb54 into Codeception:master Nov 3, 2026
5 checks passed
@W0rma
W0rma deleted the update-phpseclib branch November 4, 2026 06:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Please support phpseclib/phpseclib 3.x

2 participants